parent
cf4e04a165
commit
f780bf929d
@ -1,45 +0,0 @@
|
|||||||
From 3f96d70ce7f31d556b995733b44cb8715b64e329 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thorsten Behrens <thorsten.behrens@allotropia.de>
|
|
||||||
Date: Mon, 31 Jan 2022 22:45:37 +0100
|
|
||||||
Subject: [PATCH 1/2] Avoid calling AVX code in library static initialization
|
|
||||||
|
|
||||||
Despite 26072b8db7ba53f00c83197cb064229a76001989 and
|
|
||||||
12c6b1ef6a824b09778163ec83fc44bb196e65db, Linux builds using
|
|
||||||
RH devtoolset-7 gcc7 still hit occasional unit test crashes
|
|
||||||
with illegal instructions.
|
|
||||||
|
|
||||||
Backtrace is always:
|
|
||||||
|
|
||||||
> #0 __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at core/sc/source/core/tool/arraysumAVX.cxx:20
|
|
||||||
> #1 _GLOBAL__sub_I_arraysumAVX.cxx(void) () at core/sc/source/core/tool/arraysumAVX.cxx:112
|
|
||||||
>
|
|
||||||
|
|
||||||
So lets make sure initializer is run only on function entry.
|
|
||||||
|
|
||||||
Change-Id: I69f5cb725e4d72fb346166b21870612473f974b8
|
|
||||||
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129246
|
|
||||||
Tested-by: Jenkins
|
|
||||||
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
|
|
||||||
(cherry picked from commit d140817428cdbb519efa496f578bf6c054c94361)
|
|
||||||
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129251
|
|
||||||
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
||||||
---
|
|
||||||
sc/source/core/tool/arraysumAVX.cxx | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/sc/source/core/tool/arraysumAVX.cxx b/sc/source/core/tool/arraysumAVX.cxx
|
|
||||||
index e256248047d0..4d9ee02285e7 100644
|
|
||||||
--- a/sc/source/core/tool/arraysumAVX.cxx
|
|
||||||
+++ b/sc/source/core/tool/arraysumAVX.cxx
|
|
||||||
@@ -30,7 +30,7 @@ using namespace AVX;
|
|
||||||
*/
|
|
||||||
static inline void sumAVX(__m256d& sum, __m256d& err, const __m256d& value)
|
|
||||||
{
|
|
||||||
- const __m256d ANNULATE_SIGN_BIT
|
|
||||||
+ static const __m256d ANNULATE_SIGN_BIT
|
|
||||||
= _mm256_castsi256_pd(_mm256_set1_epi64x(0x7FFF'FFFF'FFFF'FFFF));
|
|
||||||
// Temporal parameter
|
|
||||||
__m256d t = _mm256_add_pd(sum, value);
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
@ -1,469 +0,0 @@
|
|||||||
From 9ef5a52faecf9118ef46582911f537fd3b6efaad Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Thu, 3 Feb 2022 14:29:21 +0000
|
|
||||||
Subject: [PATCH] disable ICEing function under x86
|
|
||||||
|
|
||||||
Change-Id: I75afe56b248236f30a96876e2aed96f5dd887df1
|
|
||||||
---
|
|
||||||
sc/Library_sc.mk | 1 +
|
|
||||||
sc/source/core/tool/bahttext.cxx | 243 +++++++++++++++++++++++++++++++
|
|
||||||
sc/source/core/tool/interpr2.cxx | 181 -----------------------
|
|
||||||
3 files changed, 244 insertions(+), 181 deletions(-)
|
|
||||||
create mode 100644 sc/source/core/tool/bahttext.cxx
|
|
||||||
|
|
||||||
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
|
|
||||||
index 936ca33901ee..f31bbd3f5f8c 100644
|
|
||||||
--- a/sc/Library_sc.mk
|
|
||||||
+++ b/sc/Library_sc.mk
|
|
||||||
@@ -207,6 +207,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
|
|
||||||
sc/source/core/tool/adiasync \
|
|
||||||
sc/source/core/tool/appoptio \
|
|
||||||
sc/source/core/tool/autoform \
|
|
||||||
+ sc/source/core/tool/bahttext \
|
|
||||||
sc/source/core/tool/calcconfig \
|
|
||||||
sc/source/core/tool/callform \
|
|
||||||
sc/source/core/tool/cellform \
|
|
||||||
diff --git a/sc/source/core/tool/bahttext.cxx b/sc/source/core/tool/bahttext.cxx
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000000..307a92e39c7c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/sc/source/core/tool/bahttext.cxx
|
|
||||||
@@ -0,0 +1,243 @@
|
|
||||||
+/* -*- 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 <memory>
|
|
||||||
+#include <interpre.hxx>
|
|
||||||
+#include <osl/diagnose.h>
|
|
||||||
+#include <sc.hrc>
|
|
||||||
+#include <string.h>
|
|
||||||
+
|
|
||||||
+using ::std::vector;
|
|
||||||
+using namespace com::sun::star;
|
|
||||||
+using namespace formula;
|
|
||||||
+
|
|
||||||
+#if defined(X86)
|
|
||||||
+void ScInterpreter::ScBahtText() {}
|
|
||||||
+#else
|
|
||||||
+
|
|
||||||
+// BAHTTEXT
|
|
||||||
+#define UTF8_TH_0 "\340\270\250\340\270\271\340\270\231\340\270\242\340\271\214"
|
|
||||||
+#define UTF8_TH_1 "\340\270\253\340\270\231\340\270\266\340\271\210\340\270\207"
|
|
||||||
+#define UTF8_TH_2 "\340\270\252\340\270\255\340\270\207"
|
|
||||||
+#define UTF8_TH_3 "\340\270\252\340\270\262\340\270\241"
|
|
||||||
+#define UTF8_TH_4 "\340\270\252\340\270\265\340\271\210"
|
|
||||||
+#define UTF8_TH_5 "\340\270\253\340\271\211\340\270\262"
|
|
||||||
+#define UTF8_TH_6 "\340\270\253\340\270\201"
|
|
||||||
+#define UTF8_TH_7 "\340\271\200\340\270\210\340\271\207\340\270\224"
|
|
||||||
+#define UTF8_TH_8 "\340\271\201\340\270\233\340\270\224"
|
|
||||||
+#define UTF8_TH_9 "\340\271\200\340\270\201\340\271\211\340\270\262"
|
|
||||||
+#define UTF8_TH_10 "\340\270\252\340\270\264\340\270\232"
|
|
||||||
+#define UTF8_TH_11 "\340\271\200\340\270\255\340\271\207\340\270\224"
|
|
||||||
+#define UTF8_TH_20 "\340\270\242\340\270\265\340\271\210"
|
|
||||||
+#define UTF8_TH_1E2 "\340\270\243\340\271\211\340\270\255\340\270\242"
|
|
||||||
+#define UTF8_TH_1E3 "\340\270\236\340\270\261\340\270\231"
|
|
||||||
+#define UTF8_TH_1E4 "\340\270\253\340\270\241\340\270\267\340\271\210\340\270\231"
|
|
||||||
+#define UTF8_TH_1E5 "\340\271\201\340\270\252\340\270\231"
|
|
||||||
+#define UTF8_TH_1E6 "\340\270\245\340\271\211\340\270\262\340\270\231"
|
|
||||||
+#define UTF8_TH_DOT0 "\340\270\226\340\271\211\340\270\247\340\270\231"
|
|
||||||
+#define UTF8_TH_BAHT "\340\270\232\340\270\262\340\270\227"
|
|
||||||
+#define UTF8_TH_SATANG "\340\270\252\340\270\225\340\270\262\340\270\207\340\270\204\340\271\214"
|
|
||||||
+#define UTF8_TH_MINUS "\340\270\245\340\270\232"
|
|
||||||
+
|
|
||||||
+// local functions
|
|
||||||
+static void lclSplitBlock(double& rfInt, sal_Int32& rnBlock, double fValue, double fSize)
|
|
||||||
+{
|
|
||||||
+ rnBlock = static_cast<sal_Int32>(modf((fValue + 0.1) / fSize, &rfInt) * fSize + 0.1);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/** Appends a digit (0 to 9) to the passed string. */
|
|
||||||
+static void lclAppendDigit(OStringBuffer& rText, sal_Int32 nDigit)
|
|
||||||
+{
|
|
||||||
+ switch (nDigit)
|
|
||||||
+ {
|
|
||||||
+ case 0:
|
|
||||||
+ rText.append(UTF8_TH_0);
|
|
||||||
+ break;
|
|
||||||
+ case 1:
|
|
||||||
+ rText.append(UTF8_TH_1);
|
|
||||||
+ break;
|
|
||||||
+ case 2:
|
|
||||||
+ rText.append(UTF8_TH_2);
|
|
||||||
+ break;
|
|
||||||
+ case 3:
|
|
||||||
+ rText.append(UTF8_TH_3);
|
|
||||||
+ break;
|
|
||||||
+ case 4:
|
|
||||||
+ rText.append(UTF8_TH_4);
|
|
||||||
+ break;
|
|
||||||
+ case 5:
|
|
||||||
+ rText.append(UTF8_TH_5);
|
|
||||||
+ break;
|
|
||||||
+ case 6:
|
|
||||||
+ rText.append(UTF8_TH_6);
|
|
||||||
+ break;
|
|
||||||
+ case 7:
|
|
||||||
+ rText.append(UTF8_TH_7);
|
|
||||||
+ break;
|
|
||||||
+ case 8:
|
|
||||||
+ rText.append(UTF8_TH_8);
|
|
||||||
+ break;
|
|
||||||
+ case 9:
|
|
||||||
+ rText.append(UTF8_TH_9);
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ OSL_FAIL("lclAppendDigit - illegal digit");
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/** Appends a value raised to a power of 10: nDigit*10^nPow10.
|
|
||||||
+ @param nDigit A digit in the range from 1 to 9.
|
|
||||||
+ @param nPow10 A value in the range from 2 to 5.
|
|
||||||
+ */
|
|
||||||
+static void lclAppendPow10(OStringBuffer& rText, sal_Int32 nDigit, sal_Int32 nPow10)
|
|
||||||
+{
|
|
||||||
+ OSL_ENSURE((1 <= nDigit) && (nDigit <= 9), "lclAppendPow10 - illegal digit");
|
|
||||||
+ lclAppendDigit(rText, nDigit);
|
|
||||||
+ switch (nPow10)
|
|
||||||
+ {
|
|
||||||
+ case 2:
|
|
||||||
+ rText.append(UTF8_TH_1E2);
|
|
||||||
+ break;
|
|
||||||
+ case 3:
|
|
||||||
+ rText.append(UTF8_TH_1E3);
|
|
||||||
+ break;
|
|
||||||
+ case 4:
|
|
||||||
+ rText.append(UTF8_TH_1E4);
|
|
||||||
+ break;
|
|
||||||
+ case 5:
|
|
||||||
+ rText.append(UTF8_TH_1E5);
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ OSL_FAIL("lclAppendPow10 - illegal power");
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/** Appends a block of 6 digits (value from 1 to 999,999) to the passed string. */
|
|
||||||
+static void lclAppendBlock(OStringBuffer& rText, sal_Int32 nValue)
|
|
||||||
+{
|
|
||||||
+ OSL_ENSURE((1 <= nValue) && (nValue <= 999999), "lclAppendBlock - illegal value");
|
|
||||||
+ if (nValue >= 100000)
|
|
||||||
+ {
|
|
||||||
+ lclAppendPow10(rText, nValue / 100000, 5);
|
|
||||||
+ nValue %= 100000;
|
|
||||||
+ }
|
|
||||||
+ if (nValue >= 10000)
|
|
||||||
+ {
|
|
||||||
+ lclAppendPow10(rText, nValue / 10000, 4);
|
|
||||||
+ nValue %= 10000;
|
|
||||||
+ }
|
|
||||||
+ if (nValue >= 1000)
|
|
||||||
+ {
|
|
||||||
+ lclAppendPow10(rText, nValue / 1000, 3);
|
|
||||||
+ nValue %= 1000;
|
|
||||||
+ }
|
|
||||||
+ if (nValue >= 100)
|
|
||||||
+ {
|
|
||||||
+ lclAppendPow10(rText, nValue / 100, 2);
|
|
||||||
+ nValue %= 100;
|
|
||||||
+ }
|
|
||||||
+ if (nValue <= 0)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ sal_Int32 nTen = nValue / 10;
|
|
||||||
+ sal_Int32 nOne = nValue % 10;
|
|
||||||
+ if (nTen >= 1)
|
|
||||||
+ {
|
|
||||||
+ if (nTen >= 3)
|
|
||||||
+ lclAppendDigit(rText, nTen);
|
|
||||||
+ else if (nTen == 2)
|
|
||||||
+ rText.append(UTF8_TH_20);
|
|
||||||
+ rText.append(UTF8_TH_10);
|
|
||||||
+ }
|
|
||||||
+ if ((nTen > 0) && (nOne == 1))
|
|
||||||
+ rText.append(UTF8_TH_11);
|
|
||||||
+ else if (nOne > 0)
|
|
||||||
+ lclAppendDigit(rText, nOne);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void ScInterpreter::ScBahtText()
|
|
||||||
+{
|
|
||||||
+ sal_uInt8 nParamCount = GetByte();
|
|
||||||
+ if (!MustHaveParamCount(nParamCount, 1))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ double fValue = GetDouble();
|
|
||||||
+ if (nGlobalError != FormulaError::NONE)
|
|
||||||
+ {
|
|
||||||
+ PushError(nGlobalError);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // sign
|
|
||||||
+ bool bMinus = fValue < 0.0;
|
|
||||||
+ fValue = std::abs(fValue);
|
|
||||||
+
|
|
||||||
+ // round to 2 digits after decimal point, fValue contains Satang as integer
|
|
||||||
+ fValue = ::rtl::math::approxFloor(fValue * 100.0 + 0.5);
|
|
||||||
+
|
|
||||||
+ // split Baht and Satang
|
|
||||||
+ double fBaht = 0.0;
|
|
||||||
+ sal_Int32 nSatang = 0;
|
|
||||||
+ lclSplitBlock(fBaht, nSatang, fValue, 100.0);
|
|
||||||
+
|
|
||||||
+ OStringBuffer aText;
|
|
||||||
+
|
|
||||||
+ // generate text for Baht value
|
|
||||||
+ if (fBaht == 0.0)
|
|
||||||
+ {
|
|
||||||
+ if (nSatang == 0)
|
|
||||||
+ aText.append(UTF8_TH_0);
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ while (fBaht > 0.0)
|
|
||||||
+ {
|
|
||||||
+ OStringBuffer aBlock;
|
|
||||||
+ sal_Int32 nBlock = 0;
|
|
||||||
+ lclSplitBlock(fBaht, nBlock, fBaht, 1.0e6);
|
|
||||||
+ if (nBlock > 0)
|
|
||||||
+ lclAppendBlock(aBlock, nBlock);
|
|
||||||
+ // add leading "million", if there will come more blocks
|
|
||||||
+ if (fBaht > 0.0)
|
|
||||||
+ aBlock.insert(0, UTF8_TH_1E6);
|
|
||||||
+
|
|
||||||
+ aText.insert(0, aBlock.makeStringAndClear());
|
|
||||||
+ }
|
|
||||||
+ if (!aText.isEmpty())
|
|
||||||
+ aText.append(UTF8_TH_BAHT);
|
|
||||||
+
|
|
||||||
+ // generate text for Satang value
|
|
||||||
+ if (nSatang == 0)
|
|
||||||
+ {
|
|
||||||
+ aText.append(UTF8_TH_DOT0);
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ lclAppendBlock(aText, nSatang);
|
|
||||||
+ aText.append(UTF8_TH_SATANG);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // add the minus sign
|
|
||||||
+ if (bMinus)
|
|
||||||
+ aText.insert(0, UTF8_TH_MINUS);
|
|
||||||
+
|
|
||||||
+ PushString(OStringToOUString(aText.makeStringAndClear(), RTL_TEXTENCODING_UTF8));
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
||||||
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
|
|
||||||
index 6525f2a6784b..96f47f2e27ad 100644
|
|
||||||
--- a/sc/source/core/tool/interpr2.cxx
|
|
||||||
+++ b/sc/source/core/tool/interpr2.cxx
|
|
||||||
@@ -3307,187 +3307,6 @@ void ScInterpreter::ScEuroConvert()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-// BAHTTEXT
|
|
||||||
-#define UTF8_TH_0 "\340\270\250\340\270\271\340\270\231\340\270\242\340\271\214"
|
|
||||||
-#define UTF8_TH_1 "\340\270\253\340\270\231\340\270\266\340\271\210\340\270\207"
|
|
||||||
-#define UTF8_TH_2 "\340\270\252\340\270\255\340\270\207"
|
|
||||||
-#define UTF8_TH_3 "\340\270\252\340\270\262\340\270\241"
|
|
||||||
-#define UTF8_TH_4 "\340\270\252\340\270\265\340\271\210"
|
|
||||||
-#define UTF8_TH_5 "\340\270\253\340\271\211\340\270\262"
|
|
||||||
-#define UTF8_TH_6 "\340\270\253\340\270\201"
|
|
||||||
-#define UTF8_TH_7 "\340\271\200\340\270\210\340\271\207\340\270\224"
|
|
||||||
-#define UTF8_TH_8 "\340\271\201\340\270\233\340\270\224"
|
|
||||||
-#define UTF8_TH_9 "\340\271\200\340\270\201\340\271\211\340\270\262"
|
|
||||||
-#define UTF8_TH_10 "\340\270\252\340\270\264\340\270\232"
|
|
||||||
-#define UTF8_TH_11 "\340\271\200\340\270\255\340\271\207\340\270\224"
|
|
||||||
-#define UTF8_TH_20 "\340\270\242\340\270\265\340\271\210"
|
|
||||||
-#define UTF8_TH_1E2 "\340\270\243\340\271\211\340\270\255\340\270\242"
|
|
||||||
-#define UTF8_TH_1E3 "\340\270\236\340\270\261\340\270\231"
|
|
||||||
-#define UTF8_TH_1E4 "\340\270\253\340\270\241\340\270\267\340\271\210\340\270\231"
|
|
||||||
-#define UTF8_TH_1E5 "\340\271\201\340\270\252\340\270\231"
|
|
||||||
-#define UTF8_TH_1E6 "\340\270\245\340\271\211\340\270\262\340\270\231"
|
|
||||||
-#define UTF8_TH_DOT0 "\340\270\226\340\271\211\340\270\247\340\270\231"
|
|
||||||
-#define UTF8_TH_BAHT "\340\270\232\340\270\262\340\270\227"
|
|
||||||
-#define UTF8_TH_SATANG "\340\270\252\340\270\225\340\270\262\340\270\207\340\270\204\340\271\214"
|
|
||||||
-#define UTF8_TH_MINUS "\340\270\245\340\270\232"
|
|
||||||
-
|
|
||||||
-// local functions
|
|
||||||
-namespace {
|
|
||||||
-
|
|
||||||
-void lclSplitBlock( double& rfInt, sal_Int32& rnBlock, double fValue, double fSize )
|
|
||||||
-{
|
|
||||||
- rnBlock = static_cast< sal_Int32 >( modf( (fValue + 0.1) / fSize, &rfInt ) * fSize + 0.1 );
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/** Appends a digit (0 to 9) to the passed string. */
|
|
||||||
-void lclAppendDigit( OStringBuffer& rText, sal_Int32 nDigit )
|
|
||||||
-{
|
|
||||||
- switch( nDigit )
|
|
||||||
- {
|
|
||||||
- case 0: rText.append( UTF8_TH_0 ); break;
|
|
||||||
- case 1: rText.append( UTF8_TH_1 ); break;
|
|
||||||
- case 2: rText.append( UTF8_TH_2 ); break;
|
|
||||||
- case 3: rText.append( UTF8_TH_3 ); break;
|
|
||||||
- case 4: rText.append( UTF8_TH_4 ); break;
|
|
||||||
- case 5: rText.append( UTF8_TH_5 ); break;
|
|
||||||
- case 6: rText.append( UTF8_TH_6 ); break;
|
|
||||||
- case 7: rText.append( UTF8_TH_7 ); break;
|
|
||||||
- case 8: rText.append( UTF8_TH_8 ); break;
|
|
||||||
- case 9: rText.append( UTF8_TH_9 ); break;
|
|
||||||
- default: OSL_FAIL( "lclAppendDigit - illegal digit" );
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/** Appends a value raised to a power of 10: nDigit*10^nPow10.
|
|
||||||
- @param nDigit A digit in the range from 1 to 9.
|
|
||||||
- @param nPow10 A value in the range from 2 to 5.
|
|
||||||
- */
|
|
||||||
-void lclAppendPow10( OStringBuffer& rText, sal_Int32 nDigit, sal_Int32 nPow10 )
|
|
||||||
-{
|
|
||||||
- OSL_ENSURE( (1 <= nDigit) && (nDigit <= 9), "lclAppendPow10 - illegal digit" );
|
|
||||||
- lclAppendDigit( rText, nDigit );
|
|
||||||
- switch( nPow10 )
|
|
||||||
- {
|
|
||||||
- case 2: rText.append( UTF8_TH_1E2 ); break;
|
|
||||||
- case 3: rText.append( UTF8_TH_1E3 ); break;
|
|
||||||
- case 4: rText.append( UTF8_TH_1E4 ); break;
|
|
||||||
- case 5: rText.append( UTF8_TH_1E5 ); break;
|
|
||||||
- default: OSL_FAIL( "lclAppendPow10 - illegal power" );
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/** Appends a block of 6 digits (value from 1 to 999,999) to the passed string. */
|
|
||||||
-void lclAppendBlock( OStringBuffer& rText, sal_Int32 nValue )
|
|
||||||
-{
|
|
||||||
- OSL_ENSURE( (1 <= nValue) && (nValue <= 999999), "lclAppendBlock - illegal value" );
|
|
||||||
- if( nValue >= 100000 )
|
|
||||||
- {
|
|
||||||
- lclAppendPow10( rText, nValue / 100000, 5 );
|
|
||||||
- nValue %= 100000;
|
|
||||||
- }
|
|
||||||
- if( nValue >= 10000 )
|
|
||||||
- {
|
|
||||||
- lclAppendPow10( rText, nValue / 10000, 4 );
|
|
||||||
- nValue %= 10000;
|
|
||||||
- }
|
|
||||||
- if( nValue >= 1000 )
|
|
||||||
- {
|
|
||||||
- lclAppendPow10( rText, nValue / 1000, 3 );
|
|
||||||
- nValue %= 1000;
|
|
||||||
- }
|
|
||||||
- if( nValue >= 100 )
|
|
||||||
- {
|
|
||||||
- lclAppendPow10( rText, nValue / 100, 2 );
|
|
||||||
- nValue %= 100;
|
|
||||||
- }
|
|
||||||
- if( nValue <= 0 )
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- sal_Int32 nTen = nValue / 10;
|
|
||||||
- sal_Int32 nOne = nValue % 10;
|
|
||||||
- if( nTen >= 1 )
|
|
||||||
- {
|
|
||||||
- if( nTen >= 3 )
|
|
||||||
- lclAppendDigit( rText, nTen );
|
|
||||||
- else if( nTen == 2 )
|
|
||||||
- rText.append( UTF8_TH_20 );
|
|
||||||
- rText.append( UTF8_TH_10 );
|
|
||||||
- }
|
|
||||||
- if( (nTen > 0) && (nOne == 1) )
|
|
||||||
- rText.append( UTF8_TH_11 );
|
|
||||||
- else if( nOne > 0 )
|
|
||||||
- lclAppendDigit( rText, nOne );
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-} // namespace
|
|
||||||
-
|
|
||||||
-void ScInterpreter::ScBahtText()
|
|
||||||
-{
|
|
||||||
- sal_uInt8 nParamCount = GetByte();
|
|
||||||
- if ( !MustHaveParamCount( nParamCount, 1 ) )
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- double fValue = GetDouble();
|
|
||||||
- if( nGlobalError != FormulaError::NONE )
|
|
||||||
- {
|
|
||||||
- PushError( nGlobalError);
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // sign
|
|
||||||
- bool bMinus = fValue < 0.0;
|
|
||||||
- fValue = std::abs( fValue );
|
|
||||||
-
|
|
||||||
- // round to 2 digits after decimal point, fValue contains Satang as integer
|
|
||||||
- fValue = ::rtl::math::approxFloor( fValue * 100.0 + 0.5 );
|
|
||||||
-
|
|
||||||
- // split Baht and Satang
|
|
||||||
- double fBaht = 0.0;
|
|
||||||
- sal_Int32 nSatang = 0;
|
|
||||||
- lclSplitBlock( fBaht, nSatang, fValue, 100.0 );
|
|
||||||
-
|
|
||||||
- OStringBuffer aText;
|
|
||||||
-
|
|
||||||
- // generate text for Baht value
|
|
||||||
- if( fBaht == 0.0 )
|
|
||||||
- {
|
|
||||||
- if( nSatang == 0 )
|
|
||||||
- aText.append( UTF8_TH_0 );
|
|
||||||
- }
|
|
||||||
- else while( fBaht > 0.0 )
|
|
||||||
- {
|
|
||||||
- OStringBuffer aBlock;
|
|
||||||
- sal_Int32 nBlock = 0;
|
|
||||||
- lclSplitBlock( fBaht, nBlock, fBaht, 1.0e6 );
|
|
||||||
- if( nBlock > 0 )
|
|
||||||
- lclAppendBlock( aBlock, nBlock );
|
|
||||||
- // add leading "million", if there will come more blocks
|
|
||||||
- if( fBaht > 0.0 )
|
|
||||||
- aBlock.insert( 0, UTF8_TH_1E6 );
|
|
||||||
-
|
|
||||||
- aText.insert(0, aBlock.makeStringAndClear());
|
|
||||||
- }
|
|
||||||
- if (!aText.isEmpty())
|
|
||||||
- aText.append( UTF8_TH_BAHT );
|
|
||||||
-
|
|
||||||
- // generate text for Satang value
|
|
||||||
- if( nSatang == 0 )
|
|
||||||
- {
|
|
||||||
- aText.append( UTF8_TH_DOT0 );
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- lclAppendBlock( aText, nSatang );
|
|
||||||
- aText.append( UTF8_TH_SATANG );
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // add the minus sign
|
|
||||||
- if( bMinus )
|
|
||||||
- aText.insert( 0, UTF8_TH_MINUS );
|
|
||||||
-
|
|
||||||
- PushString( OStringToOUString(aText.makeStringAndClear(), RTL_TEXTENCODING_UTF8) );
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void ScInterpreter::ScGetPivotData()
|
|
||||||
{
|
|
||||||
sal_uInt8 nParamCount = GetByte();
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
|||||||
From dad09df8cf2fd44105c7224203d76d0273ed04d9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Tue, 8 Feb 2022 08:37:34 +0000
|
|
||||||
Subject: [PATCH] drop checksum assert that is platform dependant
|
|
||||||
|
|
||||||
Change-Id: I3459d753a8f655ca34ecf6c25fdfd9655687c6d1
|
|
||||||
---
|
|
||||||
emfio/qa/cppunit/emf/EmfImportTest.cxx | 11 -----------
|
|
||||||
1 file changed, 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
|
|
||||||
index 0f0bd76d199d..c9c2bcb94219 100644
|
|
||||||
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
|
|
||||||
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
|
|
||||||
@@ -853,10 +853,6 @@ void Test::TestBitBltStretchBltWMF()
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "xy23", "406");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "height", "10");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "width", "10");
|
|
||||||
-#if !defined(MACOSX) \
|
|
||||||
- && !defined(_WIN32) // TODO Bitmap display needs to be aligned for macOS and Windows
|
|
||||||
- assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]", "checksum", "747141214295528493");
|
|
||||||
-#endif
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data", 10);
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[1]/data[1]", "row",
|
|
||||||
"000000,000000,000000,000000,000000,000000,000000,000000,000000,000000");
|
|
||||||
@@ -874,10 +870,6 @@ void Test::TestBitBltStretchBltWMF()
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "height", "10");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "width", "10");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data", 10);
|
|
||||||
-#if !defined(MACOSX) \
|
|
||||||
- && !defined(_WIN32) // TODO Bitmap display needs to be aligned for macOS and Windows
|
|
||||||
- assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]", "checksum", "3134789313661517563");
|
|
||||||
-#endif
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[1]", "row",
|
|
||||||
"000000,00001c,000038,000055,000071,00008d,0000aa,0000c6,0000e2,0000ff");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap[2]/data[5]", "row",
|
|
||||||
@@ -1052,9 +1044,6 @@ void Test::TestStretchDIBWMF()
|
|
||||||
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "height", "10");
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "width", "10");
|
|
||||||
-#if !defined(MACOSX) // TODO DIB display needs to be aligned for macOS
|
|
||||||
- assertXPath(pDocument, aXPathPrefix + "mask/bitmap", "checksum", "14148300367030905133");
|
|
||||||
-#endif
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "mask/bitmap/data", 10);
|
|
||||||
assertXPath(pDocument, aXPathPrefix + "/mask/bitmap/data[1]", "row",
|
|
||||||
"000000,00001c,000038,000055,000071,00008d,0000aa,0000c6,0000e2,0000ff");
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
|||||||
From 099a72eb674ca25e348747229a188da5d00a58e1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Mon, 7 Feb 2022 12:17:03 +0000
|
|
||||||
Subject: [PATCH] fix big-endian hsql to firebird migration
|
|
||||||
|
|
||||||
Change-Id: I047d2366ad80eca701924cb0f66b6b1bcfdcac5b
|
|
||||||
---
|
|
||||||
connectivity/source/drivers/firebird/PreparedStatement.cxx | 6 ++++--
|
|
||||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
|
|
||||||
index 9225c3b26895..39fef04a185c 100644
|
|
||||||
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
|
|
||||||
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
|
|
||||||
@@ -207,7 +207,8 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
|
|
||||||
{
|
|
||||||
str = str.copy(0, max_varchar_len);
|
|
||||||
}
|
|
||||||
- const auto nLength = str.getLength();
|
|
||||||
+ const sal_uInt16 nLength = str.getLength();
|
|
||||||
+ static_assert(sizeof(nLength) == 2, "must match dest memcpy len");
|
|
||||||
memcpy(pVar->sqldata, &nLength, 2);
|
|
||||||
// Actual data
|
|
||||||
memcpy(pVar->sqldata + 2, str.getStr(), str.getLength());
|
|
||||||
@@ -908,7 +909,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
|
|
||||||
{
|
|
||||||
xBytesCopy.realloc( nMaxSize );
|
|
||||||
}
|
|
||||||
- const auto nSize = xBytesCopy.getLength();
|
|
||||||
+ const sal_uInt16 nSize = xBytesCopy.getLength();
|
|
||||||
// 8000 corresponds to value from lcl_addDefaultParameters
|
|
||||||
// in dbaccess/source/filter/hsqldb/createparser.cxx
|
|
||||||
if (nSize > 8000)
|
|
||||||
@@ -916,6 +917,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
|
|
||||||
free(pVar->sqldata);
|
|
||||||
pVar->sqldata = static_cast<char *>(malloc(sizeof(char) * nSize + 2));
|
|
||||||
}
|
|
||||||
+ static_assert(sizeof(nSize) == 2, "must match dest memcpy len");
|
|
||||||
// First 2 bytes indicate string size
|
|
||||||
memcpy(pVar->sqldata, &nSize, 2);
|
|
||||||
// Actual data
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
@ -1,401 +0,0 @@
|
|||||||
From e60f4c7cc51bb58b4e42bb47b37209fa0e6b3400 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Fri, 4 Feb 2022 15:02:17 +0000
|
|
||||||
Subject: [PATCH] fix direct leaks in vcl cppunit tests
|
|
||||||
|
|
||||||
the uses of new are wholly unnecessary
|
|
||||||
|
|
||||||
Change-Id: Id7238be6e73567add8a0d3ed6dc9f3262e15c043
|
|
||||||
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129435
|
|
||||||
Tested-by: Jenkins
|
|
||||||
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
||||||
---
|
|
||||||
vcl/qa/cppunit/text.cxx | 276 ++++++++++++++++++++--------------------
|
|
||||||
1 file changed, 138 insertions(+), 138 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
|
|
||||||
index eef1478286d5..072a0d0a1f98 100644
|
|
||||||
--- a/vcl/qa/cppunit/text.cxx
|
|
||||||
+++ b/vcl/qa/cppunit/text.cxx
|
|
||||||
@@ -425,67 +425,67 @@ void VclTextTest::testImplLayoutRuns_AddPos()
|
|
||||||
aRuns.AddPos(6, true); // add RTL marker glyph
|
|
||||||
aRuns.AddPos(7, false);
|
|
||||||
|
|
||||||
- int* pCharPos = new int(0);
|
|
||||||
- bool* pRightToLeftMarker = new bool(false);
|
|
||||||
+ int nCharPos(0);
|
|
||||||
+ bool bRightToLeftMarker(false);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(1, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(1, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(2, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(2, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(3, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(3, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(4, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(4, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(5, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(5, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(6, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(6, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(7, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(7, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
// no next position, we are running off the end
|
|
||||||
- CPPUNIT_ASSERT(!aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT(!aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
|
|
||||||
aRuns.ResetPos();
|
|
||||||
|
|
||||||
int nMinRunPos, nEndRunPos;
|
|
||||||
- bool* pRightToLeft = new bool(false);
|
|
||||||
+ bool bRightToLeft(false);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(1, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(4, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(4, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(5, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(5, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(6, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(6, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(7, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeft);
|
|
||||||
|
|
||||||
// test clear
|
|
||||||
aRuns.Clear();
|
|
||||||
@@ -500,63 +500,63 @@ void VclTextTest::testImplLayoutRuns_AddRuns()
|
|
||||||
aRuns.AddRun(5, 6, false);
|
|
||||||
aRuns.AddRun(6, 7, true);
|
|
||||||
|
|
||||||
- int* pCharPos = new int(0);
|
|
||||||
- bool* pRightToLeftMarker = new bool(false);
|
|
||||||
+ int nCharPos(0);
|
|
||||||
+ bool bRightToLeftMarker(false);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(1, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(1, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(2, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(2, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(3, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(3, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(4, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(4, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(5, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(5, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeftMarker);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(6, *pCharPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeftMarker);
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(6, nCharPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeftMarker);
|
|
||||||
|
|
||||||
// no next position, we are running off the end
|
|
||||||
- CPPUNIT_ASSERT(!aRuns.GetNextPos(pCharPos, pRightToLeftMarker));
|
|
||||||
+ CPPUNIT_ASSERT(!aRuns.GetNextPos(&nCharPos, &bRightToLeftMarker));
|
|
||||||
|
|
||||||
aRuns.ResetPos();
|
|
||||||
|
|
||||||
int nMinRunPos, nEndRunPos;
|
|
||||||
- bool* pRightToLeft = new bool(false);
|
|
||||||
+ bool bRightToLeft(false);
|
|
||||||
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(1, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(4, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(4, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(5, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(5, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(6, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(!bRightToLeft);
|
|
||||||
|
|
||||||
aRuns.NextRun();
|
|
||||||
- CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, pRightToLeft));
|
|
||||||
+ CPPUNIT_ASSERT(aRuns.GetRun(&nMinRunPos, &nEndRunPos, &bRightToLeft));
|
|
||||||
CPPUNIT_ASSERT_EQUAL(6, nMinRunPos);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(7, nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRightToLeft);
|
|
||||||
+ CPPUNIT_ASSERT(bRightToLeft);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VclTextTest::testImplLayoutRuns_PosIsInRun()
|
|
||||||
@@ -603,23 +603,23 @@ void VclTextTest::testImplLayoutArgsBiDiStrong()
|
|
||||||
SalLayoutFlags::BiDiStrong, LanguageTag(LANGUAGE_NONE),
|
|
||||||
nullptr);
|
|
||||||
|
|
||||||
- int* nMinRunPos = new int(0);
|
|
||||||
- int* nEndRunPos = new int(0);
|
|
||||||
- bool* pRTL = new bool(false);
|
|
||||||
+ int nMinRunPos(0);
|
|
||||||
+ int nEndRunPos(0);
|
|
||||||
+ bool bRTL(false);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(0, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(19, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(0, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(19, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(20, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(51, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(20, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(51, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(20, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(51, *nEndRunPos);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(20, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(51, nEndRunPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VclTextTest::testImplLayoutArgsBiDiRtl()
|
|
||||||
@@ -629,29 +629,29 @@ void VclTextTest::testImplLayoutArgsBiDiRtl()
|
|
||||||
vcl::text::ImplLayoutArgs aArgs(sTestString, 0, sTestString.getLength(),
|
|
||||||
SalLayoutFlags::BiDiRtl, LanguageTag(LANGUAGE_NONE), nullptr);
|
|
||||||
|
|
||||||
- int* nMinRunPos = new int(0);
|
|
||||||
- int* nEndRunPos = new int(0);
|
|
||||||
- bool* pRTL = new bool(false);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(45, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(51, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(21, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(45, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(20, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(21, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(0, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(19, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ int nMinRunPos(0);
|
|
||||||
+ int nEndRunPos(0);
|
|
||||||
+ bool bRTL(false);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(45, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(51, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(&bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(21, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(45, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(20, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(21, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(0, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(19, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VclTextTest::testImplLayoutArgsRightAlign()
|
|
||||||
@@ -662,24 +662,24 @@ void VclTextTest::testImplLayoutArgsRightAlign()
|
|
||||||
SalLayoutFlags::RightAlign, LanguageTag(LANGUAGE_NONE),
|
|
||||||
nullptr);
|
|
||||||
|
|
||||||
- int* nMinRunPos = new int(0);
|
|
||||||
- int* nEndRunPos = new int(0);
|
|
||||||
- bool* pRTL = new bool(false);
|
|
||||||
+ int nMinRunPos(0);
|
|
||||||
+ int nEndRunPos(0);
|
|
||||||
+ bool bRTL(false);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(0, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(19, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(0, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(19, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(20, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(45, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(20, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(45, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(45, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(51, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(*pRTL);
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(45, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(51, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(bRTL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VclTextTest::testImplLayoutArgs_PrepareFallback_precalculatedglyphs()
|
|
||||||
@@ -702,29 +702,29 @@ void VclTextTest::testImplLayoutArgs_PrepareFallback_precalculatedglyphs()
|
|
||||||
|
|
||||||
aArgs.PrepareFallback(pGlyphsImpl);
|
|
||||||
|
|
||||||
- int* nMinRunPos = new int(0);
|
|
||||||
- int* nEndRunPos = new int(0);
|
|
||||||
- bool* pRTL = new bool(false);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(0, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(3, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(4, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(9, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(11, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(17, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
-
|
|
||||||
- aArgs.GetNextRun(nMinRunPos, nEndRunPos, pRTL);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(18, *nMinRunPos);
|
|
||||||
- CPPUNIT_ASSERT_EQUAL(22, *nEndRunPos);
|
|
||||||
- CPPUNIT_ASSERT(!*pRTL);
|
|
||||||
+ int nMinRunPos(0);
|
|
||||||
+ int nEndRunPos(0);
|
|
||||||
+ bool bRTL(false);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(0, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(3, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(4, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(9, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(11, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(17, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
+
|
|
||||||
+ aArgs.GetNextRun(&nMinRunPos, &nEndRunPos, &bRTL);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(18, nMinRunPos);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(22, nEndRunPos);
|
|
||||||
+ CPPUNIT_ASSERT(!bRTL);
|
|
||||||
}
|
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(VclTextTest);
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
|||||||
From ccc57428482903923e6df745ea62f5cad8c64bbf Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Thu, 3 Feb 2022 16:05:48 +0000
|
|
||||||
Subject: [PATCH] the real font used for 'Roman' is arbitrary
|
|
||||||
|
|
||||||
the font name isn't a typical semi-standard one so it neither exists nor
|
|
||||||
has a standard fallback. binary-hack "Roman" to "Arial" which is
|
|
||||||
conveniently the same length and does have a standard fallback of
|
|
||||||
"Liberation Sans" which we can add a dependency on via more_fonts
|
|
||||||
|
|
||||||
Change-Id: I1d9b8294f67a00a1e5cabe38b71467e66b83aedf
|
|
||||||
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129473
|
|
||||||
Tested-by: Jenkins
|
|
||||||
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
|
|
||||||
---
|
|
||||||
emfio/CppunitTest_emfio_emf.mk | 2 ++
|
|
||||||
emfio/CppunitTest_emfio_wmf.mk | 1 +
|
|
||||||
.../wmf/data/tdf88163-non-placeable.wmf | Bin 1268 -> 1268 bytes
|
|
||||||
.../wmf/data/tdf88163-wrong-font-size.wmf | Bin 1290 -> 1290 bytes
|
|
||||||
emfio/qa/cppunit/wmf/wmfimporttest.cxx | 13 +++----------
|
|
||||||
5 files changed, 6 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/emfio/CppunitTest_emfio_emf.mk b/emfio/CppunitTest_emfio_emf.mk
|
|
||||||
index 5b32187b7ea8..1714755a4fb1 100644
|
|
||||||
--- a/emfio/CppunitTest_emfio_emf.mk
|
|
||||||
+++ b/emfio/CppunitTest_emfio_emf.mk
|
|
||||||
@@ -40,6 +40,8 @@ $(eval $(call gb_CppunitTest_use_vcl,emfio_emf))
|
|
||||||
|
|
||||||
$(eval $(call gb_CppunitTest_use_rdb,emfio_emf,services))
|
|
||||||
|
|
||||||
+$(eval $(call gb_CppunitTest_use_more_fonts,emfio_emf))
|
|
||||||
+
|
|
||||||
$(eval $(call gb_CppunitTest_use_configuration,emfio_emf))
|
|
||||||
|
|
||||||
# vim: set noet sw=4 ts=4:
|
|
||||||
diff --git a/emfio/CppunitTest_emfio_wmf.mk b/emfio/CppunitTest_emfio_wmf.mk
|
|
||||||
index ec67bff3a9b4..44f0a1b273b7 100644
|
|
||||||
--- a/emfio/CppunitTest_emfio_wmf.mk
|
|
||||||
+++ b/emfio/CppunitTest_emfio_wmf.mk
|
|
||||||
@@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_components,emfio_wmf,\
|
|
||||||
unotools/util/utl \
|
|
||||||
))
|
|
||||||
|
|
||||||
+$(eval $(call gb_CppunitTest_use_more_fonts,emfio_wmf))
|
|
||||||
$(eval $(call gb_CppunitTest_use_configuration,emfio_wmf))
|
|
||||||
$(eval $(call gb_CppunitTest_use_sdk_api,emfio_wmf))
|
|
||||||
$(eval $(call gb_CppunitTest_use_ure,emfio_wmf))
|
|
||||||
diff --git a/emfio/qa/cppunit/wmf/data/tdf88163-non-placeable.wmf b/emfio/qa/cppunit/wmf/data/tdf88163-non-placeable.wmf
|
|
||||||
index b39514bd1b5cefc721175680ddca05cfe2341c15..6d27691f0d2d9dbf9936996b077f1ec64e255d83 100644
|
|
||||||
GIT binary patch
|
|
||||||
delta 16
|
|
||||||
Xcmeyu`Gs?W7OP`XW@64p{i7@ZI9&!z
|
|
||||||
|
|
||||||
delta 16
|
|
||||||
Xcmeyu`Gs?W7Hd#`Zerd>{i7@ZIRpk^
|
|
||||||
|
|
||||||
diff --git a/emfio/qa/cppunit/wmf/data/tdf88163-wrong-font-size.wmf b/emfio/qa/cppunit/wmf/data/tdf88163-wrong-font-size.wmf
|
|
||||||
index edcab8aea63552e27ee3b75a0bf7bff74b3966f5..4902ba18d16bb567cb58c93c7a4167311cf05b19 100644
|
|
||||||
GIT binary patch
|
|
||||||
delta 16
|
|
||||||
XcmeC;>f)N<!0K3(nV7TD^(YGfEkOmQ
|
|
||||||
|
|
||||||
delta 16
|
|
||||||
XcmeC;>f)N<z#5dFo0zxJ^(YGfE$9Wh
|
|
||||||
|
|
||||||
diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
|
|
||||||
index b7a4dc1badb7..d6533d8ba07c 100644
|
|
||||||
--- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx
|
|
||||||
+++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx
|
|
||||||
@@ -117,14 +117,10 @@ void WmfTest::testTdf88163NonPlaceableWmf()
|
|
||||||
|
|
||||||
// These values come from the fix for tdf#88163
|
|
||||||
|
|
||||||
- // Font 'Roman' and its height can vary according to the platform
|
|
||||||
// Fails without the fix
|
|
||||||
- // Linux: With fix: 3136, without fix: ~ 8000
|
|
||||||
- // Mac: With fix: 3230, without fix: ~ 8000
|
|
||||||
- // Windows: With fix: 3303, without fix: ~ 8000
|
|
||||||
+ // With fix: 3272, without fix: ~ 8000
|
|
||||||
auto x = getXPath(pDoc, "/metafile/push[2]/font[1]", "height");
|
|
||||||
- CPPUNIT_ASSERT_MESSAGE(fileName.toUtf8().getStr(), x.toInt32() > 3000);
|
|
||||||
- CPPUNIT_ASSERT_MESSAGE(fileName.toUtf8().getStr(), x.toInt32() < 3500);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3272), x.toInt32());
|
|
||||||
|
|
||||||
// Fails without the fix: Expected: 7359, Actual: 7336
|
|
||||||
assertXPath(pDoc, "/metafile/push[2]/textarray[1]", "x", "7359");
|
|
||||||
@@ -157,12 +153,9 @@ void WmfTest::testTdf88163PlaceableWmf()
|
|
||||||
|
|
||||||
// These values come from the fix for tdf#88163
|
|
||||||
|
|
||||||
- // Font 'Roman' and its height can vary according to the platform
|
|
||||||
// The fix does not affect the font size
|
|
||||||
- // Linux: 300 - Mac: 309 - Windows: 316
|
|
||||||
auto x = getXPath(pDoc, "/metafile/push[2]/font[1]", "height");
|
|
||||||
- CPPUNIT_ASSERT_MESSAGE(fileName.toUtf8().getStr(), x.toInt32() > 290);
|
|
||||||
- CPPUNIT_ASSERT_MESSAGE(fileName.toUtf8().getStr(), x.toInt32() < 320);
|
|
||||||
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(313), x.toInt32());
|
|
||||||
|
|
||||||
// Fails without the fix: Expected: 1900, Actual: 19818
|
|
||||||
assertXPath(pDoc, "/metafile", "height", "1900");
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
Loading…
Reference in new issue