6.1.X series

f41
Caolán McNamara 6 years ago
parent 191618f26f
commit c1fd0cf221

@ -1,67 +0,0 @@
From 811575c105b0a2bc597afda2f84a087199447ae5 Mon Sep 17 00:00:00 2001
Message-Id: <811575c105b0a2bc597afda2f84a087199447ae5.1531842164.git.erack@redhat.com>
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 18 Apr 2018 16:35:55 +0200
Subject: [PATCH] Keep the still relevant part of
external/icu/icu4c-ubsan.patch.1
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
...which f247f08e370626bbb427acd8f4a400fd875350a3 "Upgrade to ICU 61.1" had
removed completely, in error.
Change-Id: I7239011561851333cac58e54e4e7d590b8529dbc
---
external/icu/UnpackedTarball_icu.mk | 1 +
external/icu/icu4c-ubsan.patch.1 | 14 ++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 external/icu/icu4c-ubsan.patch.1
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch"
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index b81cdaab6242..c789e6eb8d84 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/icu4c-solarisgcc.patch.1 \
external/icu/icu4c-mkdir.patch.1 \
external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \
+ external/icu/icu4c-ubsan.patch.1 \
external/icu/icu4c-icu11100.patch.1 \
external/icu/icu4c-scriptrun.patch.1 \
external/icu/icu4c-rtti.patch.1 \
diff --git a/external/icu/icu4c-ubsan.patch.1 b/external/icu/icu4c-ubsan.patch.1
new file mode 100644
index 000000000000..ea9f13fd85cd
--- /dev/null
+++ b/external/icu/icu4c-ubsan.patch.1
@@ -0,0 +1,14 @@
+diff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h
+--- icu.org/source/common/ubidiimp.h 2017-02-03 19:57:23.000000000 +0100
++++ icu/source/common/ubidiimp.h 2017-04-21 22:46:25.374651159 +0200
+@@ -198,8 +198,8 @@
+ /* in a Run, logicalStart will get this bit set if the run level is odd */
+ #define INDEX_ODD_BIT (1UL<<31)
+
+-#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))
+-#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31))
++#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))
++#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31))
+ #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT)
+
+ #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT)
--------------erAck-patch-parts--

@ -1,74 +0,0 @@
From 15cdcd0346b7aa98d4697edec8aeea9c810efa62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 5 Dec 2017 17:13:28 +0000
Subject: [PATCH] Related: tdf#105998 except cut and paste as bitmap instead of
export
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Take a drawing rectangle in draw and cut and paste as bitmap to writer. The
hairline border along the very right/bottom edge of the bitmap appear missing.
fallback to default handlers which can distort the hairline to be visible
Change-Id: Iedb580f65879628839c83e41092745ae7c11267c
Reviewed-on: https://gerrit.libreoffice.org/45902
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
.../source/processor2d/vclpixelprocessor2d.cxx | 25 +++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9c21c83ee..5c5c0bb 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -41,6 +41,7 @@
#include "helperwrongspellrenderer.hxx"
#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vcl/hatch.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/awt/PosSize.hpp>
@@ -210,10 +211,6 @@ namespace drawinglayer
maBColorModifierStack.getModifiedColor(
rSource.getLineAttribute().getColor()));
- mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor(Color(aLineColor));
- aHairLinePolyPolygon.transform(maCurrentTransformation);
-
double fLineWidth(rSource.getLineAttribute().getWidth());
if(basegfx::fTools::more(fLineWidth, 0.0))
@@ -234,6 +231,24 @@ namespace drawinglayer
fLineWidth = 0.0;
}
+ //Related: tdf#105998 cut and paste as bitmap of shape from draw to
+ //writer. If we are a hairline along the very right/bottom edge of
+ //the canvas then fallback to defaults which can distort the
+ //hairline inside the paintable area
+ if (fLineWidth == 0.0)
+ {
+ Size aSize = mpOutputDevice->GetOutputSize();
+ basegfx::B2DRange aRange = aHairLinePolyPolygon.getB2DRange();
+ basegfx::B2DRange aOutputRange = aRange;
+ aOutputRange.transform(maCurrentTransformation);
+ if (std::round(aOutputRange.getMaxX()) == aSize.Width() || std::round(aOutputRange.getMaxY()) == aSize.Height())
+ return false;
+ }
+
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor(Color(aLineColor));
+ aHairLinePolyPolygon.transform(maCurrentTransformation);
+
bool bHasPoints(false);
bool bTryWorked(false);
--
2.9.5

