diff options
author | dante <dante19031999@gmail.com> | 2021-02-27 18:21:47 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-27 20:35:59 +0100 |
commit | e9bae566f43dd6f26c2c4b7d84a449b7b01265dc (patch) | |
tree | d6fd6e1808ec376076cb8db3e4d60fe357f582c5 /starmath | |
parent | 149807eb6100090e178505ba4a264bb38eba1e0c (diff) |
Move smparsers shared error ressources to base class
Change-Id: Ica8c34162c7a2641e00de33105eb44eb99b167a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111685
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/Library_sm.mk | 1 | ||||
-rw-r--r-- | starmath/source/parse5.cxx | 26 | ||||
-rw-r--r-- | starmath/source/parsebase.cxx | 50 |
3 files changed, 51 insertions, 26 deletions
diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk index 77fd47d1bfed..ece71cc8d143 100644 --- a/starmath/Library_sm.mk +++ b/starmath/Library_sm.mk @@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_exception_objects,sm,\ starmath/source/ooxmlexport \ starmath/source/ooxmlimport \ starmath/source/rtfexport \ + starmath/source/parsebase \ starmath/source/parse5 \ starmath/source/rect \ starmath/source/scrwin \ diff --git a/starmath/source/parse5.cxx b/starmath/source/parse5.cxx index 09416c807b46..0f65252dd498 100644 --- a/starmath/source/parse5.cxx +++ b/starmath/source/parse5.cxx @@ -39,32 +39,6 @@ using namespace ::com::sun::star::i18n; -const char* starmathdatabase::SmParseErrorDesc[] = { - // clang-format off - RID_ERR_NONE, - RID_ERR_UNEXPECTEDCHARACTER, - RID_ERR_UNEXPECTEDTOKEN, - RID_ERR_POUNDEXPECTED, - RID_ERR_COLOREXPECTED, - RID_ERR_LGROUPEXPECTED, - RID_ERR_RGROUPEXPECTED, - RID_ERR_LBRACEEXPECTED, - RID_ERR_RBRACEEXPECTED, - RID_ERR_PARENTMISMATCH, - RID_ERR_RIGHTEXPECTED, - RID_ERR_FONTEXPECTED, - RID_ERR_SIZEEXPECTED, - RID_ERR_DOUBLEALIGN, - RID_ERR_DOUBLESUBSUPSCRIPT, - RID_ERR_NUMBEREXPECTED - // clang-format on -}; - -OUString starmathdatabase::getParseErrorDesc(SmParseError err) -{ - return SmResId(starmathdatabase::SmParseErrorDesc[static_cast<uint_fast8_t>(err)]); -} - //Definition of math keywords const SmTokenTableEntry aTokenTable[] = { { u"abs", TABS, '\0', TG::UnOper, 13 }, diff --git a/starmath/source/parsebase.cxx b/starmath/source/parsebase.cxx new file mode 100644 index 000000000000..2e6d92694db5 --- /dev/null +++ b/starmath/source/parsebase.cxx @@ -0,0 +1,50 @@ +/* -*- 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 . + */ + +#include <parsebase.hxx> +#include <strings.hrc> +#include <smmod.hxx> + +const char* starmathdatabase::SmParseErrorDesc[] = { + // clang-format off + RID_ERR_NONE, + RID_ERR_UNEXPECTEDCHARACTER, + RID_ERR_UNEXPECTEDTOKEN, + RID_ERR_POUNDEXPECTED, + RID_ERR_COLOREXPECTED, + RID_ERR_LGROUPEXPECTED, + RID_ERR_RGROUPEXPECTED, + RID_ERR_LBRACEEXPECTED, + RID_ERR_RBRACEEXPECTED, + RID_ERR_PARENTMISMATCH, + RID_ERR_RIGHTEXPECTED, + RID_ERR_FONTEXPECTED, + RID_ERR_SIZEEXPECTED, + RID_ERR_DOUBLEALIGN, + RID_ERR_DOUBLESUBSUPSCRIPT, + RID_ERR_NUMBEREXPECTED + // clang-format on +}; + +OUString starmathdatabase::getParseErrorDesc(SmParseError err) +{ + return SmResId(starmathdatabase::SmParseErrorDesc[static_cast<uint_fast8_t>(err)]); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |