[Libreoffice-commits] core.git: starmath/Library_sm.mk starmath/source
dante (via logerrit)
logerrit at kemper.freedesktop.org
Sat Feb 27 19:36:40 UTC 2021
starmath/Library_sm.mk | 1
starmath/source/parse5.cxx | 26 ---------------------
starmath/source/parsebase.cxx | 50 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 26 deletions(-)
New commits:
commit e9bae566f43dd6f26c2c4b7d84a449b7b01265dc
Author: dante <dante19031999 at gmail.com>
AuthorDate: Sat Feb 27 18:21:47 2021 +0100
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Feb 27 20:35:59 2021 +0100
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 at collabora.co.uk>
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: */
More information about the Libreoffice-commits
mailing list