[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 8 commits - external/icu external/redland extras/source hwpfilter/source sc/source sc/uiconfig sw/qa sw/source vcl/source writerfilter/source

Eike Rathke erack at redhat.com
Mon Apr 24 17:24:06 UTC 2017


 external/icu/UnpackedTarball_icu.mk                                                       |    1 
 external/icu/icu4c-changeset-39671.patch.1                                                |  189 ++++++++++
 external/redland/UnpackedTarball_raptor.mk                                                |    1 
 external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1 |   43 ++
 extras/source/templates/presnt/Alizarin.otp                                               |binary
 extras/source/templates/presnt/BrightBlue.otp                                             |binary
 extras/source/templates/presnt/DNA.otp                                                    |binary
 extras/source/templates/presnt/Focus.otp                                                  |binary
 extras/source/templates/presnt/Impress.otp                                                |binary
 extras/source/templates/presnt/Inspiration.otp                                            |binary
 extras/source/templates/presnt/LushGreen.otp                                              |binary
 extras/source/templates/presnt/Metropolis.otp                                             |binary
 extras/source/templates/presnt/Midnightblue.otp                                           |binary
 extras/source/templates/presnt/Pencil.otp                                                 |binary
 extras/source/templates/presnt/Sunset.otp                                                 |binary
 extras/source/templates/presnt/Vintage.otp                                                |binary
 extras/source/templates/presnt/Vivid.otp                                                  |binary
 hwpfilter/source/hbox.cxx                                                                 |    2 
 hwpfilter/source/hbox.h                                                                   |    2 
 hwpfilter/source/hwpfile.cxx                                                              |   10 
 hwpfilter/source/hwpread.cxx                                                              |    1 
 sc/source/ui/condformat/condformatdlgentry.cxx                                            |   22 -
 sc/source/ui/inc/condformatdlgentry.hxx                                                   |    2 
 sc/uiconfig/scalc/ui/conditionalentry.ui                                                  |   14 
 sw/qa/extras/rtfimport/data/tdf107116.rtf                                                 |   10 
 sw/qa/extras/rtfimport/rtfimport.cxx                                                      |    6 
 sw/source/filter/xml/xmlimp.cxx                                                           |   24 +
 sw/source/ui/utlui/poolfmt.src                                                            |    1 
 vcl/source/window/window.cxx                                                              |   10 
 writerfilter/source/rtftok/rtfsprm.cxx                                                    |   21 +
 30 files changed, 331 insertions(+), 28 deletions(-)

New commits:
commit f513276df9465f232038390981547f9cbc113a02
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Apr 20 22:06:23 2017 +0200

    add ICU changeset-39671 fix for CVE-2017-7867 CVE-2017-7868
    
    http://bugs.icu-project.org/trac/changeset/39671
    https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=213
    https://bugzilla.redhat.com/show_bug.cgi?id=1444101
    
    Reviewed-on: https://gerrit.libreoffice.org/36754
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit c7de8233d15ed0c90fef6c49a54d60cf10119f58)
    
    Backported to older MSVC using the UGLY_SIZEOF_MAPTOUCHARS macro instead
    of sizeof(UTF8Buf::mapToUChars).
    
    Change-Id: I4e776ad4fe63c77057b0c823f8672a2b6703346f
    Reviewed-on: https://gerrit.libreoffice.org/36774
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 3e227df8c645ee12b7852ab320c3041875d275ac)

diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 0e4a6455a0a3..58fedc9f3951 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
 	$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.diff) \
 	$(if $(filter EMSCRIPTEN,$(OS)),external/icu/icu4c-emscripten.patch.1) \
 	external/icu/khmerbreakengine.patch \
+	external/icu/icu4c-changeset-39671.patch.1 \
 ))
 
 $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/icu4c-changeset-39671.patch.1 b/external/icu/icu4c-changeset-39671.patch.1
new file mode 100644
index 000000000000..b8ac1385364e
--- /dev/null
+++ b/external/icu/icu4c-changeset-39671.patch.1
@@ -0,0 +1,189 @@
+diff -ur icu.org/source/common/utext.cpp icu/source/common/utext.cpp
+--- icu.org/source/common/utext.cpp	2016-06-15 20:58:17.000000000 +0200
++++ icu/source/common/utext.cpp	2017-04-21 16:38:15.993398034 +0200
+@@ -847,9 +847,15 @@
+ //------------------------------------------------------------------------------
+ 
+ // Chunk size.
+-//     Must be less than 85, because of byte mapping from UChar indexes to native indexes.
+-//     Worst case is three native bytes to one UChar.  (Supplemenaries are 4 native bytes
+-//     to two UChars.)
++//     Must be less than 42  (256/6), because of byte mapping from UChar indexes to native indexes.
++//     Worst case there are six UTF-8 bytes per UChar.
++//         obsolete 6 byte form fd + 5 trails maps to fffd
++//         obsolete 5 byte form fc + 4 trails maps to fffd
++//         non-shortest 4 byte forms maps to fffd
++//         normal supplementaries map to a pair of utf-16, two utf8 bytes per utf-16 unit
++//     mapToUChars array size must allow for the worst case, 6.
++//     This could be brought down to 4, by treating fd and fc as pure illegal,
++//     rather than obsolete lead bytes. But that is not compatible with the utf-8 access macros.
+ //
+ enum { UTF8_TEXT_CHUNK_SIZE=32 };
+ 
+@@ -867,6 +873,15 @@
+ //     pair.  Doing this is simpler than checking for the edge case.
+ //
+ 
++// erAck: older MSVC used on libreoffice-5-3 and 5-2 bails out with
++// error C2070: 'unknown': illegal sizeof operand
++// for sizeof(UTF8Buf::mapToUChars)
++// so have an ugly workaround:
++// First define a macro of the original size expression, so a follow-up patch
++// on the original code would fail..
++#define UGLY_MAPTOUCHARS_SIZE (UTF8_TEXT_CHUNK_SIZE*6+6)
++#define UGLY_SIZEOF_MAPTOUCHARS (sizeof(uint8_t)*(UGLY_MAPTOUCHARS_SIZE))
++
+ struct UTF8Buf {
+     int32_t   bufNativeStart;                        // Native index of first char in UChar buf
+     int32_t   bufNativeLimit;                        // Native index following last char in buf.
+@@ -889,7 +904,7 @@
+                                                      //  Requires two extra slots,
+                                                      //    one for a supplementary starting in the last normal position,
+                                                      //    and one for an entry for the buffer limit position.
+-    uint8_t   mapToUChars[UTF8_TEXT_CHUNK_SIZE*3+6]; // Map native offset from bufNativeStart to
++    uint8_t   mapToUChars[UGLY_MAPTOUCHARS_SIZE];    // Map native offset from bufNativeStart to
+                                                      //   correspoding offset in filled part of buf.
+     int32_t   align;
+ };
+@@ -1032,6 +1047,7 @@
+             // Requested index is in this buffer.
+             u8b = (UTF8Buf *)ut->p;   // the current buffer
+             mapIndex = ix - u8b->toUCharsMapStart;
++            U_ASSERT(mapIndex < (int32_t)UGLY_SIZEOF_MAPTOUCHARS);
+             ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
+             return TRUE;
+ 
+@@ -1298,6 +1314,10 @@
+         // Can only do this if the incoming index is somewhere in the interior of the string.
+         //   If index is at the end, there is no character there to look at.
+         if (ix != ut->b) {
++            // Note: this function will only move the index back if it is on a trail byte
++            //       and there is a preceding lead byte and the sequence from the lead 
++            //       through this trail could be part of a valid UTF-8 sequence
++            //       Otherwise the index remains unchanged.
+             U8_SET_CP_START(s8, 0, ix);
+         }
+ 
+@@ -1311,7 +1331,10 @@
+         UChar   *buf = u8b->buf;
+         uint8_t *mapToNative = u8b->mapToNative;
+         uint8_t *mapToUChars = u8b->mapToUChars;
+-        int32_t  toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1);
++        int32_t  toUCharsMapStart = ix - UGLY_SIZEOF_MAPTOUCHARS + 1;
++        // Note that toUCharsMapStart can be negative. Happens when the remaining
++        // text from current position to the beginning is less than the buffer size.
++        // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry.
+         int32_t  destIx = UTF8_TEXT_CHUNK_SIZE+2;   // Start in the overflow region
+                                                     //   at end of buffer to leave room
+                                                     //   for a surrogate pair at the
+@@ -1338,6 +1361,7 @@
+             if (c<0x80) {
+                 // Special case ASCII range for speed.
+                 buf[destIx] = (UChar)c;
++                U_ASSERT(toUCharsMapStart <= srcIx);
+                 mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
+                 mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
+             } else {
+@@ -1367,6 +1391,7 @@
+                 do {
+                     mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx;
+                 } while (sIx >= srcIx);
++                U_ASSERT(toUCharsMapStart <= (srcIx+1));
+ 
+                 // Set native indexing limit to be the current position.
+                 //   We are processing a non-ascii, non-native-indexing char now;
+@@ -1541,6 +1566,7 @@
+     U_ASSERT(index>=ut->chunkNativeStart+ut->nativeIndexingLimit);
+     U_ASSERT(index<=ut->chunkNativeLimit);
+     int32_t mapIndex = index - u8b->toUCharsMapStart;
++    U_ASSERT(mapIndex < (int32_t)UGLY_SIZEOF_MAPTOUCHARS);
+     int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
+     U_ASSERT(offset>=0 && offset<=ut->chunkLength);
+     return offset;
+diff -ur icu.org/source/test/intltest/utxttest.cpp icu/source/test/intltest/utxttest.cpp
+--- icu.org/source/test/intltest/utxttest.cpp	2016-06-15 20:58:17.000000000 +0200
++++ icu/source/test/intltest/utxttest.cpp	2017-04-21 16:14:57.383814739 +0200
+@@ -67,6 +67,8 @@
+             if (exec) Ticket10983();  break;
+         case 7: name = "Ticket12130";
+             if (exec) Ticket12130(); break;
++        case 8: name = "Ticket12888";
++            if (exec) Ticket12888(); break;
+         default: name = "";          break;
+     }
+ }
+@@ -1583,3 +1585,63 @@
+     }
+     utext_close(&ut);
+ }
++
++// Ticket 12888: bad handling of illegal utf-8 containing many instances of the archaic, now illegal,
++//               six byte utf-8 forms. Original implementation had an assumption that
++//               there would be at most three utf-8 bytes per UTF-16 code unit.
++//               The five and six byte sequences map to a single replacement character.
++
++void UTextTest::Ticket12888() {
++    const char *badString = 
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80";
++
++    UErrorCode status = U_ZERO_ERROR;
++    LocalUTextPointer ut(utext_openUTF8(NULL, badString, -1, &status));
++    TEST_SUCCESS(status);
++    for (;;) {
++        UChar32 c = utext_next32(ut.getAlias());
++        if (c == U_SENTINEL) {
++            break;
++        }
++    }
++    int32_t endIdx = utext_getNativeIndex(ut.getAlias());
++    if (endIdx != (int32_t)strlen(badString)) {
++        errln("%s:%d expected=%d, actual=%d", __FILE__, __LINE__, strlen(badString), endIdx);
++        return;
++    }
++
++    for (int32_t prevIndex = endIdx; prevIndex>0;) {
++        UChar32 c = utext_previous32(ut.getAlias());
++        int32_t currentIndex = utext_getNativeIndex(ut.getAlias());
++        if (c != 0xfffd) {
++            errln("%s:%d (expected, actual, index) = (%d, %d, %d)\n",
++                    __FILE__, __LINE__, 0xfffd, c, currentIndex);
++            break;
++        }
++        if (currentIndex != prevIndex - 6) {
++            errln("%s:%d: wrong index. Expected, actual = %d, %d",
++                    __FILE__, __LINE__, prevIndex - 6, currentIndex);
++            break;
++        }
++        prevIndex = currentIndex;
++    }
++}
+diff -ur icu.org/source/test/intltest/utxttest.h icu/source/test/intltest/utxttest.h
+--- icu.org/source/test/intltest/utxttest.h	2016-06-15 20:58:17.000000000 +0200
++++ icu/source/test/intltest/utxttest.h	2017-04-21 16:14:57.383814739 +0200
+@@ -38,6 +38,7 @@
+     void Ticket10562();
+     void Ticket10983();
+     void Ticket12130();
++    void Ticket12888();
+ 
+ private:
+     struct m {                              // Map between native indices & code points.
commit 5c73ac300c79e12c541b3f28c3f8453d2e62735e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 21 10:51:19 2017 +0100

    ofz#1193 we only set these values, never read them
    
    Change-Id: Ia2f54b536a4262e19abe260e8e19c9b15cc2d0ec
    Reviewed-on: https://gerrit.libreoffice.org/36780
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 241f36605bd50798afab9d3a7d3ae32619c906af)

diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 04d5497ce1f3..0cde055d7345 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -332,8 +332,6 @@ FBox::FBox(hchar hch)
     , pgy(0)
     , pgno(0)
     , showpg(0)
-    , prev(nullptr)
-    , next(nullptr)
 {
 }
 
diff --git a/hwpfilter/source/hbox.h b/hwpfilter/source/hbox.h
index a9aa2b452892..b642665dc520 100644
--- a/hwpfilter/source/hbox.h
+++ b/hwpfilter/source/hbox.h
@@ -316,8 +316,6 @@ struct FBox: public HBox
     short     pgx, pgy;                           // physical xpos, ypos
     short     pgno, showpg;                       // pageno where code is
 
-    FBox      *prev, *next;
-
     explicit FBox( hchar hch );
     virtual ~FBox() override;
 };
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 929a783d0761..96395da5c6da 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -441,18 +441,8 @@ EmPicture *HWPFile::GetEmPictureByName(char * name)
     return nullptr;
 }
 
-
 void HWPFile::AddBox(FBox * box)
 {
-// LATER if we don't use box->next(),
-// AddBox() and GetBoxHead() are useless;
-    if (!blist.empty())
-    {
-        box->prev = blist.back();
-        box->prev->next = box;
-    }
-    else
-        box->prev = nullptr;
     blist.push_back(box);
 }
 
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index abeaca660d53..608fd0371da2 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -221,6 +221,7 @@ bool TxtBox::Read(HWPFile & hwpf)
     hwpf.AddBox(this);
     hwpf.Read2b(&style.cap_len, 1);
     hwpf.Read2b(&dummy1, 1);
