summaryrefslogtreecommitdiff
path: root/include/svtools/ehdl.hxx
blob: 24878019ec0e39944fe6318c408dd2f229c26fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * 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 .
 */

#ifndef INCLUDED_SVTOOLS_EHDL_HXX
#define INCLUDED_SVTOOLS_EHDL_HXX

#include <svtools/svtdllapi.h>
#include <svtools/svtresid.hxx>
#include <vcl/errinf.hxx>

typedef std::pair<const char*, ErrCode> ErrMsgCode;
SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRHDL[];
SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRCTX[];

namespace weld { class Window; }

class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
{
public:
    SfxErrorContext(
            sal_uInt16 nCtxIdP, weld::Window *pWin=nullptr,
            const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale());
    SfxErrorContext(
            sal_uInt16 nCtxIdP, const OUString &aArg1, weld::Window *pWin=nullptr,
            const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale());
    bool GetString(ErrCode nErrId, OUString &rStr) override;

private:
    sal_uInt16 const nCtxId;
    const ErrMsgCode* pIds;
    std::locale const aResLocale;
    OUString const aArg1;
};

class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
{
public:
    SfxErrorHandler(const ErrMsgCode* pIds, ErrCodeArea lStart, ErrCodeArea lEnd, const std::locale& rResLocale = SvtResLocale());
    virtual ~SfxErrorHandler() override;

protected:
    bool     GetErrorString(ErrCode lErrId, OUString &) const;

private:

    ErrCodeArea const          lStart;
    ErrCodeArea const          lEnd;
    const ErrMsgCode*    pIds;
    std::locale const aResLocale;

    SVT_DLLPRIVATE static void GetClassString(ErrCodeClass lErrId, OUString &);
    virtual bool          CreateString(const ErrorInfo *, OUString &) const override;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ref='/cgit/lo/core/commit/sfx2/source/dialog?h=cp-6.2-16&id=d197d524c5292cf6d66be802ec7d1fed78e30416'>loplugin:staticmethods in sfx2Noel Grandin 2018-11-13loplugin:singlevalfields in sfx2Noel Grandin 2018-11-13Use shared methods instead of duplicated codeSamuel Mehrbrodt 2018-11-09css::security::DocumentSignatureInformation::SignatureTime is 32 bitStephan Bergmann 2018-11-08Convert FieldUnit to scoped enumMike Kaganski 2018-11-08loplugin:constantparamNoel Grandin 2018-11-07move SvTreeListBox to vclCaolán McNamara 2018-11-06-Werror,-Wunused-private-fieldStephan Bergmann 2018-11-05weld SwIndexMarkModalDlg clusterCaolán McNamara 2018-11-04tdf#120703 PVS: V547 Get rid of mutexes to initialize function-local staticsMike Kaganski 2018-11-04reweld SwWordCountFloatDlgCaolán McNamara 2018-11-03Handle the case if no digital signature code is implemented (iOS, currently)Tor Lillqvist 2018-11-02Revert "weld SwWordCountFloatDlg"Stephan Bergmann 2018-11-01weld SwWordCountFloatDlgCaolán McNamara 2018-11-01tdf#49684 Don't focus on Navigator or Sidebar on showJim Raykowski 2018-10-31replace StartExecuteModal with StartExecuteAsyncCaolán McNamara 2018-10-31loplugin:useuniqueptr in SfxSplitWindowNoel Grandin 2018-10-28tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski 2018-10-27loplugin:unusedmethodsNoel Grandin 2018-10-26tdf#42949 Fix IWYU warnings in include/unotools/*Gabor Kelemen 2018-10-25tdf#120188 limit the width of the styles combos in the url tabpageCaolán McNamara 2018-10-25loplugin:unusedmethodsNoel Grandin 2018-10-24weld AdvancedSettingsDialogCaolán McNamara 2018-10-24clang-tidy performance-unnecessary-copy-init in sfx2..svtoolsNoel Grandin 2018-10-22pvs-studio: V571 Recurring checkCaolán McNamara 2018-10-20weld SchAttribTabDlgCaolán McNamara 2018-10-19clang-tidy readability-container-size-emptyNoel Grandin 2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin 2018-10-16loplugin:singlevalfields in sfx2Noel Grandin 2018-10-15m_pLine is always unsetCaolán McNamara