@ -1,67 +0,0 @@
From a74837a0e7c7259e4396aa5f05cf1384e256db35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 20 Feb 2017 16:04:58 +0000
Subject: [PATCH] Related: tdf#106100 recover mangled svg in presentations
Change-Id: I77b452aa69a8341aa30e1e93d0d5ee8160533095
---
svgio/Module_svgio.mk | 4 ----
svgio/source/svgreader/svgsvgnode.cxx | 27 +++------------------------
2 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/svgio/Module_svgio.mk b/svgio/Module_svgio.mk
index 29ef97d..8b827fc 100644
--- a/svgio/Module_svgio.mk
+++ b/svgio/Module_svgio.mk
@@ -22,8 +22,4 @@ $(eval $(call gb_Module_add_targets,svgio,\
Library_svgio \
))
-$(eval $(call gb_Module_add_check_targets,svgio,\
- CppunitTest_svgio \
-))
-
# vim: set noet ts=4 sw=4:
diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx
index 7800666..087c621 100644
--- a/svgio/source/svgreader/svgsvgnode.cxx
+++ b/svgio/source/svgreader/svgsvgnode.cxx
@@ -522,32 +522,11 @@ namespace svgio
}
else
{
- // There exists no parent to resolve relative width or height.
- // Use child size as fallback and expand to aspect ratio given
- // by the viewBox. No mapping.
- // We get viewport >= content, therefore no clipping.
- bNeedsMapping = false;
- const basegfx::B2DRange aChildRange(
- aSequence.getB2DRange(
- drawinglayer::geometry::ViewInformation2D()));
- const double fChildWidth(aChildRange.getWidth());
- const double fChildHeight(aChildRange.getHeight());
- const double fLeft(aChildRange.getMinX());
- const double fTop(aChildRange.getMinY());
- if ( fChildWidth / fViewBoxWidth > fChildHeight / fViewBoxHeight )
- { // expand y
- fW = fChildWidth;
- fH = fChildWidth / fViewBoxRatio;
- }
- else
- { // expand x
- fH = fChildHeight;
- fW = fChildHeight * fViewBoxRatio;
- }
- aSvgCanvasRange = basegfx::B2DRange(fLeft, fTop, fLeft + fW, fTop + fH);
+ fW = fViewBoxWidth;
+ fH = fViewBoxHeight;
+ aSvgCanvasRange = basegfx::B2DRange(0.0, 0.0, fW, fH);
}
-
if (bNeedsMapping)
{
// create mapping
--
2.9.3

@ -1,675 +0,0 @@
From f247f08e370626bbb427acd8f4a400fd875350a3 Mon Sep 17 00:00:00 2001
Message-Id: <f247f08e370626bbb427acd8f4a400fd875350a3.1531842113.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Tue, 17 Apr 2018 20:13:52 +0200
Subject: [PATCH] Upgrade to ICU 61.1
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Change-Id: I89c1c3d13d85decc72576744de2a16d20471d29d
Reviewed-on: https://gerrit.libreoffice.org/53064
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
---
configure.ac | 4 +-
download.lst | 8 +-
external/icu/UnpackedTarball_icu.mk | 3 +-
...patch.1 => icu4c-61-werror-shadow.patch.1} | 30 ++-
external/icu/icu4c-khmerbreakengine.patch.1 | 246 +++++++++---------
external/icu/icu4c-ubsan.patch.1 | 91 -------
6 files changed, 147 insertions(+), 235 deletions(-)
rename external/icu/{icu4c-59-werror-shadow.patch.1 => icu4c-61-werror-shadow.patch.1} (50%)
delete mode 100644 external/icu/icu4c-ubsan.patch.1
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Upgrade-to-ICU-61.1.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Upgrade-to-ICU-61.1.patch"
diff --git a/configure.ac b/configure.ac
index bdc374699cb9..458f9f3c2735 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9001,8 +9001,8 @@ SYSTEM_GENBRK=
SYSTEM_GENCCODE=
SYSTEM_GENCMN=
-ICU_MAJOR=60
-ICU_MINOR=2
+ICU_MAJOR=61
+ICU_MINOR=1
ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
diff --git a/download.lst b/download.lst
index 0a1fa65396d1..76f067bff4d7 100644
--- a/download.lst
+++ b/download.lst
@@ -102,10 +102,10 @@ export HUNSPELL_SHA256SUM := 3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce
export HUNSPELL_TARBALL := hunspell-1.6.2.tar.gz
export HYPHEN_SHA256SUM := 304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705
export HYPHEN_TARBALL := 5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
-export ICU_SHA256SUM := f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418
-export ICU_TARBALL := icu4c-60_2-src.tgz
-export ICU_DATA_SHA256SUM := 68f42ad0c9e0a5a5af8eba0577ba100833912288bad6e4d1f42ff480bbcfd4a9
-export ICU_DATA_TARBALL := icu4c-60_2-data.zip
+export ICU_SHA256SUM := d007f89ae8a2543a53525c74359b65b36412fa84b3349f1400be6dcf409fafef
+export ICU_TARBALL := icu4c-61_1-src.tgz
+export ICU_DATA_SHA256SUM := d149ed0985b5a6e16a9d8ed66f105dd58fd334c276779f74241cfa656ed2830a
+export ICU_DATA_TARBALL := icu4c-61_1-data.zip
export JFREEREPORT_FLOW_ENGINE_SHA256SUM := 233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
export JFREEREPORT_FLUTE_SHA256SUM := 1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index a4d0b16ecb36..b81cdaab6242 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -27,15 +27,14 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/icu4c-solarisgcc.patch.1 \
external/icu/icu4c-mkdir.patch.1 \
external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \
- external/icu/icu4c-ubsan.patch.1 \
external/icu/icu4c-icu11100.patch.1 \
external/icu/icu4c-scriptrun.patch.1 \
external/icu/icu4c-rtti.patch.1 \
external/icu/icu4c-clang-cl.patch.1 \
$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
external/icu/icu4c-khmerbreakengine.patch.1 \
- external/icu/icu4c-59-werror-shadow.patch.1 \
external/icu/ofz4860.patch.2 \
+ external/icu/icu4c-61-werror-shadow.patch.1 \
))
$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/icu4c-59-werror-shadow.patch.1 b/external/icu/icu4c-61-werror-shadow.patch.1
similarity index 50%
rename from external/icu/icu4c-59-werror-shadow.patch.1
rename to external/icu/icu4c-61-werror-shadow.patch.1
index fb88244aff13..b00f76317eff 100644
--- a/external/icu/icu4c-59-werror-shadow.patch.1
+++ b/external/icu/icu4c-61-werror-shadow.patch.1
@@ -1,33 +1,35 @@
+# https://ssl.icu-project.org/trac/ticket/13709
+# Werror=shadow fails for unistr.h
diff -ur icu.org/source/common/unicode/unistr.h icu/source/common/unicode/unistr.h
---- icu.org/source/common/unicode/unistr.h 2017-03-29 06:44:37.000000000 +0200
-+++ icu/source/common/unicode/unistr.h 2017-04-24 11:59:51.782076511 +0200
-@@ -3080,11 +3080,11 @@
+--- icu.org/source/common/unicode/unistr.h 2018-03-26 15:38:29.000000000 +0200
++++ icu/source/common/unicode/unistr.h 2018-04-18 10:44:16.321188314 +0200
+@@ -3053,11 +3053,11 @@
* uint16_t * constructor.
* Delegates to UnicodeString(const char16_t *, int32_t).
* @param text UTF-16 string
- * @param length string length
-+ * @param length_ string length
- * @draft ICU 59
++ * @param textLength string length
+ * @stable ICU 59
*/
- UnicodeString(const uint16_t *text, int32_t length) :
- UnicodeString(ConstChar16Ptr(text), length) {}
-+ UnicodeString(const uint16_t *text, int32_t length_) :
-+ UnicodeString(ConstChar16Ptr(text), length_) {}
++ UnicodeString(const uint16_t *text, int32_t textLength) :
++ UnicodeString(ConstChar16Ptr(text), textLength) {}
#endif
- /*
-@@ -3097,11 +3097,11 @@
+ #if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
+@@ -3066,11 +3066,11 @@
* (Only defined if U_SIZEOF_WCHAR_T==2.)
* Delegates to UnicodeString(const char16_t *, int32_t).
* @param text NUL-terminated UTF-16 string
- * @param length string length
-+ * @param length_ string length
- * @draft ICU 59
++ * @param textLength string length
+ * @stable ICU 59
*/
- UnicodeString(const wchar_t *text, int32_t length) :
- UnicodeString(ConstChar16Ptr(text), length) {}
-+ UnicodeString(const wchar_t *text, int32_t length_) :
-+ UnicodeString(ConstChar16Ptr(text), length_) {}
++ UnicodeString(const wchar_t *text, int32_t textLength) :
++ UnicodeString(ConstChar16Ptr(text), textLength) {}
#endif
- /*
+ /**
diff --git a/external/icu/icu4c-khmerbreakengine.patch.1 b/external/icu/icu4c-khmerbreakengine.patch.1
index 6b45b3743611..9f134dd961b1 100644
--- a/external/icu/icu4c-khmerbreakengine.patch.1
+++ b/external/icu/icu4c-khmerbreakengine.patch.1
@@ -1,16 +1,18 @@
diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
---- icu.org/source/common/dictbe.cpp 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/dictbe.cpp 2017-04-21 23:14:23.845894374 +0200
-@@ -29,8 +29,17 @@
+--- icu.org/source/common/dictbe.cpp 2018-03-26 15:38:30.000000000 +0200
++++ icu/source/common/dictbe.cpp 2018-04-17 17:55:38.620944919 +0200
+@@ -29,7 +29,19 @@
******************************************************************
*/
--DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes) {
-+DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes) :
-+ clusterLimit(3)
-+{
+-DictionaryBreakEngine::DictionaryBreakEngine() {
++DictionaryBreakEngine::DictionaryBreakEngine()
++ : fTypes(0), clusterLimit(0) {
++}
++
++DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes)
++ : fTypes(breakTypes), clusterLimit(3) {
+ UErrorCode status = U_ZERO_ERROR;
- fTypes = breakTypes;
+ fViramaSet.applyPattern(UNICODE_STRING_SIMPLE("[[:ccc=VR:]]"), status);
+
+ // note Skip Sets contain fIgnoreSet characters too.
@@ -20,16 +22,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
}
DictionaryBreakEngine::~DictionaryBreakEngine() {
-@@ -92,7 +101,7 @@
- result = divideUpDictionaryRange(text, rangeStart, rangeEnd, foundBreaks);
- utext_setNativeIndex(text, current);
- }
--
-+
- return result;
- }
-
-@@ -103,6 +112,169 @@
+@@ -76,6 +88,169 @@
fSet.compact();
}
@@ -199,7 +192,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
/*
******************************************************************
* PossibleWord
-@@ -130,35 +302,35 @@
+@@ -103,35 +278,35 @@
public:
PossibleWord() : count(0), prefix(0), offset(-1), mark(0), current(0) {};
~PossibleWord() {};
@@ -244,7 +237,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
// Dictionary leaves text after longest prefix, not longest word. Back up.
if (count <= 0) {
utext_setNativeIndex(text, start);
-@@ -830,51 +1002,28 @@
+@@ -803,51 +978,28 @@
* KhmerBreakEngine
*/
@@ -265,7 +258,8 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
-static const int32_t KHMER_MIN_WORD_SPAN = KHMER_MIN_WORD * 2;
-
KhmerBreakEngine::KhmerBreakEngine(DictionaryMatcher *adoptDictionary, UErrorCode &status)
- : DictionaryBreakEngine((1 << UBRK_WORD) | (1 << UBRK_LINE)),
+- : DictionaryBreakEngine(),
++ : DictionaryBreakEngine((1 << UBRK_WORD) | (1 << UBRK_LINE)),
fDictionary(adoptDictionary)
{
- fKhmerWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]]"), status);
@@ -301,13 +295,13 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
- fEndWordSet.compact();
- fBeginWordSet.compact();
-// fSuffixSet.compact();
-+ fIgnoreSet.compact();
-+ fBaseSet.compact();
-+ fPuncSet.compact();
++ fIgnoreSet.compact();
++ fBaseSet.compact();
++ fPuncSet.compact();
}
KhmerBreakEngine::~KhmerBreakEngine() {
-@@ -886,180 +1035,204 @@
+@@ -859,180 +1011,204 @@
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
@@ -350,17 +344,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ foundBreaks.push(rangeEnd, status);
+ return foundBreaks.size() - wordsFound;
+ }
-+
-+ scanStart = rangeStart;
-+ scanWJ(text, scanStart, rangeEnd, before, after);
-+ if (startZwsp || initAfter >= before) {
-+ after = initAfter;
-+ before = 0;
-+ }
-+ if (!endZwsp && after > finalBefore && after < rangeEnd)
-+ endZwsp = true;
-+ if (endZwsp && before > finalBefore)
-+ before = finalBefore;
- while (U_SUCCESS(status) && (current = (int32_t)utext_getNativeIndex(text)) < rangeEnd) {
- cuWordLength = 0;
@@ -375,7 +358,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
- cpWordLength = words[wordsFound % KHMER_LOOKAHEAD].markedCPLength();
- wordsFound += 1;
- }
--
++ scanStart = rangeStart;
++ scanWJ(text, scanStart, rangeEnd, before, after);
++ if (startZwsp || initAfter >= before) {
++ after = initAfter;
++ before = 0;
++ }
++ if (!endZwsp && after > finalBefore && after < rangeEnd)
++ endZwsp = true;
++ if (endZwsp && before > finalBefore)
++ before = finalBefore;
+
- // If there was more than one, see which one can take us forward the most words
- else if (candidates > 1) {
- // If we're already at the end of the range, we're done
@@ -390,22 +383,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
- words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
- wordsMatched = 2;
- }
--
-- // If we're already at the end of the range, we're done
-- if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
-- goto foundBest;
-- }
--
-- // See if any of the possible second words is followed by a third word
-- do {
-- // If we find a third word, stop right away
-- if (words[(wordsFound + 2) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd)) {
-- words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
-- goto foundBest;
-- }
-- }
-- while (words[(wordsFound + 1) % KHMER_LOOKAHEAD].backUp(text));
-- }
+ utext_setNativeIndex(text, rangeStart);
+ int32_t numCodePts = rangeEnd - rangeStart;
+ // bestSnlp[i] is the snlp of the best segmentation of the first i
@@ -415,7 +392,11 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ for(int32_t i = 1; i <= numCodePts; i++) {
+ bestSnlp.addElement(kuint32max, status);
+ }
-+
+
+- // If we're already at the end of the range, we're done
+- if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
+- goto foundBest;
+- }
+ // prev[i] is the index of the last code point in the previous word in
+ // the best segmentation of the first i characters. Note negative implies
+ // that the code point is part of an unknown word.
@@ -423,7 +404,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ for(int32_t i = 0; i <= numCodePts; i++) {
+ prev.addElement(kuint32max, status);
+ }
-+
+
+- // See if any of the possible second words is followed by a third word
+- do {
+- // If we find a third word, stop right away
+- if (words[(wordsFound + 2) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd)) {
+- words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
+- goto foundBest;
+- }
+- }
+- while (words[(wordsFound + 1) % KHMER_LOOKAHEAD].backUp(text));
+- }
+ const int32_t maxWordSize = 20;
+ UVector32 values(maxWordSize, status);
+ values.setSize(maxWordSize);
@@ -528,27 +519,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
- if (cuWordLength <= 0) {
- wordsFound += 1;
- }
--
-- // Update the length with the passed-over characters
-- cuWordLength += chars;
-- }
-- else {
-- // Back up to where we were for next iteration
-- utext_setNativeIndex(text, current+cuWordLength);
+ } while (fMarkSet.contains(c) || fIgnoreSet.contains(c));
+ values.setElementAt(BADSNLP, count);
+ lengths.setElementAt(utext_getNativeIndex(text) - currix, count++);
+ } else {
+ values.setElementAt(BADSNLP, count);
+ lengths.setElementAt(1, count++);
- }
- }
++ }
++ }
-- // Never stop before a combining mark.
-- int32_t currPos;
-- while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
-- utext_next32(text);
-- cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
+- // Update the length with the passed-over characters
+- cuWordLength += chars;
+ for (int32_t j = 0; j < count; j++) {
+ uint32_t v = values.elementAti(j);
+ int32_t newSnlp = bestSnlp.elementAti(i) + v;
@@ -559,7 +540,10 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ ++ln;
+ utext_next32(text);
+ c = utext_current32(text);
-+ }
+ }
+- else {
+- // Back up to where we were for next iteration
+- utext_setNativeIndex(text, current+cuWordLength);
+ int32_t ln_j_i = ln + i; // yes really i!
+ if (newSnlp < bestSnlp.elementAti(ln_j_i)) {
+ if (v == BADSNLP) {
@@ -572,9 +556,38 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ else
+ prev.setElementAt(i, ln_j_i);
+ bestSnlp.setElementAt(newSnlp, ln_j_i);
-+ }
+ }
}
-
+- // Never stop before a combining mark.
+- int32_t currPos;
+- while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
+- utext_next32(text);
+- cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
++ }
++ // Start pushing the optimal offset index into t_boundary (t for tentative).
++ // prev[numCodePts] is guaranteed to be meaningful.
++ // We'll first push in the reverse order, i.e.,
++ // t_boundary[0] = numCodePts, and afterwards do a swap.
++ UVector32 t_boundary(numCodePts+1, status);
++
++ int32_t numBreaks = 0;
++ // No segmentation found, set boundary to end of range
++ while (numCodePts >= 0 && (uint32_t)bestSnlp.elementAti(numCodePts) == kuint32max) {
++ --numCodePts;
++ }
++ if (numCodePts < 0) {
++ t_boundary.addElement(numCodePts, status);
++ numBreaks++;
++ } else {
++ for (int32_t i = numCodePts; (uint32_t)i != kuint32max; i = prev.elementAti(i)) {
++ if (i < 0) i = -i;
++ t_boundary.addElement(i, status);
++ numBreaks++;
+ }
++ U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0);
++ }
+
- // Look ahead for possible suffixes if a dictionary word does not follow.
- // We do this in code rather than using a rule so that the heuristic
- // resynch continues to function. For example, one of the suffix characters
@@ -616,30 +629,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
- // Did we find a word on this iteration? If so, push it on the break stack
- if (cuWordLength > 0) {
- foundBreaks.push((current+cuWordLength), status);
-+ }
-+ // Start pushing the optimal offset index into t_boundary (t for tentative).
-+ // prev[numCodePts] is guaranteed to be meaningful.
-+ // We'll first push in the reverse order, i.e.,
-+ // t_boundary[0] = numCodePts, and afterwards do a swap.
-+ UVector32 t_boundary(numCodePts+1, status);
-+
-+ int32_t numBreaks = 0;
-+ // No segmentation found, set boundary to end of range
-+ while (numCodePts >= 0 && (uint32_t)bestSnlp.elementAti(numCodePts) == kuint32max) {
-+ --numCodePts;
-+ }
-+ if (numCodePts < 0) {
-+ t_boundary.addElement(numCodePts, status);
-+ numBreaks++;
-+ } else {
-+ for (int32_t i = numCodePts; (uint32_t)i != kuint32max; i = prev.elementAti(i)) {
-+ if (i < 0) i = -i;
-+ t_boundary.addElement(i, status);
-+ numBreaks++;
-+ }
-+ U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0);
-+ }
-+
+ // Now that we're done, convert positions in t_boundary[] (indices in
+ // the normalized input string) back to indices in the original input UText
+ // while reversing t_boundary and pushing values to foundBreaks.
@@ -669,38 +658,35 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
#if !UCONFIG_NO_NORMALIZATION
diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
---- icu.org/source/common/dictbe.h 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/dictbe.h 2017-04-21 23:14:23.845894374 +0200
-@@ -34,6 +34,15 @@
+--- icu.org/source/common/dictbe.h 2018-03-26 15:38:30.000000000 +0200
++++ icu/source/common/dictbe.h 2018-04-17 14:55:33.307639865 +0200
+@@ -34,7 +34,8 @@
+ * threads without synchronization.</p>
*/
class DictionaryBreakEngine : public LanguageBreakEngine {
- private:
-+
-+ /**
-+ * <p>Default constructor.</p>
-+ *
-+ */
-+ DictionaryBreakEngine();
-+
+- private:
+ protected:
+
/**
* The set of characters handled by this engine
* @internal
-@@ -48,11 +57,63 @@
+@@ -42,14 +43,84 @@
- uint32_t fTypes;
+ UnicodeSet fSet;
+ const int32_t WJ = 0x2060;
+ const int32_t ZWSP = 0x200B;
+
- /**
-- * <p>Default constructor.</p>
-- *
++ /**
++ * The break types it was constructed with
++ * @internal
++ */
++ uint32_t fTypes;
++
++ /**
+ * A Unicode set of all viramas
+ * @internal
- */
-- DictionaryBreakEngine();
++ */
+ UnicodeSet fViramaSet;
+
+ /**
@@ -751,10 +737,26 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
+ bool scanAfterEnd(UText *text, int32_t rangeEnd, int32_t& end, bool &doBreak) const;
+ void scanBackClusters(UText *text, int32_t textStart, int32_t& start) const;
+ void scanFwdClusters(UText *text, int32_t textEnd, int32_t& end) const;
-
++
public:
-@@ -83,7 +144,7 @@
+ /**
+- * <p>Constructor </p>
++ * <p>Default constructor.</p>
++ *
+ */
+ DictionaryBreakEngine();
+
+ /**
++ * <p>Constructor with break types.</p>
++ */
++ explicit DictionaryBreakEngine(uint32_t breakTypes);
++
++ /**
+ * <p>Virtual destructor.</p>
+ */
+ virtual ~DictionaryBreakEngine();
+@@ -68,7 +139,7 @@
* <p>Find any breaks within a run in the supplied text.</p>
*
* @param text A UText representing the text. The iterator is left at
@@ -763,7 +765,7 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
* that starts from the first character in the range.
* @param startPos The start of the run within the supplied text.
* @param endPos The end of the run within the supplied text.
-@@ -245,118 +306,120 @@
+@@ -218,118 +289,120 @@
};
@@ -997,8 +999,8 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
/*******************************************************************
diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionarydata.cpp
---- icu.org/source/common/dictionarydata.cpp 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/dictionarydata.cpp 2017-04-21 23:14:23.846894372 +0200
+--- icu.org/source/common/dictionarydata.cpp 2018-03-26 15:38:30.000000000 +0200
++++ icu/source/common/dictionarydata.cpp 2018-04-17 14:04:50.775567214 +0200
@@ -44,7 +44,7 @@
int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t limit,
@@ -1046,8 +1048,8 @@ diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionaryda
if (values != NULL) {
values[wordCount] = bt.getValue();
diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata.h
---- icu.org/source/common/dictionarydata.h 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/dictionarydata.h 2017-04-21 23:14:23.846894372 +0200
+--- icu.org/source/common/dictionarydata.h 2018-03-26 15:38:30.000000000 +0200
++++ icu/source/common/dictionarydata.h 2018-04-17 14:04:50.775567214 +0200
@@ -21,6 +21,7 @@
#include "unicode/utext.h"
#include "unicode/udata.h"
@@ -1084,8 +1086,8 @@ diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata
private:
UChar32 transform(UChar32 c) const;
diff -ur icu.org/source/data/Makefile.in icu/source/data/Makefile.in
---- icu.org/source/data/Makefile.in 2017-04-21 23:13:03.248087545 +0200
-+++ icu/source/data/Makefile.in 2017-04-21 23:14:23.846894372 +0200
+--- icu.org/source/data/Makefile.in 2018-04-17 12:28:37.098707466 +0200
++++ icu/source/data/Makefile.in 2018-04-17 14:04:50.775567214 +0200
@@ -183,7 +183,7 @@
endif
endif
diff --git a/external/icu/icu4c-ubsan.patch.1 b/external/icu/icu4c-ubsan.patch.1
deleted file mode 100644
index 9f6aa3fbc9f8..000000000000
--- a/external/icu/icu4c-ubsan.patch.1
+++ /dev/null
@@ -1,91 +0,0 @@
-diff -ur icu.org/source/common/rbbidata.h icu/source/common/rbbidata.h
---- icu.org/source/common/rbbidata.h 2017-02-03 19:57:23.000000000 +0100
-+++ icu/source/common/rbbidata.h 2017-04-21 22:46:25.371651160 +0200
-@@ -115,7 +115,7 @@
- /* StatusTable of the set of matching */
- /* tags (rule status values) */
- int16_t fReserved;
-- uint16_t fNextState[2]; /* Next State, indexed by char category. */
-+ uint16_t fNextState[1]; /* Next State, indexed by char category. */
- /* This array does not have two elements */
- /* Array Size is actually fData->fHeader->fCatCount */
- /* CAUTION: see RBBITableBuilder::getTableSize() */
-@@ -128,7 +128,7 @@
- uint32_t fRowLen; /* Length of a state table row, in bytes. */
- uint32_t fFlags; /* Option Flags for this state table */
- uint32_t fReserved; /* reserved */
-- char fTableData[4]; /* First RBBIStateTableRow begins here. */
-+ char fTableData[1]; /* First RBBIStateTableRow begins here. */
- /* (making it char[] simplifies ugly address */
- /* arithmetic for indexing variable length rows.) */
- };
-diff -ur icu.org/source/common/rbbitblb.cpp icu/source/common/rbbitblb.cpp
---- icu.org/source/common/rbbitblb.cpp 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/rbbitblb.cpp 2017-04-21 22:46:25.373651159 +0200
-@@ -1095,15 +1095,15 @@
- return 0;
- }
-
-- size = sizeof(RBBIStateTable) - 4; // The header, with no rows to the table.
-+ size = offsetof(RBBIStateTable, fTableData); // The header, with no rows to the table.
-
- numRows = fDStates->size();
- numCols = fRB->fSetBuilder->getNumCharCategories();
-
-- // Note The declaration of RBBIStateTableRow is for a table of two columns.
-- // Therefore we subtract two from numCols when determining
-+ // Note The declaration of RBBIStateTableRow is for a table of one columns.
-+ // Therefore we subtract one from numCols when determining
- // how much storage to add to a row for the total columns.
-- rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2);
-+ rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1);
- size += numRows * rowSize;
- return size;
- }
-@@ -1133,7 +1133,7 @@
- }
-
- table->fRowLen = sizeof(RBBIStateTableRow) +
-- sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2);
-+ sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1);
- table->fNumStates = fDStates->size();
- table->fFlags = 0;
- if (fRB->fLookAheadHardBreak) {
-diff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h
---- icu.org/source/common/ubidiimp.h 2017-02-03 19:57:23.000000000 +0100
-+++ icu/source/common/ubidiimp.h 2017-04-21 22:46:25.374651159 +0200
-@@ -198,8 +198,8 @@
- /* in a Run, logicalStart will get this bit set if the run level is odd */
- #define INDEX_ODD_BIT (1UL<<31)
-
--#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))
--#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31))
-+#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))
-+#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31))
- #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT)
-
- #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT)
-diff -ur icu.org/source/common/ucmndata.cpp icu/source/common/ucmndata.cpp
---- icu.org/source/common/ucmndata.cpp 2017-03-08 16:34:47.000000000 +0100
-+++ icu/source/common/ucmndata.cpp 2017-04-21 22:46:25.376651159 +0200
-@@ -77,7 +77,7 @@
- typedef struct {
- uint32_t count;
- uint32_t reserved;
-- PointerTOCEntry entry[2]; /* Actual size is from count. */
-+ PointerTOCEntry entry[1]; /* Actual size is from count. */
- } PointerTOC;
-
-
-diff -ur icu.org/source/common/ucmndata.h icu/source/common/ucmndata.h
---- icu.org/source/common/ucmndata.h 2017-01-20 01:20:31.000000000 +0100
-+++ icu/source/common/ucmndata.h 2017-04-21 22:46:25.377651159 +0200
-@@ -52,7 +52,7 @@
-
- typedef struct {
- uint32_t count;
-- UDataOffsetTOCEntry entry[2]; /* Actual size of array is from count. */
-+ UDataOffsetTOCEntry entry[1]; /* Actual size of array is from count. */
- } UDataOffsetTOC;
-
- /**
--------------erAck-patch-parts--

@ -1,236 +0,0 @@
From 86dfa34c6d83b70923d462fecad316dafd9a1fc4 Mon Sep 17 00:00:00 2001
Message-Id: <86dfa34c6d83b70923d462fecad316dafd9a1fc4.1531839924.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Mon, 16 Jul 2018 15:20:32 +0200
Subject: [PATCH] Upgrade to ICU 62.1
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Change-Id: I9426e77aa85cfe068df59db47b8ac50b59cd4eb3
Reviewed-on: https://gerrit.libreoffice.org/57500
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
---
configure.ac | 2 +-
download.lst | 8 +++----
external/icu/UnpackedTarball_icu.mk | 1 -
external/icu/icu4c-mkdir.patch.1 | 6 ++---
external/icu/ofz4860.patch.2 | 25 ---------------------
i18nutil/source/utility/unicode.cxx | 23 +++++++++++++++++++
include/svx/strings.hrc | 11 +++++++++
svx/source/dialog/charmap.cxx | 35 +++++++++++++++++++++++++++++
8 files changed, 77 insertions(+), 34 deletions(-)
delete mode 100644 external/icu/ofz4860.patch.2
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Upgrade-to-ICU-62.1.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Upgrade-to-ICU-62.1.patch"
diff --git a/configure.ac b/configure.ac
index 23b3fd4953c9..2fd11a9b3d19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9066,7 +9066,7 @@ SYSTEM_GENBRK=
SYSTEM_GENCCODE=
SYSTEM_GENCMN=
-ICU_MAJOR=61
+ICU_MAJOR=62
ICU_MINOR=1
ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
diff --git a/download.lst b/download.lst
index dd3519b74a8d..0d4e974ed105 100644
--- a/download.lst
+++ b/download.lst
@@ -102,10 +102,10 @@ export HUNSPELL_SHA256SUM := 3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce
export HUNSPELL_TARBALL := hunspell-1.6.2.tar.gz
export HYPHEN_SHA256SUM := 304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705
export HYPHEN_TARBALL := 5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
-export ICU_SHA256SUM := d007f89ae8a2543a53525c74359b65b36412fa84b3349f1400be6dcf409fafef
-export ICU_TARBALL := icu4c-61_1-src.tgz
-export ICU_DATA_SHA256SUM := d149ed0985b5a6e16a9d8ed66f105dd58fd334c276779f74241cfa656ed2830a
-export ICU_DATA_TARBALL := icu4c-61_1-data.zip
+export ICU_SHA256SUM := 3dd9868d666350dda66a6e305eecde9d479fb70b30d5b55d78a1deffb97d5aa3
+export ICU_TARBALL := icu4c-62_1-src.tgz
+export ICU_DATA_SHA256SUM := 93bcaf58cfa9223972da79cb8e0f94819ace4995db6041b84f4d9bd810246d1d
+export ICU_DATA_TARBALL := icu4c-62_1-data.zip
export JFREEREPORT_FLOW_ENGINE_SHA256SUM := 233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
export JFREEREPORT_FLUTE_SHA256SUM := 1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index c789e6eb8d84..6800c1fb5ea8 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/icu4c-clang-cl.patch.1 \
$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
external/icu/icu4c-khmerbreakengine.patch.1 \
- external/icu/ofz4860.patch.2 \
external/icu/icu4c-61-werror-shadow.patch.1 \
))
diff --git a/external/icu/icu4c-mkdir.patch.1 b/external/icu/icu4c-mkdir.patch.1
index 3234f151b677..7de4cf51174c 100644
--- a/external/icu/icu4c-mkdir.patch.1
+++ b/external/icu/icu4c-mkdir.patch.1
@@ -1,10 +1,10 @@
diff -ur icu.org/source/data/Makefile.in icu/source/data/Makefile.in
---- icu.org/source/data/Makefile.in 2016-06-15 20:58:17.000000000 +0200
-+++ icu/source/data/Makefile.in 2017-04-21 22:29:00.747158002 +0200
+--- icu.org/source/data/Makefile.in 2018-06-21 11:39:15.000000000 +0200
++++ icu/source/data/Makefile.in 2018-07-16 13:18:26.928109541 +0200
@@ -367,6 +367,7 @@
ifeq ($(PKGDATA_MODE),dll)
SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
- $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
+ $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc | build-dir
+ mkdir -p $(OUTTMPDIR)
ifeq ($(MSYS_RC_MODE),1)
rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $<
diff --git a/external/icu/ofz4860.patch.2 b/external/icu/ofz4860.patch.2
deleted file mode 100644
index 14114d52878b..000000000000
--- a/external/icu/ofz4860.patch.2
+++ /dev/null
@@ -1,25 +0,0 @@
-From 529ba01ee606940ca273b187be8ce9ba31cf2d90 Mon Sep 17 00:00:00 2001
-From: David Tardon <dtardon@redhat.com>
-Date: Fri, 19 Jan 2018 10:41:02 +0100
-Subject: [PATCH] ofz#4860 fix past-the-end read from array
-
----
- icu4c/source/common/locmap.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp
-index cbb2b810a..6d62d8310 100644
---- a/icu4c/source/common/locmap.cpp
-+++ b/icu4c/source/common/locmap.cpp
-@@ -1015,7 +1015,7 @@ static const char*
- getPosixID(const ILcidPosixMap *this_0, uint32_t hostID)
- {
- uint32_t i;
-- for (i = 0; i <= this_0->numRegions; i++)
-+ for (i = 0; i < this_0->numRegions; i++)
- {
- if (this_0->regionMaps[i].hostID == hostID)
- {
---
-2.14.3
-
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 6d90b15ca42e..876750d6119d 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -726,6 +726,29 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_ZANABAZAR_SQUARE:
sRet = "mn-Zanb"; // abugida to write Mongolian
break;
+#endif
+#if (U_ICU_VERSION_MAJOR_NUM >= 62)
+ case USCRIPT_DOGRA:
+ sRet = "dgo"; // Dogri proper
+ break;
+ case USCRIPT_GUNJALA_GONDI:
+ sRet = "wsg"; // Adilabad Gondi
+ break;
+ case USCRIPT_MAKASAR:
+ sRet = "mak";
+ break;
+ case USCRIPT_MEDEFAIDRIN:
+ sRet = "mis-Medf"; // Uncoded with script
+ break;
+ case USCRIPT_HANIFI_ROHINGYA:
+ sRet = "rhg";
+ break;
+ case USCRIPT_SOGDIAN:
+ sRet = "sog";
+ break;
+ case USCRIPT_OLD_SOGDIAN:
+ sRet = "sog";
+ break;
#endif
}
return sRet;
# Slightly adapted to rawhide/F29 libreoffice-6-0-6
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 86c2215ac1c4..18fd984a1bd8 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1656,6 +1656,17 @@
#define RID_SUBSETSTR_SOYOMBO NC_("RID_SUBSETMAP", "Soyombo")
#define RID_SUBSETSTR_SYRIAC_SUPPLEMENT NC_("RID_SUBSETMAP", "Syriac Supplement")
#define RID_SUBSETSTR_ZANABAZAR_SQUARE NC_("RID_SUBSETMAP", "Zanabazar Square")
+#define RID_SUBSETSTR_CHESS_SYMBOLS NC_("RID_SUBSETMAP", "Chess Symbols")
+#define RID_SUBSETSTR_DOGRA NC_("RID_SUBSETMAP", "Dogra")
+#define RID_SUBSETSTR_GEORGIAN_EXTENDED NC_("RID_SUBSETMAP", "Georgian Extended")
+#define RID_SUBSETSTR_GUNJALA_GONDI NC_("RID_SUBSETMAP", "Gunjala Gondi")
+#define RID_SUBSETSTR_HANIFI_ROHINGYA NC_("RID_SUBSETMAP", "Hanifi Rohingya")
+#define RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS NC_("RID_SUBSETMAP", "Indic Siyaq Numbers")
+#define RID_SUBSETSTR_MAKASAR NC_("RID_SUBSETMAP", "Makasar")
+#define RID_SUBSETSTR_MAYAN_NUMERALS NC_("RID_SUBSETMAP", "Mayan Numerals")
+#define RID_SUBSETSTR_MEDEFAIDRIN NC_("RID_SUBSETMAP", "Medefaidrin")
+#define RID_SUBSETSTR_OLD_SOGDIAN NC_("RID_SUBSETMAP", "Old Sogdian")
+#define RID_SUBSETSTR_SOGDIAN NC_("RID_SUBSETMAP", "Sogdian")
#endif
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 3bf3a01d520f..fcaa955541df 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -1744,6 +1744,41 @@ void SubsetMap::InitList()
aAllSubsets.emplace_back( 0x11A00, 0x11A4F, SvxResId(RID_SUBSETSTR_ZANABAZAR_SQUARE) );
break;
#endif
+#if (U_ICU_VERSION_MAJOR_NUM >= 62)
+ case UBLOCK_CHESS_SYMBOLS:
+ aAllSubsets.emplace_back( 0x1FA00, 0x1FA6F, SvxResId(RID_SUBSETSTR_CHESS_SYMBOLS) );
+ break;
+ case UBLOCK_DOGRA:
+ aAllSubsets.emplace_back( 0x11800, 0x1184F, SvxResId(RID_SUBSETSTR_DOGRA) );
+ break;
+ case UBLOCK_GEORGIAN_EXTENDED:
+ aAllSubsets.emplace_back( 0x1C90, 0x1CBF, SvxResId(RID_SUBSETSTR_GEORGIAN_EXTENDED) );
+ break;
+ case UBLOCK_GUNJALA_GONDI:
+ aAllSubsets.emplace_back( 0x11D60, 0x11DAF, SvxResId(RID_SUBSETSTR_GUNJALA_GONDI) );
+ break;
+ case UBLOCK_HANIFI_ROHINGYA:
+ aAllSubsets.emplace_back( 0x10D00, 0x10D3F, SvxResId(RID_SUBSETSTR_HANIFI_ROHINGYA) );
+ break;
+ case UBLOCK_INDIC_SIYAQ_NUMBERS:
+ aAllSubsets.emplace_back( 0x1EC70, 0x1ECBF, SvxResId(RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS) );
+ break;
+ case UBLOCK_MAKASAR:
+ aAllSubsets.emplace_back( 0x11EE0, 0x11EFF, SvxResId(RID_SUBSETSTR_MAKASAR) );
+ break;
+ case UBLOCK_MAYAN_NUMERALS:
+ aAllSubsets.emplace_back( 0x1D2E0, 0x1D2FF, SvxResId(RID_SUBSETSTR_MAYAN_NUMERALS) );
+ break;
+ case UBLOCK_MEDEFAIDRIN:
+ aAllSubsets.emplace_back( 0x16E40, 0x16E9F, SvxResId(RID_SUBSETSTR_MEDEFAIDRIN) );
+ break;
+ case UBLOCK_OLD_SOGDIAN:
+ aAllSubsets.emplace_back( 0x10F00, 0x10F2F, SvxResId(RID_SUBSETSTR_OLD_SOGDIAN) );
+ break;
+ case UBLOCK_SOGDIAN:
+ aAllSubsets.emplace_back( 0x10F30, 0x10F6F, SvxResId(RID_SUBSETSTR_SOGDIAN) );
+ break;
+#endif
}
--------------erAck-patch-parts--

@ -1,43 +0,0 @@
From 1d3de59ac2d12e42e12c9642bd252236a80b096b Mon Sep 17 00:00:00 2001
Message-Id: <1d3de59ac2d12e42e12c9642bd252236a80b096b.1531842210.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Tue, 17 Jul 2018 17:37:55 +0200
Subject: [PATCH] Use $(ICU_MAJOR) instead of hard coded (Upgrade to ICU 62.1)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Change-Id: Ifea7072922388b2c0b7631fb809b23e2a5524a3c
---
ios/CustomTarget_iOS_setup.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch"
# Slightly adapted to rawhide/F29 libreoffice-6-0-6
diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index a0d1a18823ab..718bb8b90d46 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -32,7 +32,7 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS_setup.mk
> $(IOSGEN)/native-code.h
# generate resource files used to start/run LibreOffice
- cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt61l.dat $(IOSRES)/icudt61l.dat
+ cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt$(ICU_MAJOR)l.dat $(IOSRES)/icudt$(ICU_MAJOR)l.dat
cp $(INSTDIR)/program/types.rdb $(IOSRES)/udkapi.rdb
cp $(INSTDIR)/program/types/offapi.rdb $(IOSRES)
cp $(INSTDIR)/program/types/oovbaapi.rdb $(IOSRES)
--------------erAck-patch-parts--

@ -1,43 +0,0 @@
From b9dde4a74cba5a771cbc85880d518f6717d19216 Mon Sep 17 00:00:00 2001
Message-Id: <b9dde4a74cba5a771cbc85880d518f6717d19216.1531842189.git.erack@redhat.com>
From: Tor Lillqvist <tml@collabora.com>
Date: Thu, 7 Jun 2018 21:51:14 +0300
Subject: [PATCH] We use ICU 61 now
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Change-Id: I7faf23de08db680599658206faaf3028888563f6
---
ios/CustomTarget_iOS_setup.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-We-use-ICU-61-now.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-We-use-ICU-61-now.patch"
# Slightly adapted to rawhide/F29 libreoffice-6-0-6
diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index a9f98850c6d8..a0d1a18823ab 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -32,7 +32,7 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS_setup.mk
> $(IOSGEN)/native-code.h
# generate resource files used to start/run LibreOffice
- cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt60l.dat $(IOSRES)/icudt60l.dat
+ cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt61l.dat $(IOSRES)/icudt61l.dat
cp $(INSTDIR)/program/types.rdb $(IOSRES)/udkapi.rdb
cp $(INSTDIR)/program/types/offapi.rdb $(IOSRES)
cp $(INSTDIR)/program/types/oovbaapi.rdb $(IOSRES)
--------------erAck-patch-parts--

@ -1,25 +0,0 @@
From fa5f426359bbe1b6a9c521130bf7bbee2e60f69f Mon Sep 17 00:00:00 2001
From: rpmbuild <rpmbuild@fedoraproject.org>
Date: Wed, 18 Jul 2018 15:31:31 +0100
Subject: [PATCH] foo
---
helpcontent2/to-wiki/wikiconv2.py | 2 --
5 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py
index 93f72eb..55ff72f 100755
--- a/helpcontent2/to-wiki/wikiconv2.py
+++ b/helpcontent2/to-wiki/wikiconv2.py
@@ -1071,8 +1071,6 @@ class Item(ElementBase):
sys.stderr.write('Unhandled item type. Possibly type has been localized.\n')
finally:
raise UnhandledItemType
- return replace_text(self.text)
-
class Paragraph(ElementBase):
def __init__(self, attrs, parent):
--
2.14.4

File diff suppressed because it is too large Load Diff

@ -1,74 +0,0 @@
From 2b69156c43261ceae55eb4d3b644c4c2d73231ba Mon Sep 17 00:00:00 2001
Message-Id: <2b69156c43261ceae55eb4d3b644c4c2d73231ba.1531843216.git.erack@redhat.com>
From: David Tardon <dtardon@redhat.com>
Date: Tue, 6 Mar 2018 15:17:13 +0100
Subject: [PATCH] forcepoint: fix out-of-bounds read in ICU
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Change-Id: I5061d38d0e7df0de9a5c7574d522ce69934e4a24
---
external/icu/UnpackedTarball_icu.mk | 1 +
external/icu/ofz4860.patch.2 | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 external/icu/ofz4860.patch.2
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch"
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 499650976a55..a4d0b16ecb36 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
external/icu/icu4c-khmerbreakengine.patch.1 \
external/icu/icu4c-59-werror-shadow.patch.1 \
+ external/icu/ofz4860.patch.2 \
))
$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/ofz4860.patch.2 b/external/icu/ofz4860.patch.2
new file mode 100644
index 000000000000..14114d52878b
--- /dev/null
+++ b/external/icu/ofz4860.patch.2
@@ -0,0 +1,25 @@
+From 529ba01ee606940ca273b187be8ce9ba31cf2d90 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Fri, 19 Jan 2018 10:41:02 +0100
+Subject: [PATCH] ofz#4860 fix past-the-end read from array
+
+---
+ icu4c/source/common/locmap.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp
+index cbb2b810a..6d62d8310 100644
+--- a/icu4c/source/common/locmap.cpp
++++ b/icu4c/source/common/locmap.cpp
+@@ -1015,7 +1015,7 @@ static const char*
+ getPosixID(const ILcidPosixMap *this_0, uint32_t hostID)
+ {
+ uint32_t i;
+- for (i = 0; i <= this_0->numRegions; i++)
++ for (i = 0; i < this_0->numRegions; i++)
+ {
+ if (this_0->regionMaps[i].hostID == hostID)
+ {
+--
+2.14.3
+
--------------erAck-patch-parts--

@ -16,7 +16,7 @@ index e01a267b..7237b6c 100644
XInitThreads();
#if GTK_CHECK_VERSION(3,0,0)
- if (gtk_minor_version < 14)
- if (gtk_minor_version < 18)
+ if (gtk_minor_version < 20)
{
g_warning("require a newer gtk than 3.%d for theme expectations", gtk_minor_version);

@ -1,48 +0,0 @@
From d01b115cb9db9200900f78d614d220b6bec1eb7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 20 Jul 2018 14:49:17 +0100
Subject: [PATCH] implement pdf export of underline for outlined font
just the simplest case of a straight solid line which is outlined,
i.e. border in font color and filled with white
Change-Id: I7d670a543475b6457cb2827e74a05bba6c4a91ea
---
vcl/source/gdi/pdfwriter_impl.cxx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 58711a9d862b..bf932ad17ef8 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7384,6 +7384,27 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon
if ( !nLineHeight )
return;
+ // outline attribute ?
+ if (m_aCurrentPDFState.m_aFont.IsOutline() && eTextLine == LINESTYLE_SINGLE)
+ {
+ appendStrokingColor(aColor, aLine); // stroke with text color
+ aLine.append( " " );
+ Color aNonStrokeColor(COL_WHITE); // fill with white
+ appendNonStrokingColor(aNonStrokeColor, aLine);
+ aLine.append( "\n" );
+ aLine.append( "0.25 w \n" ); // same line thickness as in drawLayout
+
+ // draw rectangle instead
+ aLine.append( "0 " );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(-nLinePos * 1.5), aLine );
+ aLine.append( " " );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(nWidth), aLine, false );
+ aLine.append( ' ' );
+ m_aPages.back().appendMappedLength( static_cast<sal_Int32>(nLineHeight), aLine );
+ aLine.append( " re h B\n" );
+ return;
+ }
+
m_aPages.back().appendMappedLength( (sal_Int32)nLineHeight, aLine );
aLine.append( " w " );
appendStrokingColor( aColor, aLine );
--
2.17.0

@ -1,946 +0,0 @@
From 44686bc81055c7bee7f41f9e219c35115ce8119f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 20 Dec 2017 15:29:39 +0000
Subject: [PATCH] request installation of langpack via packagekit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
if ui is set to track the locale automatically and the current locale
has no match in installed resources but has a match in the list of
languages that libreoffice was compiled to contain
so e.g. de_AT locale shouldn't trigger the installation of anything if
langpack-de is already installed and yue_HK shouldn't trigger install
of anything cause that not supported (at time of writing) for libreoffice
put Fedora/RHEL/Ubuntu naming schemes in here.
I moved the lang code from svl to svtools so I could use the restart dialog
to prompt to restart after the langpack is installed, but packagekit's blocking
mode seems to be no longer blocking and control returns immediately which is a
change since the last time I played with this stuff, so drop the restart thing
for now. The lack of a blocking modal also makes the "run this on idle when there's
a toplevel window up and running" a bit futile, but lets keep that for now anyway.
also...
set dbus id for existing DbusSessionHelper users
Change-Id: I64329e21ae79b6607856de9781bee0274b9cb136
Reviewed-on: https://gerrit.libreoffice.org/46854
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 7cf4eeed81fd333c87dedffa792f5d547b7981f0)
Change-Id: Ice731be539850338ccdd8af87839e0b4d83f01e7
---
config_host/config_langs.h.in | 10 ++
config_host/config_vendor.h.in | 10 ++
configure.ac | 4 +
cui/source/options/optgdlg.cxx | 3 +-
desktop/source/app/langselect.cxx | 3 +-
include/svl/languageoptions.hxx | 3 -
include/svtools/langhelp.hxx | 3 +
offapi/org/freedesktop/PackageKit/XModify.idl | 22 ++--
.../registry/data/org/openoffice/Office/Common.xcu | 3 +
.../schema/org/openoffice/Office/Common.xcs | 6 +
sfx2/source/appl/appserv.cxx | 3 +-
.../sessioninstall/SyncDbusSessionHelper.cxx | 57 +++++----
.../sessioninstall/SyncDbusSessionHelper.hxx | 20 ++--
svl/source/config/languageoptions.cxx | 33 ------
svtools/source/misc/langhelp.cxx | 130 ++++++++++++++++++++-
sw/source/uibase/app/apphdl.cxx | 3 +-
vcl/inc/unx/fontmanager.hxx | 6 +-
vcl/unx/generic/fontmanager/fontconfig.cxx | 93 ++-------------
vcl/unx/generic/fontmanager/fontmanager.cxx | 2 -
19 files changed, 235 insertions(+), 179 deletions(-)
create mode 100644 config_host/config_langs.h.in
create mode 100644 config_host/config_vendor.h.in
diff --git a/config_host/config_langs.h.in b/config_host/config_langs.h.in
new file mode 100644
index 0000000..d60a5c1
--- /dev/null
+++ b/config_host/config_langs.h.in
@@ -0,0 +1,10 @@
+/* Configuration of restriction on supported ui languages, by the
+ * --with-lang option.
+ */
+
+#ifndef CONFIG_LANGS_H
+#define CONFIG_LANGS_H
+
+#define WITH_LANG ""
+
+#endif
diff --git a/config_host/config_vendor.h.in b/config_host/config_vendor.h.in
new file mode 100644
index 0000000..3260221
--- /dev/null
+++ b/config_host/config_vendor.h.in
@@ -0,0 +1,10 @@
+/* Configuration of restriction on supported ui languages, by the
+ * --with-lang option.
+ */
+
+#ifndef CONFIG_VENDOR_H
+#define CONFIG_VENDOR_H
+
+#define OOO_VENDOR ""
+
+#endif
diff --git a/configure.ac b/configure.ac
index bbb47e6..55e2aa0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11777,6 +11777,7 @@ if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
ALL_LANGS=`echo $ALL_LANGS qtz`
fi
AC_SUBST(ALL_LANGS)
+AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
AC_SUBST(WITH_LANG)
AC_SUBST(WITH_LANG_LIST)
AC_SUBST(GIT_NEEDED_SUBMODULES)
@@ -11925,6 +11926,7 @@ else
OOO_VENDOR="$with_vendor"
AC_MSG_RESULT([$OOO_VENDOR])
fi
+AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
AC_SUBST(OOO_VENDOR)
if test "$_os" = "Android" ; then
@@ -12538,6 +12540,7 @@ AC_CONFIG_HEADERS([config_host/config_gio.h])
AC_CONFIG_HEADERS([config_host/config_global.h])
AC_CONFIG_HEADERS([config_host/config_gpgme.h])
AC_CONFIG_HEADERS([config_host/config_java.h])
+AC_CONFIG_HEADERS([config_host/config_langs.h])
AC_CONFIG_HEADERS([config_host/config_lgpl.h])
AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
AC_CONFIG_HEADERS([config_host/config_locales.h])
@@ -12549,6 +12552,7 @@ AC_CONFIG_HEADERS([config_host/config_options.h])
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
AC_CONFIG_HEADERS([config_host/config_test.h])
AC_CONFIG_HEADERS([config_host/config_typesizes.h])
+AC_CONFIG_HEADERS([config_host/config_vendor.h])
AC_CONFIG_HEADERS([config_host/config_vcl.h])
AC_CONFIG_HEADERS([config_host/config_vclplug.h])
AC_CONFIG_HEADERS([config_host/config_version.h])
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 1c90931..7965179 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -21,6 +21,7 @@
#include <svl/zforlist.hxx>
#include <svl/currencytable.hxx>
#include <svtools/grfmgr.hxx>
+#include <svtools/langhelp.hxx>
#include <svl/flagitem.hxx>
#include <sfx2/dispatch.hxx>
#include <unotools/lingucfg.hxx>
@@ -1122,7 +1123,7 @@ namespace
LanguageTag GetInstalledLocaleForSystemUILanguage()
{
css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
- return LanguageTag(getInstalledLocaleForSystemUILanguage(inst)).makeFallback();
+ return LanguageTag(getInstalledLocaleForSystemUILanguage(inst, false)).makeFallback();
}
}
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 4ce877a..86ce743 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -37,6 +37,7 @@
#include <sal/log.hxx>
#include <sal/types.h>
#include <svl/languageoptions.hxx>
+#include <svtools/langhelp.hxx>
#include <app.hxx>
@@ -103,7 +104,7 @@ bool prepareLocale() {
}
}
if (locale.isEmpty()) {
- locale = getInstalledLocaleForSystemUILanguage(inst);
+ locale = getInstalledLocaleForSystemUILanguage(inst, true);
}
if (locale.isEmpty()) {
return false;
diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx
index f386cb6..6de8eb5 100644
--- a/include/svl/languageoptions.hxx
+++ b/include/svl/languageoptions.hxx
@@ -131,9 +131,6 @@ public:
bool isCJKKeyboardLayoutInstalled() const;
};
-OUString SVL_DLLPUBLIC getInstalledLocaleForLanguage(css::uno::Sequence<OUString> const & installed, OUString const & locale);
-OUString SVL_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence<OUString> const & installed);
-
#endif // INCLUDED_SVL_LANGUAGEOPTIONS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/langhelp.hxx b/include/svtools/langhelp.hxx
index a3a84df..db22bb3 100644
--- a/include/svtools/langhelp.hxx
+++ b/include/svtools/langhelp.hxx
@@ -22,6 +22,9 @@
*/
SVT_DLLPUBLIC void localizeWebserviceURI( OUString& io_rURI );
+OUString SVT_DLLPUBLIC getInstalledLocaleForLanguage(css::uno::Sequence<OUString> const & installed, OUString const & locale);
+OUString SVT_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence<OUString> const & installed, bool bRequestInstallIfMissing);
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/org/freedesktop/PackageKit/XModify.idl b/offapi/org/freedesktop/PackageKit/XModify.idl
index a712bb5..69544e9 100644
--- a/offapi/org/freedesktop/PackageKit/XModify.idl
+++ b/offapi/org/freedesktop/PackageKit/XModify.idl
@@ -22,7 +22,7 @@ module PackageKit
* The interface used for modifying the package database.
*
* @sa
- * https://git.gnome.org/browse/gnome-software/tree/src/org.freedesktop.PackageKit.xml
+ * https://git.gnome.org/browse/gnome-software/tree/src/org.freedesktop.PackageKit.Modify2.xml
* for documentation of the corresponding D-Bus interface
*/
interface XModify : com::sun::star::uno::XInterface
@@ -32,70 +32,70 @@ interface XModify : com::sun::star::uno::XInterface
* @since LibreOffice 4.0
*/
- void InstallPackageFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
+ void InstallPackageFiles([in] sequence< string > files, [in] string interaction);
/**
* Installs sequence< string > packages to provide sequence< string > files.
* @since LibreOffice 4.0
*/
- void InstallProvideFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
+ void InstallProvideFiles([in] sequence< string > files, [in] string interaction);
/**
* Installs sequence< string > packages to provide sequence< string > files.
* @since LibreOffice 4.0
*/
- void InstallCatalogs( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
+ void InstallCatalogs([in] sequence< string > files, [in] string interaction);
/**
* Installs sequence< string > packages from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallPackageNames( [in] unsigned long xid, [in] sequence< string > packages, [in] string interaction);
+ void InstallPackageNames([in] sequence< string > packages, [in] string interaction);
/**
* Installs mimetype handlers from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallMimeTypes( [in] unsigned long xid, [in] sequence< string > mimeTypes, [in] string interaction);
+ void InstallMimeTypes([in] sequence< string > mimeTypes, [in] string interaction);
/**
* Installs fontconfig resources ( [in] usually fonts) from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallFontconfigResources( [in] unsigned long xid, [in] sequence< string > resources, [in] string interaction);
+ void InstallFontconfigResources([in] sequence< string > resources, [in] string interaction);
/**
* Installs GStreamer resources ( [in] usually codecs) from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallGStreamerResources( [in] unsigned long xid, [in] sequence< string > resources, [in] string interaction);
+ void InstallGStreamerResources([in] sequence< string > resources, [in] string interaction);
/**
* Installs resources of a given type from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallResources( [in] unsigned long xid, [in] sequence< string > types, [in] sequence< string > resources, [in] string interaction);
+ void InstallResources([in] sequence< string > types, [in] sequence< string > resources, [in] string interaction);
/**
* Removes sequence< string > packages that provide the given local sequence< string > files.
* @since LibreOffice 4.0
*/
- void RemovePackageByFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
+ void RemovePackageByFiles([in] sequence< string > files, [in] string interaction);
/**
* Installs printer drivers from a configured software source.
* @since LibreOffice 4.0
*/
- void InstallPrinterDrivers( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
+ void InstallPrinterDrivers([in] sequence< string > files, [in] string interaction);
};
} ; // PackageKit
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 6b94ff9..26d1ba0 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -535,6 +535,9 @@
<prop oor:name="EnableFontInstallation" oor:type="xs:boolean">
<value install:module="unx">true</value>
</prop>
+ <prop oor:name="EnableLangpackInstallation" oor:type="xs:boolean">
+ <value install:module="unx">true</value>
+ </prop>
</node>
<node oor:name="Classification">
<prop oor:name="Policy" oor:type="xs:short">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index f9816fc..2884179 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6382,6 +6382,12 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="EnableLangpackInstallation" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Specifies if missing langpack installation should be triggered.</desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="Classification">
<info>
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 1e2a2ec..e48e5aa 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -59,6 +59,7 @@
#include <unotools/configmgr.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/layout.hxx>
+#include <vcl/sysdata.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
@@ -196,7 +197,7 @@ namespace
using namespace svtools;
Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
Sequence< OUString > vPackages { "libreoffice-base" };
- xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, OUString());
+ xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
// Ill be back (hopefully)!
SolarMutexGuard aGuard;
executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_BIBLIOGRAPHY_INSTALL);
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index a1211f7..1938077 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -18,7 +18,7 @@ using namespace ::com::sun::star::uno;
namespace
{
- struct GVariantDeleter { void operator()(GVariant* pV) { g_variant_unref(pV); } };
+ struct GVariantDeleter { void operator()(GVariant* pV) { if (pV) g_variant_unref(pV); } };
struct GVariantBuilderDeleter { void operator()(GVariantBuilder* pVB) { g_variant_builder_unref(pVB); } };
template <typename T> struct GObjectDeleter { void operator()(T* pO) { g_object_unref(pO); } };
class GErrorWrapper
@@ -55,8 +55,15 @@ namespace
return proxy;
}
+ static GVariant* pk_make_platform_data()
+ {
+ GVariantBuilder builder;
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
+ return g_variant_builder_end(&builder);
+ }
+
void request(
- char const * method, sal_uInt32 xid,
+ char const * method,
css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
@@ -70,14 +77,14 @@ void request(
}
auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8));
std::shared_ptr<GDBusProxy> proxy(
- lcl_GetPackageKitProxy("Modify"), GObjectDeleter<GDBusProxy>());
+ lcl_GetPackageKitProxy("Modify2"), GObjectDeleter<GDBusProxy>());
GErrorWrapper error;
- g_dbus_proxy_call_sync(
+ std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync(
proxy.get(), method,
g_variant_new(
- "(uass)", static_cast<guint32>(xid), builder.get(),
- iactUtf8.getStr()),
- G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef());
+ "(asss@a{sv})", builder.get(), iactUtf8.getStr(),
+ "libreoffice-startcenter.desktop", pk_make_platform_data()),
+ G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef()), GVariantDeleter());
}
}
@@ -92,66 +99,66 @@ namespace shell { namespace sessioninstall
}
void SyncDbusSessionHelper::InstallPackageFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallPackageFiles", xid, files, interaction);
+ request("InstallPackageFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallProvideFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallProvideFiles", xid, files, interaction);
+ request("InstallProvideFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallCatalogs(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallCatalogs", xid, files, interaction);
+ request("InstallCatalogs", files, interaction);
}
void SyncDbusSessionHelper::InstallPackageNames(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & packages,
+ css::uno::Sequence<OUString> const & packages,
OUString const & interaction)
{
- request("InstallPackageNames", xid, packages, interaction);
+ request("InstallPackageNames", packages, interaction);
}
void SyncDbusSessionHelper::InstallMimeTypes(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & mimeTypes,
+ css::uno::Sequence<OUString> const & mimeTypes,
OUString const & interaction)
{
- request("InstallMimeTypes", xid, mimeTypes, interaction);
+ request("InstallMimeTypes", mimeTypes, interaction);
}
void SyncDbusSessionHelper::InstallFontconfigResources(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & resources,
+ css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
- request("InstallFontconfigResources", xid, resources, interaction);
+ request("InstallFontconfigResources", resources, interaction);
}
void SyncDbusSessionHelper::InstallGStreamerResources(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & resources,
+ css::uno::Sequence<OUString> const & resources,
OUString const & interaction)
{
- request("InstallGStreamerResources", xid, resources, interaction);
+ request("InstallGStreamerResources", resources, interaction);
}
void SyncDbusSessionHelper::RemovePackageByFiles(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("RemovePackageByFiles", xid, files, interaction);
+ request("RemovePackageByFiles", files, interaction);
}
void SyncDbusSessionHelper::InstallPrinterDrivers(
- sal_uInt32 xid, css::uno::Sequence<OUString> const & files,
+ css::uno::Sequence<OUString> const & files,
OUString const & interaction)
{
- request("InstallPrinteDrivers", xid, files, interaction);
+ request("InstallPrinteDrivers", files, interaction);
}
void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled )
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
index 731b649..72b17ba 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
@@ -23,26 +23,26 @@ namespace shell { namespace sessioninstall
SyncDbusSessionHelper(css::uno::Reference< css::uno::XComponentContext> const&);
// XModify Methods
- virtual void SAL_CALL InstallPackageFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPackageFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallProvideFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallProvideFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallCatalogs( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallCatalogs( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallPackageNames( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPackageNames( const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
- virtual void SAL_CALL InstallMimeTypes( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallMimeTypes( const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
- virtual void SAL_CALL InstallFontconfigResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallFontconfigResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
- virtual void SAL_CALL InstallGStreamerResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallGStreamerResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
- virtual void SAL_CALL InstallResources( ::sal_uInt32 /* xid */, const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
+ virtual void SAL_CALL InstallResources( const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
{ throw css::uno::RuntimeException(); } // not implemented
- virtual void SAL_CALL RemovePackageByFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL RemovePackageByFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
- virtual void SAL_CALL InstallPrinterDrivers( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+ virtual void SAL_CALL InstallPrinterDrivers( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
// XQuery Methods
virtual void SAL_CALL IsInstalled( const OUString& /* package_name */, const OUString& /* interaction */, sal_Bool& /* installed */ ) override;
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index 9f9fe45..74af031 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -27,7 +27,6 @@
#include <rtl/instance.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <unotools/syslocale.hxx>
-#include <officecfg/System.hxx>
#ifdef _WIN32
#if !defined WIN32_LEAN_AND_MEAN
@@ -256,41 +255,9 @@ bool SvtSystemLanguageOptions::isKeyboardLayoutTypeInstalled(sal_Int16 scriptTyp
return isInstalled;
}
-
bool SvtSystemLanguageOptions::isCJKKeyboardLayoutInstalled() const
{
return isKeyboardLayoutTypeInstalled(css::i18n::ScriptType::ASIAN);
}
-OUString getInstalledLocaleForLanguage(css::uno::Sequence<OUString> const & installed, OUString const & locale)
-{
- if (locale.isEmpty())
- return OUString(); // do not attempt to resolve anything
-
- for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
- if (installed[i] == locale) {
- return installed[i];
- }
- }
- std::vector<OUString> fallbacks(LanguageTag(locale).getFallbackStrings(false));
- for (OUString & rf : fallbacks) {
- for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
- if (installed[i] == rf) {
- return installed[i];
- }
- }
- }
- return OUString();
-}
-
-OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence<OUString>& rLocaleElementNames)
-{
- OUString locale = getInstalledLocaleForLanguage(rLocaleElementNames, officecfg::System::L10N::UILocale::get());
- if (locale.isEmpty())
- locale = getInstalledLocaleForLanguage(rLocaleElementNames, "en-US");
- if (locale.isEmpty() && rLocaleElementNames.hasElements())
- locale = rLocaleElementNames[0];
- return locale;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx
index 16a3a1d..1e4c5c5 100644
--- a/svtools/source/misc/langhelp.cxx
+++ b/svtools/source/misc/langhelp.cxx
@@ -7,12 +7,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-
+#include <comphelper/sequence.hxx>
+#include <i18nlangtag/mslangid.hxx>
+#include <officecfg/Office/Common.hxx>
+#include <officecfg/System.hxx>
+#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
+#include <rtl/ustring.hxx>
#include <svtools/langhelp.hxx>
-
+#include <vcl/idle.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/sysdata.hxx>
#include <vcl/settings.hxx>
-#include <rtl/ustring.hxx>
+#include <vcl/window.hxx>
+#include <config_langs.h>
+#include <config_vendor.h>
void localizeWebserviceURI( OUString& rURI )
{
@@ -33,4 +41,120 @@ void localizeWebserviceURI( OUString& rURI )
rURI += aLang;
}
+OUString getInstalledLocaleForLanguage(css::uno::Sequence<OUString> const & installed, OUString const & locale)
+{
+ if (locale.isEmpty())
+ return OUString(); // do not attempt to resolve anything
+
+ for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
+ if (installed[i] == locale) {
+ return installed[i];
+ }
+ }
+ std::vector<OUString> fallbacks(LanguageTag(locale).getFallbackStrings(false));
+ for (OUString & rf : fallbacks) {
+ for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
+ if (installed[i] == rf) {
+ return installed[i];
+ }
+ }
+ }
+ return OUString();
+}
+
+static std::unique_ptr<Idle> xLangpackInstaller;
+
+class InstallLangpack : public Idle
+{
+ std::vector<OUString> m_aPackages;
+public:
+ explicit InstallLangpack(const std::vector<OUString>& rPackages)
+ : Idle("install langpack")
+ , m_aPackages(rPackages)
+ {
+ SetPriority(TaskPriority::LOWEST);
+ }
+
+ virtual void Invoke() override
+ {
+ vcl::Window* pTopWindow = Application::GetActiveTopWindow();
+ if (!pTopWindow)
+ pTopWindow = Application::GetFirstTopLevelWindow();
+ if (!pTopWindow)
+ {
+ Start();
+ return;
+ }
+ try
+ {
+ using namespace org::freedesktop::PackageKit;
+ css::uno::Reference<XSyncDbusSessionHelper> xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
+ xSyncDbusSessionHelper->InstallPackageNames(comphelper::containerToSequence(m_aPackages), OUString());
+ }
+ catch (const css::uno::Exception& e)
+ {
+ SAL_INFO("svl", "trying to install a LibreOffice langpack, caught " << e);
+ }
+ xLangpackInstaller.reset();
+ }
+};
+
+OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence<OUString>& rLocaleElementNames, bool bRequestInstallIfMissing)
+{
+ OUString wantedLocale = officecfg::System::L10N::UILocale::get();
+ OUString locale = getInstalledLocaleForLanguage(rLocaleElementNames, wantedLocale);
+ if (bRequestInstallIfMissing && locale.isEmpty() && !wantedLocale.isEmpty() && !Application::IsHeadlessModeEnabled() &&
+ officecfg::Office::Common::PackageKit::EnableLangpackInstallation::get())
+ {
+ LanguageTag aWantedTag(wantedLocale);
+ if (aWantedTag.getLanguage() != "en")
+ {
+ // We try these bases + the exact locale + fallback locale.
+ //
+ // The theory is that we can request a bunch of packages
+ // and it's a success if one of them is available
+ std::vector<OUString> aPackages;
+ OUString sAvailableLocales(WITH_LANG);
+ std::vector<OUString> aAvailable;
+ sal_Int32 nIndex = 0;
+ do
+ {
+ aAvailable.emplace_back(sAvailableLocales.getToken(0, ' ', nIndex));
+ }
+ while (nIndex >= 0);
+ OUString install = getInstalledLocaleForLanguage(comphelper::containerToSequence(aAvailable), wantedLocale);
+ if (!install.isEmpty() && install != "en-US")
+ {
+ if (strcmp(OOO_VENDOR, "Red Hat, Inc.") == 0 || strcmp(OOO_VENDOR, "The Fedora Project") == 0)
+ {
+ // langpack is the typical Fedora/RHEL naming convention
+ LanguageType eType = aWantedTag.getLanguageType();
+ if (MsLangId::isSimplifiedChinese(eType))
+ aPackages.emplace_back("libreoffice-langpack-zh-Hans");
+ else if (MsLangId::isTraditionalChinese(eType))
+ aPackages.emplace_back("libreoffice-langpack-zh-Hant");
+ else
+ aPackages.emplace_back("libreoffice-langpack-" + install);
+ }
+ //Debian would be: "The Document Foundation/Debian"
+ else if (strcmp(OOO_VENDOR, "The Document Foundation, Debian and Ubuntu") == 0)
+ {
+ // l10n is the typical Debian/Ubuntu naming convention
+ aPackages.emplace_back("libreoffice-l10n-" + install);
+ }
+ }
+ if (!aPackages.empty())
+ {
+ xLangpackInstaller.reset(new InstallLangpack(aPackages));
+ xLangpackInstaller->Start();
+ }
+ }
+ }
+ if (locale.isEmpty())
+ locale = getInstalledLocaleForLanguage(rLocaleElementNames, "en-US");
+ if (locale.isEmpty() && rLocaleElementNames.hasElements())
+ locale = rLocaleElementNames[0];
+ return locale;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 467112e..6986807 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -44,6 +44,7 @@
#include <svl/ctloptions.hxx>
#include <unotools/useroptions.hxx>
#include <vcl/msgbox.hxx>
+#include <vcl/sysdata.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/insctrl.hxx>
#include <svx/selctrl.hxx>
@@ -420,7 +421,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs
using namespace svtools;
css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" };
- xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, OUString());
+ xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
SolarMutexGuard aGuard;
executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL);
}
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 03d033e..14aebde 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -192,14 +192,10 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
static void addFontconfigDir(const OString& rDirectory);
std::set<OString> m_aPreviousLangSupportRequests;
-#if ENABLE_GIO
- std::vector<OString> m_aCurrentRequests;
-#endif
+ std::vector<OUString> m_aCurrentRequests;
Timer m_aFontInstallerTimer;
-#if ENABLE_GIO
DECL_LINK( autoInstallFontLangSupport, Timer*, void );
-#endif
PrintFontManager();
public:
~PrintFontManager();
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 2c16e04..59acfa5 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -20,6 +20,7 @@
#include <memory>
#include <unx/fontmanager.hxx>
#include <impfont.hxx>
+#include <comphelper/sequence.hxx>
#include <vcl/svapp.hxx>
#include <vcl/sysdata.hxx>
#include <vcl/vclenum.hxx>
@@ -31,8 +32,8 @@
#include <rtl/strbuf.hxx>
#include <unicode/uchar.h>
#include <unicode/uscript.h>
-#include <config_gio.h>
#include <officecfg/Office/Common.hxx>
+#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
using namespace psp;
@@ -40,10 +41,6 @@ using namespace psp;
#include <ft2build.h>
#include <fontconfig/fcfreetype.h>
-#if ENABLE_GIO
-#include <gio/gio.h>
-#endif
-
#include <cstdio>
#include <cstdarg>
@@ -862,96 +859,28 @@ namespace
aBuf.append('-').append(pScriptCode);
return OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
}
-
-#if ENABLE_GIO
- guint get_xid_for_dbus()
- {
- // FIXME: Application::GetActiveTopWindow only returns something sensible if LO currently has the focus
- // (which is not the case when you are trying to debug this...). It should instead return the last active window.
- const vcl::Window *pTopWindow = Application::IsHeadlessModeEnabled() ? nullptr : Application::GetActiveTopWindow();
- const SystemEnvData* pEnvData = pTopWindow ? pTopWindow->GetSystemData() : nullptr;
- return pEnvData ? pEnvData->aWindow : 0;
- }
-#endif
}
-#if ENABLE_GIO
IMPL_LINK_NOARG(PrintFontManager, autoInstallFontLangSupport, Timer *, void)
{
- if (!officecfg::Office::Common::PackageKit::EnableFontInstallation::get())
- return;
-
- guint xid = get_xid_for_dbus();
-
- if (!xid)
+ try
{
- SAL_WARN("vcl", "Could not retrieve X Window ID for DBUS");
- return;
+ using namespace org::freedesktop::PackageKit;
+ css::uno::Reference<XSyncDbusSessionHelper> xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
+ xSyncDbusSessionHelper->InstallFontconfigResources(comphelper::containerToSequence(m_aCurrentRequests), "hide-finished");
}
-
-
- GError *error = nullptr;
- /* get the DBUS session connection */
- GDBusConnection *session_connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
- if (error != nullptr)
- {
- g_debug ("DBUS cannot connect : %s", error->message);
- g_error_free (error);
- return;
- }
-
- /* get the proxy with gnome-session-manager */
- GDBusProxy *proxy = g_dbus_proxy_new_sync(session_connection,
- G_DBUS_PROXY_FLAGS_NONE,
- nullptr, // GDBusInterfaceInfo
- "org.freedesktop.PackageKit",
- "/org/freedesktop/PackageKit",
- "org.freedesktop.PackageKit.Modify",
- nullptr, // GCancellable
- &error);
- if (proxy == nullptr && error != nullptr)
- {
- g_debug("Could not get DBUS proxy: org.freedesktop.PackageKit: %s", error->message);
- g_error_free(error);
- return;
- }
-
- GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE("as")); // 'as'=array of strings
- for (std::vector<OString>::const_iterator aI = m_aCurrentRequests.begin(); aI != m_aCurrentRequests.end(); ++aI)
- g_variant_builder_add (builder, "s", aI->getStr());
-
- GVariant *res = g_dbus_proxy_call_sync(proxy,
- "InstallFontconfigResources",
- // Create a new variant with the following types:
- // 'u'=guint32 (xid); 'as'=array of strings (builder); 's'=string ("hide-finished")
- // See also https://people.gnome.org/~ryanl/glib-docs/gvariant-format-strings.html
- g_variant_new("(uass)", xid, builder, "hide-finished"),
- G_DBUS_CALL_FLAGS_NONE,
- -1, // Timeout
- nullptr, // GCancellable
- &error);
-
- if (res == nullptr && error != nullptr)
+ catch (const css::uno::Exception& e)
{
+ SAL_INFO("vcl", "InstallFontconfigResources problem, caught " << e);
// Disable this method from now on. It's simply not available on some systems
// and leads to an error dialog being shown each time this is called tdf#104883
std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::Common::PackageKit::EnableFontInstallation::set(false, batch);
batch->commit();
- g_debug("InstallFontconfigResources problem : %s", error->message);
- g_error_free(error);
- }
- else
- {
- g_variant_unref(res);
}
- g_variant_builder_unref(builder);
- g_object_unref(G_OBJECT (proxy));
-
m_aCurrentRequests.clear();
}
-#endif
void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes )
{
@@ -1107,8 +1036,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
}
}
OUString sStillMissing(pRemainingCodes.get(), nRemainingLen);
-#if ENABLE_GIO
- if (get_xid_for_dbus())
+ if (!Application::IsHeadlessModeEnabled() && officecfg::Office::Common::PackageKit::EnableFontInstallation::get())
{
if (sStillMissing == rMissingCodes) //replaced nothing
{
@@ -1127,7 +1055,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
if (!sTag.isEmpty() && m_aPreviousLangSupportRequests.find(sTag) == m_aPreviousLangSupportRequests.end())
{
OString sReq = OString(":lang=") + sTag;
- m_aCurrentRequests.push_back(sReq);
+ m_aCurrentRequests.push_back(OUString::fromUtf8(sReq));
m_aPreviousLangSupportRequests.insert(sTag);
}
}
@@ -1138,7 +1066,6 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
m_aFontInstallerTimer.Start();
}
}
-#endif
rMissingCodes = sStillMissing;
}
}
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index c956345..d1743dd 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -146,10 +146,8 @@ PrintFontManager::PrintFontManager()
: m_nNextFontID( 1 )
, m_nNextDirAtom( 1 )
{
-#if ENABLE_GIO
m_aFontInstallerTimer.SetInvokeHandler(LINK(this, PrintFontManager, autoInstallFontLangSupport));
m_aFontInstallerTimer.SetTimeout(5000);
-#endif
}
PrintFontManager::~PrintFontManager()
--
2.9.5
Loading…
Cancel
Save