[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 10 commits - configure.ac cui/source download.lst drawinglayer/source i18npool/inc i18npool/source i18nutil/source lotuswordpro/source opencl/source package/source vcl/inc vcl/source xmlsecurity/qa

Eike Rathke erack at redhat.com
Mon Jul 2 08:53:17 UTC 2018


 configure.ac                                             |    2 
 cui/source/options/personalization.cxx                   |   14 +++-
 cui/source/options/personalization.hxx                   |    4 -
 download.lst                                             |    4 -
 drawinglayer/source/tools/emfphelperdata.cxx             |    9 ++
 i18npool/inc/collator_unicode.hxx                        |    2 
 i18npool/source/breakiterator/breakiterator_unicode.cxx  |   26 ++++----
 i18npool/source/collator/collator_unicode.cxx            |   16 ++---
 i18npool/source/collator/gencoll_rule.cxx                |    2 
 i18npool/source/ordinalsuffix/ordinalsuffix.cxx          |    2 
 i18npool/source/transliteration/ignoreDiacritics_CTL.cxx |    6 -
 i18nutil/source/utility/unicode.cxx                      |    8 +-
 lotuswordpro/source/filter/localtime.cxx                 |    2 
 opencl/source/openclconfig.cxx                           |    2 
 package/source/manifest/ManifestDefines.hxx              |    9 ++
 package/source/manifest/ManifestImport.cxx               |   48 +++++++++++++--
 package/source/manifest/ManifestImport.hxx               |   12 +++
 vcl/inc/scrptrun.h                                       |    2 
 vcl/source/window/status.cxx                             |    3 
 xmlsecurity/qa/unit/signing/data/encryptedGPG_odf13.odt  |binary
 xmlsecurity/qa/unit/signing/signing.cxx                  |    8 ++
 21 files changed, 134 insertions(+), 47 deletions(-)

New commits:
commit 511ee4354f33b9db5a741af7d56c001a3cb016b3
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 18 20:38:59 2017 +0100

    Explicitly qualify ICU types with icu:: namespace
    
    It will be required by ICU 61 anyway, see
    https://ssl.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
    
    Change-Id: If7f1330550981fd28eb7eea6329f21e116291cca
    Reviewed-on: https://gerrit.libreoffice.org/46740
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/56779
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 3aabc93b8a3f55eb0a3f9e413b124fd8deab7e47)

diff --git a/lotuswordpro/source/filter/localtime.cxx b/lotuswordpro/source/filter/localtime.cxx
index 47d202412724..3805c5d6f973 100644
--- a/lotuswordpro/source/filter/localtime.cxx
+++ b/lotuswordpro/source/filter/localtime.cxx
@@ -174,7 +174,7 @@ bool LtgLocalTime(long rtime,LtTm& rtm)
 
     if ((rtime > 3 * DAY_SEC)&&(rtime < LONG_MAX - 3 * DAY_SEC))
     {
-        TimeZone* pLocalZone = TimeZone::createDefault();
+        icu::TimeZone* pLocalZone = icu::TimeZone::createDefault();
         long offset = (pLocalZone->getRawOffset())/1000;
         delete pLocalZone;
         long ltime = rtime + offset;
commit 8714906f5430525027bcfb84b90eb5b80e512c8c
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Thu Jun 28 15:17:40 2018 +0200

    ODF1.3: import new OpenPGP encryption markup
    
    With OFFICE-3940 the loext markup got accepted for ODF1.3 (and
    the redundant KeyInfo element removed). Make sure manifest parser
    can import new markup.
    
    Change-Id: Id3c88654e8e6e0e256cd68fbb43f1ef670849cf7
    Reviewed-on: https://gerrit.libreoffice.org/56597
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit a7bf6488ebb544e1efaed0a1e53073df9cc2064d)
    Reviewed-on: https://gerrit.libreoffice.org/56678
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit dd9232a6b2bcd32c7279e1476445214c6bb9e417)

diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx
index c68c241c7514..44c0cb4c5254 100644
--- a/package/source/manifest/ManifestDefines.hxx
+++ b/package/source/manifest/ManifestDefines.hxx
@@ -46,6 +46,15 @@
 #define ATTRIBUTE_ALGORITHM "loext:PGPAlgorithm"
 #define ELEMENT_CIPHERDATA "loext:CipherData"
 #define ELEMENT_CIPHERVALUE "loext:CipherValue"
+#define ELEMENT_MANIFEST13_KEYINFO "manifest:keyinfo"
+#define ELEMENT_ENCRYPTEDKEY13 "manifest:encrypted-key"
+#define ELEMENT_ENCRYPTIONMETHOD13 "manifest:encryption-method"
+#define ELEMENT_PGPDATA13 "manifest:PGPData"
+#define ELEMENT_PGPKEYID13 "manifest:PGPKeyID"
+#define ELEMENT_PGPKEYPACKET13 "manifest:PGPKeyPacket"
+#define ATTRIBUTE_ALGORITHM13 "manifest:PGPAlgorithm"
+#define ELEMENT_CIPHERDATA13 "manifest:CipherData"
+#define ELEMENT_CIPHERVALUE13 "manifest:CipherValue"
 
 #define ELEMENT_ENCRYPTION_DATA "manifest:encryption-data"
 #define ATTRIBUTE_CHECKSUM_TYPE "manifest:checksum-type"
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 98a9d61128b5..fda529838214 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -69,6 +69,16 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV
     , sCipherDataElement            ( ELEMENT_CIPHERDATA )
     , sCipherValueElement           ( ELEMENT_CIPHERVALUE )
 
+    , sManifestKeyInfoElement13       ( ELEMENT_MANIFEST13_KEYINFO )
+    , sEncryptedKeyElement13          ( ELEMENT_ENCRYPTEDKEY13 )
+    , sEncryptionMethodElement13      ( ELEMENT_ENCRYPTIONMETHOD13 )
+    , sPgpDataElement13               ( ELEMENT_PGPDATA13 )
+    , sPgpKeyIDElement13              ( ELEMENT_PGPKEYID13 )
+    , sPGPKeyPacketElement13          ( ELEMENT_PGPKEYPACKET13 )
+    , sAlgorithmAttribute13           ( ATTRIBUTE_ALGORITHM13 )
+    , sCipherDataElement13            ( ELEMENT_CIPHERDATA13 )
+    , sCipherValueElement13           ( ELEMENT_CIPHERVALUE13 )
+
     , sFullPathProperty             ( "FullPath" )
     , sMediaTypeProperty            ( "MediaType" )
     , sVersionProperty              ( "Version" )
@@ -148,9 +158,10 @@ void ManifestImport::doEncryptedKey(StringHashMap &)
     aKeyInfoSequence.resize(3);
 }
 
-void ManifestImport::doEncryptionMethod(StringHashMap &rConvertedAttribs)
+void ManifestImport::doEncryptionMethod(StringHashMap &rConvertedAttribs,
+                                        const OUString& rAlgoAttrName)
 {
-    OUString aString = rConvertedAttribs[sAlgorithmAttribute];
+    OUString aString = rConvertedAttribs[rAlgoAttrName];
     if ( aKeyInfoSequence.size() != 3
          || aString != "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" )
     {
@@ -339,7 +350,9 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re
     case 2: {
         if (aConvertedName == sFileEntryElement) //manifest:file-entry
             doFileEntry(aConvertedAttribs);
-        else if (aConvertedName == sManifestKeyInfoElement) //loext:KeyInfo
+        else if (aConvertedName == sManifestKeyInfoElement) //loext:keyinfo
+            doKeyInfoEntry(aConvertedAttribs);
+        else if (aConvertedName == sManifestKeyInfoElement13) //manifest:keyinfo
             doKeyInfoEntry(aConvertedAttribs);
         else
             aStack.back().m_bValid = false;
@@ -355,6 +368,8 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re
             doEncryptionData(aConvertedAttribs);
         else if (aConvertedName == sEncryptedKeyElement)   //loext:encrypted-key
             doEncryptedKey(aConvertedAttribs);
+        else if (aConvertedName == sEncryptedKeyElement13)   //manifest:encrypted-key
+            doEncryptedKey(aConvertedAttribs);
         else
             aStack.back().m_bValid = false;
         break;
@@ -372,11 +387,17 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re
         else if (aConvertedName == sStartKeyAlgElement)   //manifest:start-key-generation
             doStartKeyAlg(aConvertedAttribs);
         else if (aConvertedName == sEncryptionMethodElement)   //loext:encryption-method
-            doEncryptionMethod(aConvertedAttribs);
+            doEncryptionMethod(aConvertedAttribs, sAlgorithmAttribute);
+        else if (aConvertedName == sEncryptionMethodElement13)   //manifest:encryption-method
+            doEncryptionMethod(aConvertedAttribs, sAlgorithmAttribute13);
         else if (aConvertedName == sKeyInfoElement)            //loext:KeyInfo
             doEncryptedKeyInfo(aConvertedAttribs);
         else if (aConvertedName == sCipherDataElement)            //loext:CipherData
             doEncryptedCipherData(aConvertedAttribs);
+        else if (aConvertedName == sCipherDataElement13)            //manifest:CipherData
+            doEncryptedCipherData(aConvertedAttribs);
+        else if (aConvertedName == sPgpDataElement13)   //manifest:PGPData
+            doEncryptedPgpData(aConvertedAttribs);
         else
             aStack.back().m_bValid = false;
         break;
@@ -392,6 +413,15 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re
         else if (aConvertedName == sCipherValueElement) //loext:CipherValue
             // ciphervalue action happens on endElement
             aCurrentCharacters = "";
+        else if (aConvertedName == sCipherValueElement13) //manifest:CipherValue
+            // ciphervalue action happens on endElement
+            aCurrentCharacters = "";
+        else if (aConvertedName == sPgpKeyIDElement13)   //manifest:PGPKeyID
+            // ciphervalue action happens on endElement
+            aCurrentCharacters = "";
+        else if (aConvertedName == sPGPKeyPacketElement13) //manifest:PGPKeyPacket
+            // ciphervalue action happens on endElement
+            aCurrentCharacters = "";
         else
             aStack.back().m_bValid = false;
         break;
@@ -450,7 +480,9 @@ void SAL_CALL ManifestImport::endElement( const OUString& aName )
 
             aSequence.clear();
         }
-        else if ( aConvertedName == sEncryptedKeyElement && aStack.back().m_bValid ) {
+        else if ( (aConvertedName == sEncryptedKeyElement
+                   || aConvertedName == sEncryptedKeyElement13)
+                  && aStack.back().m_bValid ) {
             if ( !bIgnoreEncryptData )
             {
                 aKeys.push_back( comphelper::containerToSequence(aKeyInfoSequence) );
@@ -464,6 +496,12 @@ void SAL_CALL ManifestImport::endElement( const OUString& aName )
             case 5: {
                 if (aConvertedName == sCipherValueElement) //loext:CipherValue
                     doEncryptedCipherValue();
+                else if (aConvertedName == sCipherValueElement13) //manifest:CipherValue
+                    doEncryptedCipherValue();
+                else if (aConvertedName == sPgpKeyIDElement13)   //manifest:PGPKeyID
+                    doEncryptedKeyId();
+                else if (aConvertedName == sPGPKeyPacketElement13) //manifest:PGPKeyPacket
+                    doEncryptedKeyPacket();
                 else
                     aStack.back().m_bValid = false;
                 break;
diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx
index 26f692be9c5b..6661dc70b4e6 100644
--- a/package/source/manifest/ManifestImport.hxx
+++ b/package/source/manifest/ManifestImport.hxx
@@ -92,6 +92,16 @@ class ManifestImport final : public cppu::WeakImplHelper < css::xml::sax::XDocum
     const OUString sCipherDataElement;
     const OUString sCipherValueElement;
 
+    const OUString sManifestKeyInfoElement13;
+    const OUString sEncryptedKeyElement13;
+    const OUString sEncryptionMethodElement13;
+    const OUString sPgpDataElement13;
+    const OUString sPgpKeyIDElement13;
+    const OUString sPGPKeyPacketElement13;
+    const OUString sAlgorithmAttribute13;
+    const OUString sCipherDataElement13;
+    const OUString sCipherValueElement13;
+
     const OUString sFullPathProperty;
     const OUString sMediaTypeProperty;
     const OUString sVersionProperty;
@@ -154,7 +164,7 @@ private:
     void doStartKeyAlg(StringHashMap &rConvertedAttribs);
     void doKeyInfoEntry(StringHashMap &);
     void doEncryptedKey(StringHashMap &);
-    void doEncryptionMethod(StringHashMap &);
+    void doEncryptionMethod(StringHashMap &, const OUString &);
     void doEncryptedKeyInfo(StringHashMap &);
     void doEncryptedCipherData(StringHashMap &);
     void doEncryptedPgpData(StringHashMap &);
diff --git a/xmlsecurity/qa/unit/signing/data/encryptedGPG_odf13.odt b/xmlsecurity/qa/unit/signing/data/encryptedGPG_odf13.odt
new file mode 100644
index 000000000000..6bcc43503267
Binary files /dev/null and b/xmlsecurity/qa/unit/signing/data/encryptedGPG_odf13.odt differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index b7cc077d2097..265f0e5acbb0 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -751,11 +751,19 @@ void SigningTest::testODFBrokenDsigGPG()
 
 void SigningTest::testODFEncryptedGPG()
 {
+    // ODF1.2 + loext flavour
     createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY) + "encryptedGPG.odt");
     SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
     CPPUNIT_ASSERT(pBaseModel);
     SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
     CPPUNIT_ASSERT(pObjectShell);
+
+    // ODF1.3 flavour
+    createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY) + "encryptedGPG_odf13.odt");
+    pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+    CPPUNIT_ASSERT(pBaseModel);
+    pObjectShell = pBaseModel->GetObjectShell();
+    CPPUNIT_ASSERT(pObjectShell);
 }
 
 #endif
commit 3365c2b69d3500d5e9ce0967ec8479a453609d91
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Dec 19 15:22:09 2017 +0100

    vcl: explicitly qualify ICU types with icu:: namespace
    
    It will be required by ICU 61 anyway, see
    https://ssl.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
    
    Change-Id: Iecb30b903e9a67252147a8cc78c641621d763755
    (cherry picked from commit f240332f8e965ea17b70b0ccaa9990ce0a53cfc6)
    Reviewed-on: https://gerrit.libreoffice.org/56735
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 4d06789a836f1a271399cd9955b2cb96030f393a)

diff --git a/vcl/inc/scrptrun.h b/vcl/inc/scrptrun.h
index cbe151df491d..46a5c08f3ab5 100644
--- a/vcl/inc/scrptrun.h
+++ b/vcl/inc/scrptrun.h
@@ -58,7 +58,7 @@ struct ParenStackEntry
     }
 };
 
-class ScriptRun : public UObject {
+class ScriptRun : public icu::UObject {
 public:
 
     ScriptRun(const UChar chars[], int32_t length);
commit c4d7e5c0e7e6fba96749698f71df0cdae0e22007
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 18 20:33:03 2017 +0100

    Explicitly qualify ICU types with icu:: namespace
    
    It will be required by ICU 61 anyway, see
    https://ssl.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
    
    Change-Id: Ia051e8e2aa64b0e32a7f16a2afebaef0e4ebf531
    Reviewed-on: https://gerrit.libreoffice.org/46739
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit ad3b7c27cdc957a8a38876c040e86a81c3cf7003)
    Reviewed-on: https://gerrit.libreoffice.org/56713
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 63ebde2117d768c974252db9c4d9cce1ef4334c6)

diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 0173a4ad5fbf..697875b193e3 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -750,15 +750,15 @@ OUString SAL_CALL unicode::formatPercent(double dNumber,
 
     icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag);
 
-    std::unique_ptr<NumberFormat> xF(
-        NumberFormat::createPercentInstance(aLocale, errorCode));
+    std::unique_ptr<icu::NumberFormat> xF(
+        icu::NumberFormat::createPercentInstance(aLocale, errorCode));
     if(U_FAILURE(errorCode))
     {
-        SAL_WARN("i18n", "NumberFormat::createPercentInstance failed");
+        SAL_WARN("i18n", "icu::NumberFormat::createPercentInstance failed");
         return OUString::number(dNumber) + "%";
     }
 
-    UnicodeString output;
+    icu::UnicodeString output;
     xF->format(dNumber/100, output);
     OUString aRet(reinterpret_cast<const sal_Unicode *>(output.getBuffer()),
         output.length());
commit 2503484a87a6f7e8ca2df25511eb046cd682166c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Jun 4 16:28:22 2018 +0200

    tdf#117866 cui: avoid deadlock in personalization dialog
    
    The deadlock happened as the main thread wanted to join
    SearchAndParseThread (while owning the solar mutex), but
    SearchAndParseThread wanted to take the solar mutex to import a graphic.
    
    Fix the deadlock by checking for the termination flag earlier, so we
    don't take any new mutexes if termination was requested already.
    
    (cherry picked from commit 766c85a4f67f5d50645340e31cebd5956998c6fc)
    
    Related: tdf#117866 cui: use std::atomic for thread termination flag
    
    (cherry picked from commit f4ac7b5a084a7cf483bb89a2fa411f9df70df4d0)
    
    tdf#117866 cui personalization: fix a possible race
    
    The case when the thread is re-scheduled exactly after checking for
    m_bExecute but before taking the solar mutex.
    
    (cherry picked from commit f4c73f90da2a2c31f0d29572180aa97e10c3dbad)
    
    Change-Id: Idddaadadc693610d9f31a14300b22aff8d452756
    Reviewed-on: https://gerrit.libreoffice.org/55347
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit ec8e973f7e681b0ae25e4b781918dd98ea0e8176)

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index a9ff29edf078..dab788d8b824 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -99,7 +99,13 @@ SelectPersonaDialog::~SelectPersonaDialog()
 void SelectPersonaDialog::dispose()
 {
     if (m_pSearchThread.is())
+    {
+        // Release the solar mutex, so the thread is not affected by the race
+        // when it's after the m_bExecute check but before taking the solar
+        // mutex.
+        SolarMutexReleaser aReleaser;
         m_pSearchThread->join();
+    }
 
     m_pEdit.clear();
     m_pSearchButton.clear();
@@ -772,14 +778,16 @@ void SearchAndParseThread::execute()
                 continue;
             }
             INetURLObject aURLObj( sPreviewFile );
+
+            // Stop the thread if requested -- before taking the solar mutex.
+            if( !m_bExecute )
+                return;
+
             // for VCL to be able to create bitmaps / do visual changes in the thread
             SolarMutexGuard aGuard;
             aFilter.ImportGraphic( aGraphic, aURLObj );
             Bitmap aBmp = aGraphic.GetBitmap();
 
-            if( !m_bExecute )
-                return;
-
             m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ );
             m_pPersonaDialog->setOptimalLayoutSize();
             m_pPersonaDialog->AddPersonaSetting( aPersonaSetting );
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 9d5e057c8c34..5153fc98b1b5 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -16,6 +16,7 @@
 #include <vcl/prgsbar.hxx>
 #include <vector>
 #include <array>
+#include <atomic>
 
 #define CATEGORYCOUNT 6    // Number of persona categories
 
@@ -119,7 +120,8 @@ private:
 
     VclPtr<SelectPersonaDialog> m_pPersonaDialog;
     OUString m_aURL;
-    bool m_bExecute, m_bDirectURL;
+    std::atomic<bool> m_bExecute;
+    bool m_bDirectURL;
 
     virtual ~SearchAndParseThread() override;
     virtual void execute() override;
commit 9974b9b11bbd702cba25b73096ea2cead2c8ce0e
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 18 20:41:30 2017 +0100

    Explicitly qualify ICU types with icu:: namespace
    
    It will be required by ICU 61 anyway, see
    https://ssl.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
    
    Change-Id: Ib7accd75a6e35932048d779cf7bf0a5a33f8ed0d
    Reviewed-on: https://gerrit.libreoffice.org/46741
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 8960ecc689ce41cfaa40b65d75830d7491b06463)
    Reviewed-on: https://gerrit.libreoffice.org/56680
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 8790243df458250b00de67bf6fc892b3fa5660ad)

diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index b81ffed22937..0ec2347fb332 100644
--- a/opencl/source/openclconfig.cxx
+++ b/opencl/source/openclconfig.cxx
@@ -119,7 +119,7 @@ bool match(const OUString& rPattern, const OUString& rInput)
     UErrorCode nIcuError(U_ZERO_ERROR);
     icu::UnicodeString sIcuPattern(reinterpret_cast<const UChar*>(rPattern.getStr()), rPattern.getLength());
     icu::UnicodeString sIcuInput(reinterpret_cast<const UChar*>(rInput.getStr()), rInput.getLength());
-    RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError);
+    icu::RegexMatcher aMatcher(sIcuPattern, sIcuInput, 0, nIcuError);
 
     return U_SUCCESS(nIcuError) && aMatcher.matches(nIcuError) && U_SUCCESS(nIcuError);
 }
commit c34783711b2eb207825de7fc7b7a6655ea65e576
Author: Michael Stahl <Michael.Stahl at cib.de>
Date:   Thu Jun 28 18:30:28 2018 +0200

    python3: upgrade to release 3.5.5
    
    Fixes CVE-2017-1000158.
    
    Change-Id: I1871f031e3431253a3403f2ea2b586bcc4aa1016
    Reviewed-on: https://gerrit.libreoffice.org/56609
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 744feb55a11263ae0947ab59db76b949b5863acf)
    Reviewed-on: https://gerrit.libreoffice.org/56673
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit f764237989d8aa081a30b3518add39af4bb23632)

diff --git a/configure.ac b/configure.ac
index 576c5a843c6b..cd47842148f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8078,7 +8078,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=5
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.4
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.5
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
     fi
diff --git a/download.lst b/download.lst
index 3db3fe1cdd97..8880f5e3ae84 100644
--- a/download.lst
+++ b/download.lst
@@ -226,8 +226,8 @@ export POPPLER_SHA256SUM := 2c096431adfb74bc2f53be466889b7646e1b599f28fa036094f3
 export POPPLER_TARBALL := poppler-0.66.0.tar.xz
 export POSTGRESQL_SHA256SUM := db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
-export PYTHON_SHA256SUM := 6ed87a8b6c758cc3299a8b433e8a9a9122054ad5bc8aad43299cff3a53d8ca44
-export PYTHON_TARBALL := Python-3.5.4.tgz
+export PYTHON_SHA256SUM := 063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009
+export PYTHON_TARBALL := Python-3.5.5.tar.xz
 export QXP_SHA256SUM := 8c257f6184ff94aefa7c9fa1cfae82083d55a49247266905c71c53e013f95c73
 export QXP_TARBALL := libqxp-0.0.1.tar.xz
 export RAPTOR_SHA256SUM := ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed
commit 462d395e2c59146e12a1095f394f76f0ceeee55d
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 18 20:28:07 2017 +0100

    Explicitly qualify ICU types with icu:: namespace
    
    It will be required by ICU 61 anyway, see
    https://ssl.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
    
    Change-Id: I16b6bc8b8c49713f32424df5fc6db494df7b6892
    Reviewed-on: https://gerrit.libreoffice.org/46738
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit f7961456d81c3ee6ee4c13eac9ef7add6c7ea6b5)
    Reviewed-on: https://gerrit.libreoffice.org/56664
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit cc0b086988c23525f6f7825cb735e8a0d1c54720)

diff --git a/i18npool/inc/collator_unicode.hxx b/i18npool/inc/collator_unicode.hxx
index 69d317797870..d943bc9bc2c1 100644
--- a/i18npool/inc/collator_unicode.hxx
+++ b/i18npool/inc/collator_unicode.hxx
@@ -63,7 +63,7 @@ public:
 
 private:
     const sal_Char *implementationName;
-    RuleBasedCollator *uca_base, *collator;
+    icu::RuleBasedCollator *uca_base, *collator;
 #ifndef DISABLE_DYNLOADING
     oslModule hModule;
 #endif
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index b4ca111179c1..77fabbfce84b 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -56,14 +56,14 @@ BreakIterator_Unicode::~BreakIterator_Unicode()
 }
 
 /*
-    Wrapper class to provide public access to the RuleBasedBreakIterator's
+    Wrapper class to provide public access to the icu::RuleBasedBreakIterator's
     setbreakType method.
 */
-class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
+class OOoRuleBasedBreakIterator : public icu::RuleBasedBreakIterator
 {
     public:
 #if (U_ICU_VERSION_MAJOR_NUM < 58)
-    // RuleBasedBreakIterator::setBreakType() is private as of ICU 58.
+    // icu::RuleBasedBreakIterator::setBreakType() is private as of ICU 58.
     void publicSetBreakType(int32_t type)
         {
             setBreakType(type);
@@ -71,7 +71,7 @@ class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
 #endif
     OOoRuleBasedBreakIterator(UDataMemory* image,
                               UErrorCode &status)
-        : RuleBasedBreakIterator(image, status)
+        : icu::RuleBasedBreakIterator(image, status)
         { };
 
 };
@@ -334,7 +334,7 @@ sal_Int32 SAL_CALL BreakIterator_Unicode::nextCharacters( const OUString& Text,
         icu::BreakIterator* pBI = character.mpValue->mpBreakIterator.get();
         for (nDone = 0; nDone < nCount; nDone++) {
             nStartPos = pBI->following(nStartPos);
-            if (nStartPos == BreakIterator::DONE)
+            if (nStartPos == icu::BreakIterator::DONE)
                 return Text.getLength();
         }
     } else { // for CHARACTER mode
@@ -353,7 +353,7 @@ sal_Int32 SAL_CALL BreakIterator_Unicode::previousCharacters( const OUString& Te
         icu::BreakIterator* pBI = character.mpValue->mpBreakIterator.get();
         for (nDone = 0; nDone < nCount; nDone++) {
             nStartPos = pBI->preceding(nStartPos);
-            if (nStartPos == BreakIterator::DONE)
+            if (nStartPos == icu::BreakIterator::DONE)
                 return 0;
         }
     } else { // for BS to delete one char and CHARACTER mode.
@@ -371,7 +371,7 @@ Boundary SAL_CALL BreakIterator_Unicode::nextWord( const OUString& Text, sal_Int
 
     Boundary rv;
     rv.startPos = icuBI->mpValue->mpBreakIterator->following(nStartPos);
-    if( rv.startPos >= Text.getLength() || rv.startPos == BreakIterator::DONE )
+    if( rv.startPos >= Text.getLength() || rv.startPos == icu::BreakIterator::DONE )
         rv.endPos = result.startPos;
     else {
         if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES ||
@@ -380,7 +380,7 @@ Boundary SAL_CALL BreakIterator_Unicode::nextWord( const OUString& Text, sal_Int
             rv.startPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos);
 
         rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos);
-        if(rv.endPos == BreakIterator::DONE)
+        if(rv.endPos == icu::BreakIterator::DONE)
             rv.endPos = rv.startPos;
     }
     return rv;
@@ -394,7 +394,7 @@ Boundary SAL_CALL BreakIterator_Unicode::previousWord(const OUString& Text, sal_
 
     Boundary rv;
     rv.startPos = icuBI->mpValue->mpBreakIterator->preceding(nStartPos);
-    if( rv.startPos < 0 || rv.startPos == BreakIterator::DONE)
+    if( rv.startPos < 0 || rv.startPos == icu::BreakIterator::DONE)
         rv.endPos = rv.startPos;
     else {
         if ( (rWordType == WordType::ANYWORD_IGNOREWHITESPACES ||
@@ -403,7 +403,7 @@ Boundary SAL_CALL BreakIterator_Unicode::previousWord(const OUString& Text, sal_
             rv.startPos = icuBI->mpValue->mpBreakIterator->preceding(rv.startPos);
 
         rv.endPos = icuBI->mpValue->mpBreakIterator->following(rv.startPos);
-        if(rv.endPos == BreakIterator::DONE)
+        if(rv.endPos == icu::BreakIterator::DONE)
             rv.endPos = rv.startPos;
     }
     return rv;
@@ -435,9 +435,9 @@ Boundary SAL_CALL BreakIterator_Unicode::getWordBoundary( const OUString& Text,
             rv.endPos = icuBI->mpValue->mpBreakIterator->following(nPos);
         }
     }
-    if (rv.startPos == BreakIterator::DONE)
+    if (rv.startPos == icu::BreakIterator::DONE)
         rv.startPos = rv.endPos;
-    else if (rv.endPos == BreakIterator::DONE)
+    else if (rv.endPos == icu::BreakIterator::DONE)
         rv.endPos = rv.startPos;
 
     return rv;
@@ -502,7 +502,7 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
             lbr.breakIndex = nStartPos;
             lbr.breakType = BreakType::WORDBOUNDARY;
         } else if (hOptions.rHyphenator.is()) { //Hyphenation break
-            sal_Int32 boundary_with_punctuation = (pLineBI->next() != BreakIterator::DONE) ? pLineBI->current() : 0;
+            sal_Int32 boundary_with_punctuation = (pLineBI->next() != icu::BreakIterator::DONE) ? pLineBI->current() : 0;
             pLineBI->preceding(nStartPos + 1); // reset to check correct hyphenation of "word-word"
 
             sal_Int32 nStartPosWordEnd = nStartPos;
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 22b7ed9ae492..552c95ed35f1 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -138,7 +138,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
         UErrorCode status = U_ZERO_ERROR;
         OUString rule = LocaleDataImpl::get()->getCollatorRuleByAlgorithm(rLocale, rAlgorithm);
         if (!rule.isEmpty()) {
-            collator = new RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status);
+            collator = new icu::RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status);
             if (! U_SUCCESS(status)) throw RuntimeException();
         }
         if (!collator && OUString(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) {
@@ -343,7 +343,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
                 size_t ruleImageSize = funclen();
 
 #if (U_ICU_VERSION_MAJOR_NUM == 4) && (U_ICU_VERSION_MINOR_NUM <= 2)
-                uca_base = new RuleBasedCollator(static_cast<UChar*>(NULL), status);
+                uca_base = new icu::RuleBasedCollator(static_cast<UChar*>(NULL), status);
 #else
                 // Not only changed ICU 53.1 the API behavior that a negative
                 // length (ruleImageSize) now leads to failure, but also that
@@ -354,11 +354,11 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
                 // The default collator of the en-US locale would also fulfill
                 // the requirement. The collator of the actual locale or the
                 // NULL (default) locale does not.
-                uca_base = static_cast<RuleBasedCollator*>(icu::Collator::createInstance(
+                uca_base = static_cast<icu::RuleBasedCollator*>(icu::Collator::createInstance(
                             icu::Locale::getRoot(), status));
 #endif
                 if (! U_SUCCESS(status)) throw RuntimeException();
-                collator = new RuleBasedCollator(
+                collator = new icu::RuleBasedCollator(
                         reinterpret_cast<const uint8_t*>(ruleImage), ruleImageSize, uca_base, status);
                 if (! U_SUCCESS(status)) throw RuntimeException();
             }
@@ -372,17 +372,17 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
             */
             icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale), rAlgorithm));
             // load ICU collator
-            collator = static_cast<RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) );
+            collator = static_cast<icu::RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) );
             if (! U_SUCCESS(status)) throw RuntimeException();
         }
     }
 
     if (options & CollatorOptions::CollatorOptions_IGNORE_CASE_ACCENT)
