2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-11 09:51:50 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <limits.h>
|
2007-06-27 21:17:34 +00:00
|
|
|
#include <tools/shl.hxx>
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#include <tools/errinf.hxx>
|
2011-06-30 22:54:36 +01:00
|
|
|
#include <rtl/strbuf.hxx>
|
2014-11-14 22:52:35 +01:00
|
|
|
#include <osl/diagnose.h>
|
2015-03-09 14:29:30 +02:00
|
|
|
#include <vcl/window.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
class ErrorHandler;
|
|
|
|
|
2006-06-19 12:49:08 +00:00
|
|
|
namespace {
|
|
|
|
typedef void (* DisplayFnPtr)();
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
struct EDcrData
|
|
|
|
{
|
2012-08-18 18:33:10 +02:00
|
|
|
public:
|
2000-09-18 16:07:07 +00:00
|
|
|
ErrorHandler *pFirstHdl;
|
|
|
|
ErrorContext *pFirstCtx;
|
2006-06-19 12:49:08 +00:00
|
|
|
DisplayFnPtr pDsp;
|
2013-06-29 23:57:38 -05:00
|
|
|
bool bIsWindowDsp;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
DynamicErrorInfo *ppDcr[ERRCODE_DYNAMIC_COUNT];
|
2012-08-18 18:33:10 +02:00
|
|
|
sal_uInt16 nNextDcr;
|
2000-09-18 16:07:07 +00:00
|
|
|
EDcrData();
|
|
|
|
|
|
|
|
static EDcrData *GetData();
|
|
|
|
};
|
|
|
|
|
|
|
|
class EDcr_Impl
|
|
|
|
{
|
2012-08-18 18:33:10 +02:00
|
|
|
sal_uIntPtr lErrId;
|
|
|
|
sal_uInt16 nMask;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void RegisterEDcr(DynamicErrorInfo *);
|
2015-03-30 13:32:08 +02:00
|
|
|
static void UnRegisterEDcr(DynamicErrorInfo *);
|
2010-07-29 10:56:19 +08:00
|
|
|
static ErrorInfo *GetDynamicErrorInfo(sal_uIntPtr lId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
friend class DynamicErrorInfo;
|
|
|
|
friend class ErrorInfo;
|
|
|
|
};
|
|
|
|
|
|
|
|
EDcrData::EDcrData()
|
2014-03-10 12:45:00 +00:00
|
|
|
: pFirstHdl(0)
|
|
|
|
, pFirstCtx(0)
|
|
|
|
, pDsp(0)
|
|
|
|
, bIsWindowDsp(false)
|
|
|
|
, nNextDcr(0)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-07-29 10:56:19 +08:00
|
|
|
for(sal_uInt16 n=0;n<ERRCODE_DYNAMIC_COUNT;n++)
|
2000-09-18 16:07:07 +00:00
|
|
|
ppDcr[n]=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EDcrData *EDcrData::GetData()
|
|
|
|
{
|
2015-03-28 19:08:00 +01:00
|
|
|
EDcrData **ppDat=reinterpret_cast<EDcrData **>(GetAppData(SHL_ERR));
|
2000-09-18 16:07:07 +00:00
|
|
|
if(!*ppDat)
|
|
|
|
{
|
|
|
|
return (*ppDat=new EDcrData);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return *ppDat;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EDcr_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
|
|
|
|
{
|
2012-08-11 23:01:00 +00:00
|
|
|
// Register dynamic identifier
|
2000-09-18 16:07:07 +00:00
|
|
|
EDcrData* pData=EDcrData::GetData();
|
2010-07-29 10:56:19 +08:00
|
|
|
lErrId= (((sal_uIntPtr)pData->nNextDcr + 1) << ERRCODE_DYNAMIC_SHIFT) +
|
2000-09-18 16:07:07 +00:00
|
|
|
pDcr->GetErrorCode();
|
|
|
|
DynamicErrorInfo **ppDcr=pData->ppDcr;
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uInt16 nNext=pData->nNextDcr;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if(ppDcr[nNext])
|
|
|
|
{
|
|
|
|
delete ppDcr[nNext];
|
|
|
|
}
|
|
|
|
ppDcr[nNext]=pDcr;
|
|
|
|
if(++pData->nNextDcr>=ERRCODE_DYNAMIC_COUNT)
|
|
|
|
pData->nNextDcr=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EDcr_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr)
|
|
|
|
{
|
|
|
|
|
|
|
|
EDcrData* pData=EDcrData::GetData();
|
|
|
|
DynamicErrorInfo **ppDcr=pData->ppDcr;
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr lIdx=(
|
|
|
|
((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
|
2000-09-18 16:07:07 +00:00
|
|
|
DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
|
|
|
|
if(ppDcr[lIdx]==pDcr)
|
|
|
|
ppDcr[lIdx]=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT0(ErrorInfo);
|
|
|
|
TYPEINIT1(DynamicErrorInfo, ErrorInfo);
|
|
|
|
TYPEINIT1(StringErrorInfo, DynamicErrorInfo);
|
|
|
|
TYPEINIT1(TwoStringErrorInfo, DynamicErrorInfo);
|
|
|
|
TYPEINIT1(MessageInfo, DynamicErrorInfo);
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if(lId & ERRCODE_DYNAMIC_MASK)
|
|
|
|
return EDcr_Impl::GetDynamicErrorInfo(lId);
|
|
|
|
else
|
|
|
|
return new ErrorInfo(lId);
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
DynamicErrorInfo::operator sal_uIntPtr() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
return pImpl->lErrId;
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask)
|
2000-09-18 16:07:07 +00:00
|
|
|
: ErrorInfo(lArgUserId)
|
|
|
|
{
|
|
|
|
pImpl=new EDcr_Impl;
|
|
|
|
pImpl->RegisterEDcr(this);
|
|
|
|
pImpl->nMask=nMask;
|
|
|
|
}
|
|
|
|
|
|
|
|
DynamicErrorInfo::~DynamicErrorInfo()
|
|
|
|
{
|
2015-03-30 13:32:08 +02:00
|
|
|
EDcr_Impl::UnRegisterEDcr(this);
|
2000-09-18 16:07:07 +00:00
|
|
|
delete pImpl;
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uIntPtr lIdx=((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
|
2000-09-18 16:07:07 +00:00
|
|
|
DynamicErrorInfo* pDcr=EDcrData::GetData()->ppDcr[lIdx];
|
2010-07-29 10:56:19 +08:00
|
|
|
if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
|
2000-09-18 16:07:07 +00:00
|
|
|
return pDcr;
|
|
|
|
else
|
|
|
|
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);
|
|
|
|
}
|
|
|
|
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uInt16 DynamicErrorInfo::GetDialogMask() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
return pImpl->nMask;
|
|
|
|
}
|
|
|
|
|
|
|
|
StringErrorInfo::StringErrorInfo(
|
2012-10-04 17:13:24 +02:00
|
|
|
sal_uIntPtr UserId, const OUString& aStringP, sal_uInt16 nFlags)
|
2006-06-19 12:49:08 +00:00
|
|
|
: DynamicErrorInfo(UserId, nFlags), aString(aStringP)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
class ErrHdl_Impl
|
|
|
|
{
|
2012-08-18 18:33:10 +02:00
|
|
|
public:
|
2000-09-18 16:07:07 +00:00
|
|
|
ErrorHandler *pNext;
|
2013-06-29 23:57:38 -05:00
|
|
|
static bool CreateString(const ErrorHandler *pStart,
|
2012-10-04 17:13:24 +02:00
|
|
|
const ErrorInfo*, OUString&, sal_uInt16&);
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2012-10-04 17:13:24 +02:00
|
|
|
static void aDspFunc(const OUString &rErr, const OUString &rAction)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OStringBuffer aErr("Aktion: ");
|
|
|
|
aErr.append(OUStringToOString(rAction, RTL_TEXTENCODING_ASCII_US));
|
2013-03-15 21:59:24 +01:00
|
|
|
aErr.append(" Fehler: ");
|
2013-04-07 12:06:47 +02:00
|
|
|
aErr.append(OUStringToOString(rErr, RTL_TEXTENCODING_ASCII_US));
|
2011-11-16 21:20:20 +00:00
|
|
|
OSL_FAIL(aErr.getStr());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-04-16 21:59:00 +01:00
|
|
|
// FIXME: this is a horrible reverse dependency on VCL
|
2015-04-10 19:16:08 +01:00
|
|
|
struct ErrorContextImpl
|
|
|
|
{
|
2015-04-16 21:59:00 +01:00
|
|
|
ErrorContext *pNext;
|
|
|
|
vcl::Window *pWin; // should be VclPtr for strong lifecyle
|
2015-04-10 19:16:08 +01:00
|
|
|
};
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
ErrorContext::ErrorContext(vcl::Window *pWinP)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-04-10 19:16:08 +01:00
|
|
|
pImpl = new ErrorContextImpl();
|
2000-09-18 16:07:07 +00:00
|
|
|
EDcrData *pData=EDcrData::GetData();
|
2015-04-10 19:16:08 +01:00
|
|
|
ErrorContext *&pHdl = pData->pFirstCtx;
|
|
|
|
pImpl->pWin = pWinP;
|
|
|
|
pImpl->pNext = pHdl;
|
|
|
|
pHdl = this;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorContext::~ErrorContext()
|
|
|
|
{
|
|
|
|
ErrorContext **ppCtx=&(EDcrData::GetData()->pFirstCtx);
|
|
|
|
while(*ppCtx && *ppCtx!=this)
|
2015-04-10 19:16:08 +01:00
|
|
|
ppCtx=&((*ppCtx)->pImpl->pNext);
|
2000-09-18 16:07:07 +00:00
|
|
|
if(*ppCtx)
|
2015-04-10 19:16:08 +01:00
|
|
|
*ppCtx=(*ppCtx)->pImpl->pNext;
|
|
|
|
delete pImpl;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ErrorContext *ErrorContext::GetContext()
|
|
|
|
{
|
|
|
|
return EDcrData::GetData()->pFirstCtx;
|
|
|
|
}
|
|
|
|
|
|
|
|
ErrorHandler::ErrorHandler()
|
|
|
|
{
|
|
|
|
pImpl=new ErrHdl_Impl;
|
|
|
|
EDcrData *pData=EDcrData::GetData();
|
|
|
|
ErrorHandler *&pHdl=pData->pFirstHdl;
|
|
|
|
pImpl->pNext=pHdl;
|
|
|
|
pHdl=this;
|
|
|
|
if(!pData->pDsp)
|
|
|
|
RegisterDisplay(&aDspFunc);
|
|
|
|
}
|
|
|
|
|
|
|
|
ErrorHandler::~ErrorHandler()
|
|
|
|
{
|
|
|
|
ErrorHandler **ppHdl=&(EDcrData::GetData()->pFirstHdl);
|
|
|
|
while(*ppHdl && *ppHdl!=this)
|
|
|
|
ppHdl=&((*ppHdl)->pImpl->pNext);
|
|
|
|
if(*ppHdl)
|
|
|
|
*ppHdl=(*ppHdl)->pImpl->pNext;
|
|
|
|
delete pImpl;
|
|
|
|
}
|
|
|
|
|
2015-04-10 19:16:08 +01:00
|
|
|
vcl::Window* ErrorContext::GetParent()
|
|
|
|
{
|
2015-04-16 21:59:00 +01:00
|
|
|
return pImpl ? pImpl->pWin : NULL;
|
2015-04-10 19:16:08 +01:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void ErrorHandler::RegisterDisplay(WindowDisplayErrorFunc *aDsp)
|
|
|
|
{
|
|
|
|
EDcrData *pData=EDcrData::GetData();
|
2013-06-29 23:57:38 -05:00
|
|
|
pData->bIsWindowDsp=true;
|
2006-06-19 12:49:08 +00:00
|
|
|
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ErrorHandler::RegisterDisplay(BasicDisplayErrorFunc *aDsp)
|
|
|
|
{
|
|
|
|
EDcrData *pData=EDcrData::GetData();
|
2013-06-29 23:57:38 -05:00
|
|
|
pData->bIsWindowDsp=false;
|
2006-06-19 12:49:08 +00:00
|
|
|
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2012-08-11 23:01:00 +00:00
|
|
|
/** Handles an error.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2012-08-11 23:01:00 +00:00
|
|
|
If nFlags is not set, the DynamicErrorInfo flags or the
|
|
|
|
resource flags will be used.
|
|
|
|
Thus:
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
1. nFlags,
|
|
|
|
2. Resource Flags
|
|
|
|
3. Dynamic Flags
|
|
|
|
4. Default ERRCODE_BUTTON_OK, ERRCODE_MSG_ERROR
|
|
|
|
|
2012-08-11 23:01:00 +00:00
|
|
|
@param lId error id
|
|
|
|
@param nFlags error flags.
|
|
|
|
@param bJustCreateString ???
|
|
|
|
@param rError ???
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2012-08-11 23:01:00 +00:00
|
|
|
@return ???
|
|
|
|
*/
|
|
|
|
sal_uInt16 ErrorHandler::HandleError_Impl(
|
2013-06-29 23:57:38 -05:00
|
|
|
sal_uIntPtr lId, sal_uInt16 nFlags, bool bJustCreateString, OUString & rError)
|
2012-08-11 23:01:00 +00:00
|
|
|
{
|
2012-10-04 17:13:24 +02:00
|
|
|
OUString aErr;
|
|
|
|
OUString aAction;
|
2000-09-18 16:07:07 +00:00
|
|
|
if(!lId || lId == ERRCODE_ABORT)
|
|
|
|
return 0;
|
|
|
|
EDcrData *pData=EDcrData::GetData();
|
|
|
|
ErrorInfo *pInfo=ErrorInfo::GetErrorInfo(lId);
|
|
|
|
ErrorContext *pCtx=ErrorContext::GetContext();
|
|
|
|
if(pCtx)
|
|
|
|
pCtx->GetString(pInfo->GetErrorCode(), aAction);
|
2014-09-23 11:20:40 +02:00
|
|
|
vcl::Window *pParent=0;
|
2012-08-11 23:01:00 +00:00
|
|
|
// Remove parent from context
|
2015-04-10 19:16:08 +01:00
|
|
|
for(;pCtx;pCtx=pCtx->pImpl->pNext)
|
2000-09-18 16:07:07 +00:00
|
|
|
if(pCtx->GetParent())
|
|
|
|
{
|
|
|
|
pParent=pCtx->GetParent();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-06-29 23:57:38 -05:00
|
|
|
bool bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uInt16 nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
|
2005-11-11 11:15:49 +00:00
|
|
|
if (bWarning)
|
|
|
|
nErrFlags |= ERRCODE_MSG_WARNING;
|
|
|
|
else
|
|
|
|
nErrFlags |= ERRCODE_MSG_ERROR;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
DynamicErrorInfo* pDynPtr=PTR_CAST(DynamicErrorInfo,pInfo);
|
|
|
|
if(pDynPtr)
|
|
|
|
{
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
|
2000-09-18 16:07:07 +00:00
|
|
|
if( nDynFlags )
|
|
|
|
nErrFlags = nDynFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ErrHdl_Impl::CreateString(pData->pFirstHdl,pInfo,aErr,nErrFlags))
|
|
|
|
{
|
2011-11-16 21:20:20 +00:00
|
|
|
if (bJustCreateString)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-11-16 21:20:20 +00:00
|
|
|
rError = aErr;
|
|
|
|
return 1;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
2006-12-13 14:07:03 +00:00
|
|
|
{
|
2011-11-16 21:20:20 +00:00
|
|
|
if(!pData->pDsp)
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OStringBuffer aStr("Action: ");
|
|
|
|
aStr.append(OUStringToOString(aAction, RTL_TEXTENCODING_ASCII_US));
|
2013-03-15 21:59:24 +01:00
|
|
|
aStr.append("\nFehler: ");
|
2013-04-07 12:06:47 +02:00
|
|
|
aStr.append(OUStringToOString(aErr, RTL_TEXTENCODING_ASCII_US));
|
2011-11-16 21:20:20 +00:00
|
|
|
OSL_FAIL(aStr.getStr());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
delete pInfo;
|
|
|
|
if(!pData->bIsWindowDsp)
|
|
|
|
{
|
2015-01-18 21:37:25 +01:00
|
|
|
(*reinterpret_cast<BasicDisplayErrorFunc*>(pData->pDsp))(aErr,aAction);
|
2011-11-16 21:20:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-10-13 20:34:54 +01:00
|
|
|
if (nFlags != USHRT_MAX)
|
|
|
|
nErrFlags = nFlags;
|
2015-01-18 21:37:25 +01:00
|
|
|
return (*reinterpret_cast<WindowDisplayErrorFunc*>(pData->pDsp))(
|
2012-10-13 20:34:54 +01:00
|
|
|
pParent, nErrFlags, aErr, aAction);
|
2011-11-16 21:20:20 +00:00
|
|
|
}
|
|
|
|
}
|
2006-12-13 14:07:03 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2011-03-01 19:08:19 +01:00
|
|
|
OSL_FAIL("Error nicht behandelt");
|
2012-08-11 23:01:00 +00:00
|
|
|
// Error 1 is General Error in the Sfx
|
2011-11-16 21:20:20 +00:00
|
|
|
if(pInfo->GetErrorCode()!=1)
|
|
|
|
{
|
2006-12-13 14:07:03 +00:00
|
|
|
HandleError_Impl(1, USHRT_MAX, bJustCreateString, rError);
|
2008-04-22 14:09:09 +00:00
|
|
|
}
|
2011-11-16 21:20:20 +00:00
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:08:19 +01:00
|
|
|
OSL_FAIL("Error 1 nicht gehandeled");
|
2008-04-22 14:09:09 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
delete pInfo;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-12-13 14:07:03 +00:00
|
|
|
// static
|
2013-06-29 23:57:38 -05:00
|
|
|
bool ErrorHandler::GetErrorString(sal_uIntPtr lId, OUString& rStr)
|
2006-12-13 14:07:03 +00:00
|
|
|
{
|
2013-06-29 23:57:38 -05:00
|
|
|
return (bool)HandleError_Impl( lId, USHRT_MAX, true, rStr );
|
2006-12-13 14:07:03 +00:00
|
|
|
}
|
|
|
|
|
2012-08-11 23:01:00 +00:00
|
|
|
/** Handles an error.
|
|
|
|
|
|
|
|
@see ErrorHandler::HandleError_Impl
|
|
|
|
*/
|
2010-07-29 10:56:19 +08:00
|
|
|
sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags)
|
2006-12-13 14:07:03 +00:00
|
|
|
{
|
2012-10-04 17:13:24 +02:00
|
|
|
OUString aDummy;
|
2013-06-29 23:57:38 -05:00
|
|
|
return HandleError_Impl( lId, nFlags, false, aDummy );
|
2006-12-13 14:07:03 +00:00
|
|
|
}
|
|
|
|
|
2013-06-29 23:57:38 -05:00
|
|
|
bool ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
|
2012-10-04 17:13:24 +02:00
|
|
|
const ErrorInfo* pInfo, OUString& pStr,
|
2012-08-18 18:33:10 +02:00
|
|
|
sal_uInt16 &rFlags)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
for(const ErrorHandler *pHdl=pStart;pHdl;pHdl=pHdl->pImpl->pNext)
|
|
|
|
{
|
|
|
|
if(pHdl->CreateString( pInfo, pStr, rFlags))
|
2013-06-29 23:57:38 -05:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2013-06-29 23:57:38 -05:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|