+    unsigned short next;
     hwpf.Read2b(&next, 1);
     hwpf.Read2b(&dummy2, 1);
 
commit c5794d3e5a88d1a68155125af913d477002fff3b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Apr 21 11:41:21 2017 +0200

    tdf#107211 sw: ODF import: add a horrible hack to import "Default"
    
    ... character style for hyperlinks and index-entry-templates.
    
    The problem is that the "Default" character style doesn't actually
    exist, it is just displayed in the UI so you can remove a character
    style that is set.  So for the most part there is no need to store
    "Default" in ODF files, except that for hyperlinks the default isn't
    "Default" but "Internet Link"/"Visited Internet Link".
    
    Hence it was not really a good idea to rename "Default" to "Default
    Style", because when importing existing documents the
    text:style-name="Default" is not found, and for new documents
    text:style-name="Default_20_Style" is not found either because
    there is no style:style element that sets up the mapping between the
    encoded style-name and the unencoded display-style-name.
    
    Add some hack in SwXMLBodyContext_Impl::SwXMLBodyContext_Impl(), when
    all style:style elements have been read (so we don't override what's
    in the document) to create the mapping for "Default", "Default_20_Style"
    and whatever the translation of that is.
    
    (regression from 783d13a9276931e274a90b9b53de2c92dc8c055e)
    
    Change-Id: I8a80847571f194204c5df267cb48e826a82328b2
    (cherry picked from commit 157013219230f251346a5aa662c39d02f15420ec)
    Reviewed-on: https://gerrit.libreoffice.org/36788
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 05710ae52ff9962c0852a4e2e59e1814c785b461)

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index a72fd26e1a06..a2f911417da0 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -52,6 +52,7 @@
 #include <poolfmt.hxx>
 #include <ndtxt.hxx>
 #include <editsh.hxx>
+#include <poolfmt.hrc>
 #include "xmlimp.hxx"
 #include "xmltexti.hxx"
 #include <xmloff/DocumentSettingsContext.hxx>
@@ -138,6 +139,29 @@ SwXMLBodyContext_Impl::SwXMLBodyContext_Impl( SwXMLImport& rImport,
                 const Reference< xml::sax::XAttributeList > & /*xAttrList*/ ) :
     SvXMLImportContext( rImport, nPrfx, rLName )
 {
+    // tdf#107211: if at this point we don't have a defined char style "Default"
+    // or "Default Style", add a mapping for it as it is not written
+    // into the file since it's not really a style but "no style"
+    // (hence referencing it actually makes no sense except for hyperlinks
+    // which default to something other than "Default")
+    OUString const sDefault(SW_RES(STR_POOLCOLL_STANDARD));
+    uno::Reference<container::XNameContainer> const& xStyles(
+            rImport.GetTextImport()->GetTextStyles());
+    if (!xStyles->hasByName("Default"))
+    {   // this old name was used before LO 4.0
+        rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, "Default", sDefault);
+    }
+    if (!xStyles->hasByName("Default_20_Style"))
+    {   // this new name contains a space which is converted to _20_ on export
+        rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, "Default_20_Style", sDefault);
+    }
+    bool isEncoded(false);
+    OUString const defaultEncoded(
+        rImport.GetMM100UnitConverter().encodeStyleName(sDefault, &isEncoded));
+    if (isEncoded && !xStyles->hasByName(defaultEncoded))
+    {   // new name may contain a space which is converted to _20_ on export
+        rImport.AddStyleDisplayName(XML_STYLE_FAMILY_TEXT_TEXT, defaultEncoded, sDefault);
+    }
 }
 
 SwXMLBodyContext_Impl::~SwXMLBodyContext_Impl()
diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src
index c6efa70a35d2..c0a876b64797 100644
--- a/sw/source/ui/utlui/poolfmt.src
+++ b/sw/source/ui/utlui/poolfmt.src
@@ -155,6 +155,7 @@ String STR_POOLFRM_LABEL
 
  // Template names
 
+// tdf#107211 please don't change STANDARD, except back to "Default"
 String STR_POOLCOLL_STANDARD
 {
     Text [ en-US ] = "Default Style" ;
commit 7c6c665bc88f8c905900c32e401ab1c6e658ce97
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Thu Apr 20 21:28:01 2017 +0200

    tdf#107027 Remove language specific tags in templates
    
    For all templates:
     Modify XML code to:
      Remove Configuration2 directory
      Remove lang specific tags in:
       - settings.xml
       - styles.xml
      Remove printer and grid parameters
    
    Alizarin.otp
     Change names of master slides
     Remove hard coded texts tdf#104087
    
    BrightBlue.otp
    
    DNA.otp
     Remove hard coded texts
    
    Focus.otp
     Remove hard coded texts
     Change text "Your logo here" to "Logo" to be less lang specific
    
    Impress.otp
    
    Inspiration.otp
    
    LushGreen.otp
    
    Metropolis.otp
     Remove hard coded texts
    
    Midnightblue.otp
     Remove Outline frame on page 3
    
    Pencil.otp
     Remove hard coded texts
     Resize title to not overlap picture
    
    Sunset.otp
     Remove hard coded texts
     Set title in bold
     Resize outline text zone to fit in page
    
    Vintage.otp
    
    Vivid.otp
     Remove texts in Notes page
     Remove hard coded texts
    
    Change-Id: If16c6c65e6650c1b6600e6324c0f931009023074
    Reviewed-on: https://gerrit.libreoffice.org/36752
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit 59cf94fac8e53d7f098eb2fbdf59d3a6aff254ce)
    Reviewed-on: https://gerrit.libreoffice.org/36773
    (cherry picked from commit 37b91d3f3a332ae7540c556751d39836b1f3d622)

diff --git a/extras/source/templates/presnt/Alizarin.otp b/extras/source/templates/presnt/Alizarin.otp
index dcd05bbd2320..8a8252d5a0f0 100644
Binary files a/extras/source/templates/presnt/Alizarin.otp and b/extras/source/templates/presnt/Alizarin.otp differ
diff --git a/extras/source/templates/presnt/BrightBlue.otp b/extras/source/templates/presnt/BrightBlue.otp
index 542fb259908a..f9f7a4536407 100644
Binary files a/extras/source/templates/presnt/BrightBlue.otp and b/extras/source/templates/presnt/BrightBlue.otp differ
diff --git a/extras/source/templates/presnt/DNA.otp b/extras/source/templates/presnt/DNA.otp
index eb400b47120d..7640e9e1c2a2 100644
Binary files a/extras/source/templates/presnt/DNA.otp and b/extras/source/templates/presnt/DNA.otp differ
diff --git a/extras/source/templates/presnt/Focus.otp b/extras/source/templates/presnt/Focus.otp
index 18b3ecae210f..d99618e841f8 100644
Binary files a/extras/source/templates/presnt/Focus.otp and b/extras/source/templates/presnt/Focus.otp differ
diff --git a/extras/source/templates/presnt/Impress.otp b/extras/source/templates/presnt/Impress.otp
index ddf9a7eeb2be..9a33dcb7627c 100644
Binary files a/extras/source/templates/presnt/Impress.otp and b/extras/source/templates/presnt/Impress.otp differ
diff --git a/extras/source/templates/presnt/Inspiration.otp b/extras/source/templates/presnt/Inspiration.otp
index 18a30cfa7c68..18ec2148c61a 100644
Binary files a/extras/source/templates/presnt/Inspiration.otp and b/extras/source/templates/presnt/Inspiration.otp differ
diff --git a/extras/source/templates/presnt/LushGreen.otp b/extras/source/templates/presnt/LushGreen.otp
index 040e3bf8bd78..e2d6638e97dd 100644
Binary files a/extras/source/templates/presnt/LushGreen.otp and b/extras/source/templates/presnt/LushGreen.otp differ
diff --git a/extras/source/templates/presnt/Metropolis.otp b/extras/source/templates/presnt/Metropolis.otp
index 2af7d8a0ab75..f176ad79e9e9 100644
Binary files a/extras/source/templates/presnt/Metropolis.otp and b/extras/source/templates/presnt/Metropolis.otp differ
diff --git a/extras/source/templates/presnt/Midnightblue.otp b/extras/source/templates/presnt/Midnightblue.otp
index 981704cf26e4..962bafa3f6f6 100644
Binary files a/extras/source/templates/presnt/Midnightblue.otp and b/extras/source/templates/presnt/Midnightblue.otp differ
diff --git a/extras/source/templates/presnt/Pencil.otp b/extras/source/templates/presnt/Pencil.otp
index 549714bef5e1..fa12e50deaa5 100644
Binary files a/extras/source/templates/presnt/Pencil.otp and b/extras/source/templates/presnt/Pencil.otp differ
diff --git a/extras/source/templates/presnt/Sunset.otp b/extras/source/templates/presnt/Sunset.otp
index ff9ac1b02306..b3d7b54077b6 100644
Binary files a/extras/source/templates/presnt/Sunset.otp and b/extras/source/templates/presnt/Sunset.otp differ
diff --git a/extras/source/templates/presnt/Vintage.otp b/extras/source/templates/presnt/Vintage.otp
index d34f83977199..7dbc4d4c9240 100644
Binary files a/extras/source/templates/presnt/Vintage.otp and b/extras/source/templates/presnt/Vintage.otp differ
diff --git a/extras/source/templates/presnt/Vivid.otp b/extras/source/templates/presnt/Vivid.otp
index 6152b9e773b0..5241ef42a983 100644
Binary files a/extras/source/templates/presnt/Vivid.otp and b/extras/source/templates/presnt/Vivid.otp differ
commit 60310df7408e929f8c39461cd7a39fa3961a1d14
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 19 16:47:56 2017 +0200

    redland: add raptor patch to fix some bugs
    
    Change-Id: I4e3db61fdfe0b984d36b4f67f8e891da48f79ddb
    (cherry picked from commit 8af6e5e0c4191b12d830b20f72ec3552eea15747)
    Reviewed-on: https://gerrit.libreoffice.org/36694
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 8044b81f1eaa8ac40acf405d5de450e011c4a34c)