-        collator->setStrength(Collator::PRIMARY);
+        collator->setStrength(icu::Collator::PRIMARY);
     else if (options & CollatorOptions::CollatorOptions_IGNORE_CASE)
-        collator->setStrength(Collator::SECONDARY);
+        collator->setStrength(icu::Collator::SECONDARY);
     else
-        collator->setStrength(Collator::TERTIARY);
+        collator->setStrength(icu::Collator::TERTIARY);
 
     return 0;
 }
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 7d795b5af079..3048d12bb90b 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -113,7 +113,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
     //UCollator *coll = ucol_openRules(Obuf.getStr(), Obuf.getLength(), UCOL_OFF,
     //        UCOL_DEFAULT_STRENGTH, &parseError, &status);
 
-    auto coll = o3tl::make_unique<RuleBasedCollator>(reinterpret_cast<const UChar *>(Obuf.getStr()), status);
+    auto coll = o3tl::make_unique<icu::RuleBasedCollator>(reinterpret_cast<const UChar *>(Obuf.getStr()), status);
 
     if (U_SUCCESS(status)) {
         std::vector<uint8_t> data;
diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
index a3e7d4ab6e8e..f32579894d44 100644
--- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
+++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
@@ -79,7 +79,7 @@ uno::Sequence< OUString > SAL_CALL OrdinalSuffixService::getOrdinalSuffix( sal_I
     if (!U_SUCCESS(nCode))
         return retValue;
 
-    std::unique_ptr<NumberFormat> xNumberFormat(icu::NumberFormat::createInstance(aIcuLocale, nCode));
+    std::unique_ptr<icu::NumberFormat> xNumberFormat(icu::NumberFormat::createInstance(aIcuLocale, nCode));
     if (!U_SUCCESS(nCode))
         return retValue;
 
diff --git a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
index 0ddfe645abaa..2b5ca1ed1bdb 100644
--- a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
+++ b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx
@@ -35,7 +35,7 @@ ignoreDiacritics_CTL::transliterateChar2Char(sal_Unicode nInChar)
     if (!m_transliterator)
         throw css::uno::RuntimeException();
 
-    UnicodeString aChar(nInChar);
+    icu::UnicodeString aChar(nInChar);
     m_transliterator->transliterate(aChar);
 
     if (aChar.isEmpty())
@@ -68,7 +68,7 @@ ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos,
         {
             sal_Int32 nIndex = nPosition;
             UChar32 nChar = rInStr.iterateCodePoints(&nIndex);
-            UnicodeString aUStr(nChar);
+            icu::UnicodeString aUStr(nChar);
             m_transliterator->transliterate(aUStr);
 
             if (nOffset + aUStr.length() > rOffset.getLength())
@@ -87,7 +87,7 @@ ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos,
     }
     else
     {
-        UnicodeString aUStr(reinterpret_cast<const UChar*>(rInStr.getStr()) + nStartPos, nCount);
+        icu::UnicodeString aUStr(reinterpret_cast<const UChar*>(rInStr.getStr()) + nStartPos, nCount);
         m_transliterator->transliterate(aUStr);
         return OUString(reinterpret_cast<const sal_Unicode*>(aUStr.getBuffer()), aUStr.length());
     }
commit 24e3cb4dfde7f3456621a33475a72637c32b6f05
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jun 22 17:03:30 2018 +0200

    tdf#116208 vcl opengl: fix lack of updates in status bar
    
    Commit f0821f9a347c7752a3c741c3451a2f1630173720 (Cache text layout of
    statusbar items, 2017-06-08) was a performance improvement of not laying
    out the text of status bar text during each & every paint. One of these
    places didn't work correctly with Chinese text, so commit
    a4ed3d9a1ffa1b51ba4352a955c950235f099fdc (tdf#115353 Status bar: no
    cache in settext, 2018-03-01) attempted to disable the caching at that
    particular place by removing the update of the cache.
    
    This resulted in lack of updates, e.g. during typing into Writer and
    checking the word count part of the status bar.
    
    Fix this (and at the same time keep the original problem fixed) by still
    not using the layout cache and that problematic place, but instead of
    just not updating the cache actually invalidate it -- probably that was
    the intention in the force place already.
    
    (cherry picked from commit 0ad7226aee21cc6dbb30d061d76491b01e39de66)
    
    Change-Id: Ib7b91e5f24bc68d2f8cae2efea64340585ad9bd5
    Reviewed-on: https://gerrit.libreoffice.org/56437
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
    (cherry picked from commit bcfa971adb62bfdde14e8c328fb25e1d10acad9b)

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index aebec55ec630..f83a8665dea1 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -1169,6 +1169,9 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText )
             std::unique_ptr<SalLayout> pSalLayout = ImplLayout(pItem->maText,0,-1);
             long nWidth = GetTextWidth( pItem->maText,0,-1,nullptr,pSalLayout.get() ) + nFudge;
 
+            // Invalidate cache.
+            pItem->mxLayoutCache.reset();
+
             if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
                 ((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth  ))
             {
commit c47fd497851891963fab0ae3f529f721b0f4aa77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 26 11:58:30 2018 +0100

    forcepoint#47 bail when we detect the emf is broken
    
    Change-Id: I065635393763af774b45cbba6bd85c4334383b93
    Reviewed-on: https://gerrit.libreoffice.org/56458
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 8e5441469e07e85c5bd278ac5777eb2b550f900a)

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 2c49949870f4..509ce5339a55 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -837,12 +837,21 @@ namespace emfplushelper
             next = rMS.Tell() + (size - 12);
 
             if (size < 12)
+            {
                 SAL_WARN("drawinglayer", "Size field is less than 12 bytes");
+                break;
+            }
             else if (size > length)
+            {
                 SAL_WARN("drawinglayer", "Size field is greater than bytes left");
+                break;
+            }
 
             if (dataSize > (size - 12))
+            {
                 SAL_WARN("drawinglayer", "DataSize field is greater than Size-12");
+                break;
+            }
 
             SAL_INFO("drawinglayer", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);
 


More information about the Libreoffice-commits mailing list