diff --git a/external/redland/UnpackedTarball_raptor.mk b/external/redland/UnpackedTarball_raptor.mk
index 762903018d43..a6260715588e 100644
--- a/external/redland/UnpackedTarball_raptor.mk
+++ b/external/redland/UnpackedTarball_raptor.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,raptor,\
 	external/redland/raptor/ubsan.patch \
 	$(if $(SYSTEM_LIBXML),,external/redland/raptor/rpath.patch) \
 	external/redland/raptor/xml2-config.patch \
+	external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1 b/external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1
new file mode 100644
index 000000000000..6fa726cae6da
--- /dev/null
+++ b/external/redland/raptor/0001-Calcualte-max-nspace-declarations-correctly-for-XML-.patch.1
@@ -0,0 +1,43 @@
+From 590681e546cd9aa18d57dc2ea1858cb734a3863f Mon Sep 17 00:00:00 2001
+From: Dave Beckett <dave at dajobe.org>
+Date: Sun, 16 Apr 2017 23:15:12 +0100
+Subject: [PATCH] Calcualte max nspace declarations correctly for XML writer
+
+(raptor_xml_writer_start_element_common): Calculate max including for
+each attribute a potential name and value.
+
+Fixes Issues #0000617 http://bugs.librdf.org/mantis/view.php?id=617
+and #0000618 http://bugs.librdf.org/mantis/view.php?id=618
+---
+ src/raptor_xml_writer.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/raptor_xml_writer.c b/src/raptor_xml_writer.c
+index 693b946..0d3a36a 100644
+--- a/src/raptor_xml_writer.c
++++ b/src/raptor_xml_writer.c
+@@ -181,9 +181,10 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
+   size_t nspace_declarations_count = 0;  
+   unsigned int i;
+ 
+-  /* max is 1 per element and 1 for each attribute + size of declared */
+   if(nstack) {
+-    int nspace_max_count = element->attribute_count+1;
++    int nspace_max_count = element->attribute_count * 2; /* attr and value */
++    if(element->name->nspace)
++      nspace_max_count++;
+     if(element->declared_nspaces)
+       nspace_max_count += raptor_sequence_size(element->declared_nspaces);
+     if(element->xml_language)
+@@ -237,7 +238,7 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer,
+         }
+       }
+ 
+-      /* Add the attribute + value */
++      /* Add the attribute's value */
+       nspace_declarations[nspace_declarations_count].declaration=
+         raptor_qname_format_as_xml(element->attributes[i],
+                                    &nspace_declarations[nspace_declarations_count].length);
+-- 
+2.9.3
+
commit 18f9273a66dc147eb94e638f0c46eb405aa13dfc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 19 09:08:46 2017 +0200

    tdf#107116 RTF import: fix missing upper and lower borders around text
    
    See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305:
    writerfilter RTF import: override style properties like Word,
    2014-06-17) for the context.
    
    Here the problem was that various details of the top border were removed
    during the style deduplication, but not the top border sprm itself. That
    was interpreted (correctly) by dmapper as "no border", rather than
    "inherit from style".
    
    (cherry picked from commit e9f0d8d02885eca619552b19eab30c1eade9e7ef)
    
    Change-Id: I3dec8df789fc7b75fccfff91ce66f457fecd2f6e
    Reviewed-on: https://gerrit.libreoffice.org/36692
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit c8c90854506cc7f1c3d7084ab97c156aead003e2)

diff --git a/sw/qa/extras/rtfimport/data/tdf107116.rtf b/sw/qa/extras/rtfimport/data/tdf107116.rtf
new file mode 100644
index 000000000000..17c2f5b61a59
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf107116.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;
+\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+{\stylesheet
+{\s15\brdrt\brdrs\brdrw15\brsp120\brdrcf15 \brdrb\brdrs\brdrw15\brsp120\brdrcf15 \snext15 style;}
+}
+\pard\plain before\par
+\pard\plain \s15\brdrt\brdrs\brdrw15\brsp120\brdrcf15 \brdrb\brdrs\brdrw15\brsp120\brdrcf15 border \par
+\pard\plain after\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8fee2ab2fcd1..ca696d9c84f8 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2760,6 +2760,12 @@ DECLARE_RTFIMPORT_TEST(testTdf106694, "tdf106694.rtf")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14605), aTabs[0].Position);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf107116, "tdf107116.rtf")
+{
+    // This was 0, upper border around text (and its distance) was missing.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(120)), getProperty<sal_Int32>(getParagraph(2), "TopBorderDistance"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 7afee14a4189..3f4f6659d2e8 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -170,6 +170,23 @@ static bool isSPRMDeduplicateBlacklist(Id nId)
     }
 }
 
+/// Should this SPRM be removed if all its children is removed?
+static bool isSPRMChildrenExpected(Id nId)
+{
+    switch (nId)
+    {
+    case NS_ooxml::LN_CT_PBdr_top:
+    case NS_ooxml::LN_CT_PBdr_left:
+    case NS_ooxml::LN_CT_PBdr_bottom:
+    case NS_ooxml::LN_CT_PBdr_right:
+        // Expected children are NS_ooxml::LN_CT_Border_*.
+        return true;
+
+    default:
+        return false;
+    }
+}
+
 /// Does the clone / deduplication of a single sprm.
 static void cloneAndDeduplicateSprm(std::pair<Id, RTFValue::Pointer_t>& rSprm, RTFSprms& ret)
 {
@@ -185,7 +202,9 @@ static void cloneAndDeduplicateSprm(std::pair<Id, RTFValue::Pointer_t>& rSprm, R
         {
             RTFSprms const sprms(pValue->getSprms().cloneAndDeduplicate(rSprm.second->getSprms()));
             RTFSprms const attributes(pValue->getAttributes().cloneAndDeduplicate(rSprm.second->getAttributes()));
-            ret.set(rSprm.first, RTFValue::Pointer_t(pValue->CloneWithSprms(attributes, sprms)));
+            // Don't copy the sprm in case we expect it to have children but it doesn't have some.
+            if (!isSPRMChildrenExpected(rSprm.first) || !sprms.empty() || !attributes.empty())
+                ret.set(rSprm.first, RTFValue::Pointer_t(pValue->CloneWithSprms(attributes, sprms)));
         }
     }
     else
commit 02a1f6fc3ec690d1b63522a9a2d8375826a58090
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 30 10:16:41 2017 +0100

    Resolves: tdf#106838 icon set not visible in conditional formatting
    
    Change-Id: Ibafaa487d39a69bc7c5c150361368614c0d9e004
    (cherry picked from commit 1c2dd8dc14effe739bd826cf4fe77145d5b751bc)
    Reviewed-on: https://gerrit.libreoffice.org/35899
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 4e40cf62a142813a2ffa0a64148c84c1b4e60be9)

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index f4273992e9f4..6ecfeb7a71df 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1399,11 +1399,15 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(vcl::Window* pParent, ScIconSetTy
 
 Size ScIconSetFrmtDataEntry::calculateRequisition() const
 {
+    if (!maGrid) //during dispose
+        return Size();
     return getLayoutRequisition(*maGrid);
 }
 
 void ScIconSetFrmtDataEntry::setAllocation(const Size &rAllocation)
 {
+    if (!maGrid) //during dispose
+        return;
     setLayoutPosSize(*maGrid, Point(0, 0), rAllocation);
 }
 
@@ -1471,6 +1475,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, c
 {
     get(maLbColorFormat, "colorformat");
     get(maLbIconSetType, "iconsettype");
+    get(maIconParent, "iconparent");
 
     Init();
     maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
@@ -1485,12 +1490,9 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, c
         for (size_t i = 0, n = pIconSetFormatData->m_Entries.size();
                 i < n; ++i)
         {
-            maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create(
-                this, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
-            Size aSize(maEntries[0]->get_preferred_size());
-            Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
-            aPos.Y() += aSize.Height() * i * 1.2;
-            maEntries[i]->SetPosSizePixel(aPos, aSize);
+            maEntries.push_back(VclPtr<ScIconSetFrmtDataEntry>::Create(
+                maIconParent, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
+            maEntries[i]->set_grid_top_attach(i);
         }
         maEntries[0]->SetFirstEntry();
     }
@@ -1508,6 +1510,7 @@ void ScIconSetFrmtEntry::dispose()
     for (auto it = maEntries.begin(); it != maEntries.end(); ++it)
         it->disposeAndClear();
     maEntries.clear();
+    maIconParent.clear();
     maLbColorFormat.clear();
     maLbIconSetType.clear();
     ScCondFrmtEntry::dispose();
@@ -1535,11 +1538,8 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void )
 
     for(size_t i = 0; i < nElements; ++i)
     {
-        maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
-        Size aSize(maEntries[0]->get_preferred_size());
-        Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
-        aPos.Y() += aSize.Height() * i * 1.2;
-        maEntries[i]->SetPosSizePixel(aPos, aSize);
+        maEntries.push_back(VclPtr<ScIconSetFrmtDataEntry>::Create(maIconParent, static_cast<ScIconSetType>(nPos), mpDoc, i));
+        maEntries[i]->set_grid_top_attach(i);
         maEntries[i]->Show();
     }
     maEntries[0]->SetFirstEntry();
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index f7d446ff474b..642e6ceae019 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -297,6 +297,8 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry
     // icon set ui elements
     VclPtr<ListBox> maLbIconSetType;
 
+    VclPtr<VclContainer> maIconParent;
+
     typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
     ScIconSetFrmtDataEntriesType maEntries;
 
diff --git a/sc/uiconfig/scalc/ui/conditionalentry.ui b/sc/uiconfig/scalc/ui/conditionalentry.ui
index c5803074e635..88ec9b39069a 100644
--- a/sc/uiconfig/scalc/ui/conditionalentry.ui
+++ b/sc/uiconfig/scalc/ui/conditionalentry.ui
@@ -410,6 +410,20 @@
           </packing>
         </child>
         <child>
+          <object class="GtkGrid" id="iconparent">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">7</property>
+            <property name="width">3</property>
+          </packing>
+        </child>
+        <child>
           <placeholder/>
         </child>
         <child>
commit 041d1384458d7e46d48b749889ef7099e3fadcb7
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Apr 19 01:19:59 2017 +0100

    vcl: protect Window from exceptions during construction.
    
    Probable fix for:
    http://crashreport.libreoffice.org/stats/crash_details/f69188bd-0fdd-4b74-9ec6-35b544cba0c9
    
    Change-Id: I6442451785867f0fc2daf84776118b092d4d6a18
    Reviewed-on: https://gerrit.libreoffice.org/36653
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 6827da5052bfe975a3b34af8dfa8af75d41e904c)
    Reviewed-on: https://gerrit.libreoffice.org/36674
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 92edd724dd7f1ca85787480f046d48f9f27c51b8)

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 50e7435eeb53..72c2a5d832e5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -526,6 +526,7 @@ void Window::dispose()
     }
 
     delete mpWindowImpl->mpWinData;
+    mpWindowImpl->mpWinData = nullptr;
 
     // remove BorderWindow or Frame window data
     mpWindowImpl->mpBorderWindow.disposeAndClear();
@@ -552,11 +553,16 @@ void Window::dispose()
                 SAL_WARN("vcl", "Window " << this << " marked as frame window, "
                          "is missing from list of " << nWindows << " frames");
         }
-        mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr );
-        pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame );
+        if (mpWindowImpl->mpFrame) // otherwise exception during init
+        {
+            mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr );
+            pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame );
+        }
         assert (mpWindowImpl->mpFrameData->mnFocusId == nullptr);
         assert (mpWindowImpl->mpFrameData->mnMouseMoveId == nullptr);
+
         delete mpWindowImpl->mpFrameData;
+        mpWindowImpl->mpFrameData = nullptr;
     }
 
     // should be the last statements


More information about the Libreoffice-commits mailing list