cui/source/inc/paragrph.hxx                                    |    3 
 cui/source/tabpages/paragrph.cxx                               |   85 +
 cui/uiconfig/ui/textflowpage.ui                                |   10 
 filter/source/graphicfilter/ipsd/ipsd.cxx                      |   14 
 filter/source/graphicfilter/itiff/ccidecom.cxx                 |    5 
 filter/source/svg/presentation_engine.js                       |  575 
+++++++++-
 hwpfilter/source/hstream.cxx                                   |   21 
 hwpfilter/source/hstream.hxx                                   |   11 
 lotuswordpro/source/filter/lwpfilter.cxx                       |    5 
 lotuswordpro/source/filter/lwpidxmgr.cxx                       |    4 
 lotuswordpro/source/filter/tocread.cxx                         |    5 
 readlicense_oo/Package_files.mk                                |    4 
 solenv/gbuild/platform/macosx.mk                               |    2 
 svl/source/numbers/zformat.cxx                                 |    4 
 svl/source/numbers/zforscan.cxx                                |   43 
 svl/source/numbers/zforscan.hxx                                |    1 
 sw/source/filter/ww8/wrtww8.cxx                                |    8 
 sw/source/ui/table/tabledlg.cxx                                |   63 -
 sw/source/uibase/table/tablepg.hxx                             |    3 
 sw/source/uibase/utlui/uitool.cxx                              |   21 
 sw/uiconfig/swriter/ui/tabletextflowpage.ui                    |   10 
 tools/source/zcodec/zcodec.cxx                                 |    2 
 vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp |binary
 vcl/source/gdi/dibtools.cxx                                    |    5 
 vcl/source/window/mouse.cxx                                    |    3 
 25 files changed, 798 insertions(+), 109 deletions(-)

New commits:
commit 1e81d4cc5dfdcb45c3e07e82ed5080d122d27d3d
Author: Caolán McNamara <caol...@redhat.com>
Date:   Sat Mar 4 20:58:26 2017 +0000

    Resolves: ofz#727 don't allow negative sizes or indexes
    
    remove extra size in favour of vector size and don't resize
    and memcpy data, just use vector::insert
    
    Change-Id: I8efb91a8c11fbd862c0458042554cf7e94b813cd
    Reviewed-on: https://gerrit.libreoffice.org/34892
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit ecad9326a0e40a4bfe1e3c8232ee1a1f5cb84a65)

diff --git a/hwpfilter/source/hstream.cxx b/hwpfilter/source/hstream.cxx
index 6a0d59f..6b5bf98 100644
--- a/hwpfilter/source/hstream.cxx
+++ b/hwpfilter/source/hstream.cxx
@@ -22,38 +22,37 @@
 #include "hstream.hxx"
 
 HStream::HStream()
-    : size(0)
-    , pos(0)
+    : pos(0)
 {
 }
 
-void HStream::addData(const byte *buf, int aToAdd)
+void HStream::addData(const byte *buf, size_t aToAdd)
 {
-    seq.resize(size + aToAdd);
-    memcpy(seq.data() + size, buf, aToAdd);
-    size += aToAdd;
+    seq.insert(seq.end(), buf, buf + aToAdd);
 }
 
-int HStream::readBytes(byte * buf, int aToRead)
+size_t HStream::readBytes(byte * buf, size_t aToRead)
 {
+    auto size = seq.size();
     if (aToRead >= (size - pos))
         aToRead = size - pos;
-    for (int i = 0; i < aToRead; i++)
+    for (size_t i = 0; i < aToRead; ++i)
         buf[i] = seq[pos++];
     return aToRead;
 }
 
-int HStream::skipBytes(int aToSkip)
+size_t HStream::skipBytes(size_t aToSkip)
 {
+    auto size = seq.size();
     if (aToSkip >= (size - pos))
         aToSkip = size - pos;
     pos += aToSkip;
     return aToSkip;
 }
 
-int HStream::available() const
+size_t HStream::available() const
 {
-    return size - pos;
+    return seq.size() - pos;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hstream.hxx b/hwpfilter/source/hstream.hxx
index 4374b92..e6654f7 100644
--- a/hwpfilter/source/hstream.hxx
+++ b/hwpfilter/source/hstream.hxx
@@ -34,24 +34,23 @@ class HStream
 /**
  *
  */
-        void addData( const byte *buf, int aToAdd);
+        void addData( const byte *buf, size_t aToAdd);
 /**
  * Read some byte to buf as given size
  */
-        int readBytes( byte *buf, int aToRead);
+        size_t readBytes( byte *buf, size_t aToRead);
 /**
  * Skip some byte from stream as given size
  */
-        int skipBytes( int aToSkip );
+        size_t skipBytes( size_t aToSkip );
 /**
  * @returns Size of remained stream
  */
-        int available() const;
+        size_t available() const;
 
     private:
-        int size;
         std::vector<byte> seq;
-        int pos;
+        size_t pos;
 };
 #endif
 
commit 5d4ed24dfa40a7a11d92796430927035a13bad12
Author: Caolán McNamara <caol...@redhat.com>
Date:   Sat Mar 4 21:20:48 2017 +0000

    fail on unknown version flags
    
    Change-Id: Icbd2608a3341652b1b40f6bdebb66c4caf6e810a
    Reviewed-on: https://gerrit.libreoffice.org/34895
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit ad2748559c15d3eaa7e8be1506e3474002d4ef5b)

diff --git a/lotuswordpro/source/filter/tocread.cxx 
b/lotuswordpro/source/filter/tocread.cxx
index 192a636..73f9ccb 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -109,13 +109,12 @@ CBenTOCReader::ReadLabel(unsigned long * pTOCOffset, 
unsigned long * pTOCSize)
 
     BenByte * pCurrLabel = Label + BEN_MAGIC_BYTES_SIZE;
 
-#ifndef NDEBUG
     BenWord Flags =
-#endif
         UtGetIntelWord(pCurrLabel); pCurrLabel += 2; // Flags
     // Newer files are 0x0101--indicates if big or little endian.  Older
     // files are 0x0 for flags
-    assert(Flags == 0x0101 || Flags == 0x0);
+    if (Flags != 0x0101 && Flags != 0x0)
+        return BenErr_UnknownBentoFormatVersion;
 
     cBlockSize = UtGetIntelWord(pCurrLabel) * 1024; pCurrLabel += 2;
     if (cBlockSize == 0)
commit aa848f6dd0dd26708630154d266eac6b3f084aff
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Mar 1 17:24:21 2017 +0000

    Resolves: tdf#106261 throw away old node map for table
    
    when generating a new one, otherwise on exporting the same table
    twice to two consecutive .doc footnotes will think the second
    export of the table is a level lower because it will find it
    in the map and
    
    WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
    
    does pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
    using the cached pNodeInfo depth and not a new fresh pNodeInfo of
    depth 0
    
    Change-Id: I7aa7ac6a19814910c1d19d78f04cfd9886c444c5
    (cherry picked from commit 6f3e24ad64dd40b3ef8def7d879ba395a16874a1)
    Reviewed-on: https://gerrit.libreoffice.org/34765
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit d4b88da06634d85709b45176811ac3a0791f4c99)

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 7c2dff0..9a7bf2a 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1831,8 +1831,16 @@ void MSWordExportBase::WriteSpecialText( sal_uLong 
nStart, sal_uLong nEnd, sal_u
     // clear linked textboxes since old ones can't be linked to frames in this 
section
     m_aLinkedTextboxesHelper.clear();
 
+    // tdf#106261 Reset table infos, otherwise the depth of the cells will be
+    // incorrect, in case the header/footer had table(s) and we try to export
+    // the same table second time.
+    ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_pTableInfo;
+    m_pTableInfo = std::make_shared<ww8::WW8TableInfo>();
+
     WriteText();
 
+    m_pTableInfo = pOldTableInfo;
+
     m_bOutPageDescs = bOldPageDescs;
     delete m_pCurPam;                    // delete Pam
     m_pCurPam = pOldPam;
commit b86dfc828a26dfbaa0d80f56ed09c741a17b7867
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Mar 1 14:11:47 2017 +0000

    ofz: oom on seeks past end of SvMemoryStream
    
    cause it grows to fit if its a resizable stream
    
    Change-Id: I28b42becdfc8eb591d19d2512cdc1f1ec32c3bbe
    (cherry picked from commit a42d9c5b541d637dcf24086e30f341b30e03c4c7)
    Reviewed-on: https://gerrit.libreoffice.org/34753
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit fb604dd5340ddb367f11ab53966cae1bd549863c)

diff --git a/lotuswordpro/source/filter/lwpfilter.cxx 
b/lotuswordpro/source/filter/lwpfilter.cxx
index 0389ee3..9a3bcfcd 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -104,7 +104,7 @@ using namespace OpenStormBento;
  bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed)
 {
     pCompressed->Seek(0);
-    std::unique_ptr<SvStream> aDecompressed(new SvMemoryStream(4096, 4096));
+    std::unique_ptr<SvMemoryStream> aDecompressed(new SvMemoryStream(4096, 
4096));
     unsigned char buffer[512];
     pCompressed->ReadBytes(buffer, 16);
     aDecompressed->WriteBytes(buffer, 16);
@@ -132,6 +132,9 @@ using namespace OpenStormBento;
     while (sal_uInt32 iRead = pCompressed->ReadBytes(buffer, 512))
         aDecompressed->WriteBytes(buffer, iRead);
 
+    // disable stream growing past its current size
+    aDecompressed->SetResizeOffset(0);
+
     //transfer ownership of aDecompressed's ptr
     pOutDecompressed = aDecompressed.release();
     return true;
commit 1d4ddce58160656188c4df71bc9097097dca12f6
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Mar 2 09:48:42 2017 +0000

    ofz: init vars
    
    Change-Id: Ie35617997845de25af9e528668bce4c332ac408a
    (cherry picked from commit 1c29456c9c9007b788297aebea58a1a765f77c84)
    Reviewed-on: https://gerrit.libreoffice.org/34785
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Jenkins <c...@libreoffice.org>
    (cherry picked from commit 7b64bb4f9421879ad56ba69d3f8dd249eb42d8f0)

diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx 
b/filter/source/graphicfilter/ipsd/ipsd.cxx
index a1cd3ab..3a9ad60 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -279,17 +279,17 @@ bool PSDReader::ImplReadHeader()
     // this is a loop over the resource entries to get the resolution info
     while( m_rPSD.Tell() < nLayerPos )
     {
-        sal_uInt8 n8;
-        sal_uInt32 nType, nPStringLen, nResEntryLen;
-        sal_uInt16 nUniqueID;
-
-        m_rPSD.ReadUInt32( nType ).ReadUInt16( nUniqueID ).ReadUChar( n8 );
-        nPStringLen = n8;
-        if ( nType != 0x3842494d )
+        sal_uInt32 nType(0);
+        sal_uInt16 nUniqueID(0);
+        sal_uInt8 n8(0);
+        m_rPSD.ReadUInt32(nType).ReadUInt16(nUniqueID).ReadUChar(n8);
+        if (nType != 0x3842494d)
             break;
+        sal_uInt32 nPStringLen = n8;
         if ( ! ( nPStringLen & 1 ) )
             nPStringLen++;
         m_rPSD.SeekRel( nPStringLen );  // skipping the pstring
+        sal_uInt32 nResEntryLen(0);
         m_rPSD.ReadUInt32( nResEntryLen );
         if ( nResEntryLen & 1 )
             nResEntryLen++;             // the resource entries are padded
commit 0ada1b83975394bc7ffc429732658f8137ff0d55
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri Mar 3 09:44:24 2017 +0000

    ofz#721 use vector::at to check index
    
    Change-Id: I786b5d6fb10afe3ebb8482f999115fe72ffe2d4c
    Reviewed-on: https://gerrit.libreoffice.org/34852
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit ce562ba091dd7d51a349b0ea56431d1e7fe81ce0)

diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx 
b/lotuswordpro/source/filter/lwpidxmgr.cxx
index 8d02521..94cd789 100644
--- a/lotuswordpro/source/filter/lwpidxmgr.cxx
+++ b/lotuswordpro/source/filter/lwpidxmgr.cxx
@@ -194,7 +194,7 @@ void LwpIndexManager::ReadObjIndexData(LwpObjectStream* 
pObjStrm)
 
     std::vector<LwpKey*> vObjIndexs;
 
-    if(KeyCount)
+    if (KeyCount)
     {
         LwpKey* akey = new LwpKey();
         akey->id.Read(pObjStrm);
@@ -218,7 +218,7 @@ void LwpIndexManager::ReadObjIndexData(LwpObjectStream* 
pObjStrm)
 
     for( sal_uInt16 j=0; j<LeafCount; j++ )
     {
-        sal_Int64 nPos = m_TempVec[j]+LwpSvStream::LWP_STREAM_BASE;
+        sal_Int64 nPos = m_TempVec.at(j) + LwpSvStream::LWP_STREAM_BASE;
         sal_Int64 nActualPos = pObjStrm->GetStream()->Seek(nPos);
 
         if (nPos != nActualPos)
commit 48eff6b11d070137409599930c08ef9eecb3bf73
Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net>
Date:   Sun Feb 26 19:40:30 2017 +0100

    tdf#106190 fix left alignment of denominator
    
    The bug was introduced with left aligment of denominator.
    Non feasable denominators were not tested and create infinite loop
    while inserting and removing the same space.
    
    This patch detects
    - if denominator starts just after fraction bar.
      Otherwise, format is faulty.
    - if a non digit is detected in the denominator,
      next part of format is treated as text
    This patch is changing behavior of some formats:
    "# ?/foo??" is treated as faulty format while it was considered as valid
    "# ?/??E?" is treated with 2 digits in denominator and "E?" at the end,
     while it was considered as faulty
    
    Change-Id: I0379a398dff79b6e21a44776c0d4356d066cdeab
    Reviewed-on: https://gerrit.libreoffice.org/34659
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit b2738c6f67cb650ac32228f3cd20b9dfe4b41c9c)
    Reviewed-on: https://gerrit.libreoffice.org/34825
    (cherry picked from commit 5be9863007d28ce543b0030ffef4c7d955a8e283)

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index ac0c608..09e024e 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2815,9 +2815,9 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
     sal_Int32 k;           // Denominator
 
     bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC);
-    if ( !bHideFraction )
+    if ( !bHideFraction &&  sDenominatorFormat.getLength() > 0 )
     {
-        while ( sDiv[0] == ' ' )
+        while ( sDiv[0] == ' ' ) // left align denominator
         {
             sDiv.insert( sDenominatorFormat.getLength(), " " );
             sDiv.remove( 0, 1 );
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 0542cf3..5529dcc 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1079,6 +1079,7 @@ void ImpSvNumberformatScan::Reset()
     nCntExp = 0;
     bFrac = false;
     bBlank = false;
+    bDenomin = false;
     nNatNumModifier = 0;
 }
 
@@ -1666,6 +1667,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                     }
                     else if ( sStrArray[i][0] == ' ' )
                         nTypeArray[i] = NF_SYMBOLTYPE_FRACBLANK;
+                    else if ( bFrac )
+                        bDenomin = true; // following elements are no more 
part of denominator
                 }
                 else if (nTypeArray[i] == NF_KEY_THAI_T)
                 {
@@ -1673,7 +1676,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                     sStrArray[i] = sKeyword[nTypeArray[i]];
                 }
                 else if (sStrArray[i][0] >= '0' &&
-                         sStrArray[i][0] <= '9')
+                         sStrArray[i][0] <= '9' && !bDenomin) // denominator 
was not yet found
                 {
                     OUString sDiv;
                     sal_uInt16 j = i;
@@ -1702,10 +1705,14 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                         {
                             nCntPre++;
                         }
+                        if ( bFrac )
+                            bDenomin = true; // next content should be treated 
as outside denominator
                     }
                 }
                 else
                 {
+                    if ( bFrac )
+                        bDenomin = true;    // next content should be treated 
as outside denominator
                     nTypeArray[i] = NF_SYMBOLTYPE_STRING;
                 }
                 nPos = nPos + sStrArray[i].getLength();
@@ -1741,19 +1748,27 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                     {
                         return nPos;                    // Error
                     }
-                    nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
-                    nPos = nPos + rStr.getLength();
-                    i++;
-                    nCounter++;
-                    while (i < nAnzStrings &&
-                           (sStrArray[i][0] == '#' ||
-                            sStrArray[i][0] == '0' ||
-                            sStrArray[i][0] == '?'))
+                    if ( !bDenomin )
                     {
                         nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
-                        nPos = nPos + sStrArray[i].getLength();
-                        nCounter++;
+                        nPos = nPos + rStr.getLength();
                         i++;
+                        nCounter++;
+                        while (i < nAnzStrings &&
+                              (sStrArray[i][0] == '#' ||
+                               sStrArray[i][0] == '0' ||
+                               sStrArray[i][0] == '?'))
+                        {
+                            nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
+                            nPos = nPos + sStrArray[i].getLength();
+                            nCounter++;
+                            i++;
+                        }
+                    }
+                    else // after denominator, treat any character as text
+                    {
+                        nTypeArray[i] = NF_SYMBOLTYPE_STRING;
+                        nPos = nPos + sStrArray[i].getLength();
                     }
                     break;
                 case '-':
@@ -1816,6 +1831,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                             else
                             {
                                 nTypeArray[i] = NF_SYMBOLTYPE_STRING;
+                                if ( bFrac )
+                                    bDenomin = true; // end of denominator
                             }
                         }
                         else if (i > 0 && i < nAnzStrings-1   &&
@@ -1982,12 +1999,16 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rString )
                                 nCntPre = nCounter;
                                 nCounter = 0;
                             }
+                            if ( bFrac )
+                                bDenomin = true; // next content is not part 
of denominator
                             nTypeArray[i] = NF_SYMBOLTYPE_STRING;
                             nPos = nPos + sStrArray[i].getLength();
                         }
                         else
                         {
                             nTypeArray[i] = NF_SYMBOLTYPE_STRING;
+                            if ( bFrac )
+                                bDenomin = true; // next content is not part 
of denominator
                             nPos = nPos + rStr.getLength();
                             i++;
                             while (i < nAnzStrings && StringEqualsChar( 
sStrArray[i], cSaved ) )
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 001abe6..e0cec64 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -174,6 +174,7 @@ private: // Private section
     bool bExp;                                  // Set when reading E
     bool bFrac;                                 // Set when reading /
     bool bBlank;                                // Set when reading ' ' 
(Fraction)
+    bool bDenomin;                              // Set when reading end of 
denominator
     bool bDecSep;                               // Set on first ,
     mutable bool bKeywordsNeedInit;             // Locale dependent keywords 
need to be initialized
     mutable bool bCompatCurNeedInit;            // Locale dependent 
compatibility currency need to be initialized
commit 379bbd2c19d1d937d23a93b125f55b25c4800069
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Feb 28 16:43:44 2017 +0000

    ofz#668: check nTargetBits size
    
    Change-Id: I5cc7499cfdee58ffa480bb31dfc262d5b781180d
    (cherry picked from commit 99c361be16eb3a21aa679a103db2d07ecd0f5d3c)
    Reviewed-on: https://gerrit.libreoffice.org/34723
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    (cherry picked from commit 138737f26407acfd6cf431e4a8745569fb786dec)

diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx 
b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 1cb7d7d..4fcb6b9 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -627,7 +627,9 @@ void CCIDecompressor::StartDecompression( SvStream & 
rIStream )
 
 bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong 
nTargetBits, bool bLastLine )
 {
-    bool b2D;
+    //Read[1|2]DScanlineData take a sal_uInt16, so its either limit here or 
expand there
+    if (nTargetBits > SAL_MAX_UINT16)
+        return false;
 
     if ( nEOLCount >= 5 )   // RTC (Return To Controller)
         return true;
@@ -682,6 +684,7 @@ bool CCIDecompressor::DecompressScanline( sal_uInt8 * 
pTarget, sal_uLong nTarget
     if ( nOptions & CCI_OPTION_BYTEALIGNROW )
         nInputBitsBufSize &= 0xfff8;
 
+    bool b2D;
     // is it a 2D row?
     if ( nOptions & CCI_OPTION_2D )
     {
commit 1d76f7103052ccd3ac29f7359272ebcad64ddc49
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Mar 1 11:12:45 2017 +0000

    ofz: Z_NEED_DICT is unsupported
    
    Change-Id: Ib0945d5a4606915aff9ee3019203caaf2a3cc7c5
    (cherry picked from commit aacaacc16938b030a1341d8dbaf56c6a2efeb1dc)
    Reviewed-on: https://gerrit.libreoffice.org/34743
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    (cherry picked from commit 6f3cc872c58d8b34ca9f0a06f2d65b3b6cc1c7ee)

diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index 161aa33..c935bb8 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -222,7 +222,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, 
sal_uInt32 nSize )
 
         }
         err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO;
-        if ( err < 0 )
+        if (err < 0 || err == Z_NEED_DICT)
         {
             // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK.
             mbStatus = (err == Z_BUF_ERROR);
diff --git a/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp 
b/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp
new file mode 100644
index 0000000..a75d6eb
Binary files /dev/null and 
b/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp differ
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 6bf5843..7047fcf 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -853,7 +853,8 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, 
AlphaMask* pBmpAlpha, sal_u
                 // Seek behind the encoded block. There might have been bytes 
left or the codec might have read more than necessary.
                 rIStm.Seek(nCodedSize + nCodedPos);
             }
-            else
+
+            if (aData.empty())
             {
                 // add something so we can take address of the first element
                 aData.resize(1);
@@ -862,7 +863,7 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, 
AlphaMask* pBmpAlpha, sal_u
 
             // set decoded bytes to memory stream,
             // from which we will read the bitmap data
-            pMemStm.reset( new SvMemoryStream);
+            pMemStm.reset(new SvMemoryStream);
             pIStm = pMemStm.get();
             assert(!aData.empty());
             pMemStm->SetBuffer( &aData.front(), nUncodedSize, nUncodedSize );
commit ae0b62742b5f17d5c7daa6253a0012db31f7d0bc
Author: Michael Stahl <mst...@redhat.com>
Date:   Wed Mar 1 17:20:41 2017 +0100

    tdf#77111 sw: fix page number offset on table dialog "Text Flow"
    
    Commit c2ccd20c0fd92bddfff76447754541705e3eb8f3 introduced 0 as a valid
    value for page number offset in sw core.
    
    Unfortunately the table dialog was not changed then; previously
    page number 0 would do automatic numbering, but since then 0 was set as
    the offset, and once you have a 0 offset there's no easy way to remove
    it, you have to remove the whole page break.
    
    * change the label before the text number edit widget to a checkbox
      that disables the edit widget
    * keep the id "pagenoft" so that translations still work
    * set initial value to 1; 0 is a really bad default since we can't
      export it to ODF
    * add a little bit of left margin so the line is indented below the
      upper line
    
    Change-Id: I70cf5a66d4191acd2c19b3d0a83609e2b348a886
    (cherry picked from commit c1e7fc6f497d7570cb0832c43647d295f8592567)
    Reviewed-on: https://gerrit.libreoffice.org/34763
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 362ff67556cca0890ca01f2de44596491c0e9bc8)

diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index e96e195..611a2ce 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1282,7 +1282,7 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, 
const SfxItemSet& rSet)
 
     get(m_pPageCollCB, "pagestyle");
     get(m_pPageCollLB, "pagestylelb");
-    get(m_pPageNoFT, "pagenoft");
+    get(m_pPageNoCB, "pagenoft");
     get(m_pPageNoNF, "pagenonf");
 
     get(m_pSplitCB, "split");
@@ -1307,6 +1307,8 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, 
const SfxItemSet& rSet)
         LINK( this, SwTextFlowPage, PageBreakTypeHdl_Impl ) );
     m_pPgBrkRB->SetClickHdl(
         LINK( this, SwTextFlowPage, PageBreakTypeHdl_Impl ) );
+    m_pPageNoCB->SetClickHdl(
+        LINK(this, SwTextFlowPage, PageNoClickHdl_Impl));
     m_pSplitCB->SetClickHdl(
         LINK( this, SwTextFlowPage, SplitHdl_Impl));
     m_pSplitRowCB->SetClickHdl(
@@ -1341,7 +1343,7 @@ void SwTextFlowPage::dispose()
     m_pPgBrkAfterRB.clear();
     m_pPageCollCB.clear();
     m_pPageCollLB.clear();
-    m_pPageNoFT.clear();
+    m_pPageNoCB.clear();
     m_pPageNoNF.clear();
     m_pSplitCB.clear();
     m_pSplitRowCB.clear();
@@ -1387,10 +1389,10 @@ bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
 
     //If we have a page style, then there's no break
     bool bPageItemPut = false;
-    if ( bState != (m_pPageCollCB->GetSavedValue() == 1) ||
-         ( bState &&
-           m_pPageCollLB->IsValueChangedFromSaved() )
-           || (m_pPageNoNF->IsEnabled() && m_pPageNoNF->IsValueModified()) )
+    if (   bState != (m_pPageCollCB->GetSavedValue() == TRISTATE_TRUE)
+        || (bState && m_pPageCollLB->IsValueChangedFromSaved())
+        || (m_pPageNoCB->IsEnabled() && m_pPageNoCB->IsValueChangedFromSaved())
+        || (m_pPageNoNF->IsEnabled() && m_pPageNoNF->IsValueModified()))
     {
         OUString sPage;
 
@@ -1399,12 +1401,15 @@ bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
             sPage = m_pPageCollLB->GetSelectEntry();
         }
         sal_uInt16 nPgNum = static_cast< sal_uInt16 >(m_pPageNoNF->GetValue());
-        if ( !pDesc || !pDesc->GetPageDesc() ||
-            ( pDesc->GetPageDesc() && ((pDesc->GetPageDesc()->GetName() != 
sPage) ||
-                    !comphelper::string::equals(m_pPageNoNF->GetSavedValue(), 
nPgNum))))
+        bool const usePageNo(bState && m_pPageNoCB->IsChecked());
+        boost::optional<sal_uInt16> const oPageNum(
+                (usePageNo) ? nPgNum : boost::optional<sal_Int16>());
+        if (!pDesc || !pDesc->GetPageDesc()
+            || (pDesc->GetPageDesc()->GetName() != sPage)
+            || (pDesc->GetNumOffset() != oPageNum))
         {
             SwFormatPageDesc aFormat( pShell->FindPageDescByName( sPage, true 
) );
-            aFormat.SetNumOffset(bState ? nPgNum : 0);
+            aFormat.SetNumOffset(oPageNum);
             bModified |= nullptr != rSet->Put( aFormat );
             bPageItemPut = bState;
         }
@@ -1526,12 +1531,18 @@ void   SwTextFlowPage::Reset( const SfxItemSet* rSet )
                 OUString sPageDesc;
                 const SwPageDesc* pDesc = static_cast<const 
SwFormatPageDesc*>(pItem)->GetPageDesc();
 
-                //m_pPageNoNF->SetValue(static_cast<const 
SwFormatPageDesc*>(pItem)->GetNumOffset());
                 ::boost::optional<sal_uInt16> oNumOffset = static_cast<const 
SwFormatPageDesc*>(pItem)->GetNumOffset();
                 if (oNumOffset)
+                {
+                    m_pPageNoCB->Check();
+                    m_pPageNoNF->Enable(true);
                     m_pPageNoNF->SetValue(oNumOffset.get());
+                }
                 else
+                {
+                    m_pPageNoCB->Check(false);
                     m_pPageNoNF->Enable(false);
+                }
 
                 if(pDesc)
                     sPageDesc = pDesc->GetName();
@@ -1571,7 +1582,7 @@ void   SwTextFlowPage::Reset( const SfxItemSet* rSet )
                     m_pPgBrkCB->Check();
                     m_pPageCollCB->Enable(false);
                     m_pPageCollLB->Enable(false);
-                    m_pPageNoFT->Enable(false);
+                    m_pPageNoCB->Enable(false);
                     m_pPageNoNF->Enable(false);
                 }
                 switch ( eBreak )
@@ -1659,6 +1670,7 @@ void   SwTextFlowPage::Reset( const SfxItemSet* rSet )
     m_pColBrkRB->SaveValue();
     m_pPgBrkBeforeRB->SaveValue();
     m_pPgBrkAfterRB->SaveValue();
+    m_pPageNoCB->SaveValue();
     m_pPageNoNF->SaveValue();
     m_pTextDirectionLB->SaveValue();
     m_pVertOrientLB->SaveValue();
@@ -1673,7 +1685,7 @@ void SwTextFlowPage::SetShell(SwWrtShell* pSh)
     if(bHtmlMode)
     {
         m_pPageNoNF->Enable(false);
-        m_pPageNoFT->Enable(false);
+        m_pPageNoCB->Enable(false);
     }
 }
 
@@ -1695,8 +1707,8 @@ IMPL_LINK_NOARG(SwTextFlowPage, PageBreakHdl_Impl, 
Button*, void)
                 m_pPageCollLB->Enable(bEnable);
                 if(!bHtmlMode)
                 {
-                    m_pPageNoFT->Enable(bEnable);
-                    m_pPageNoNF->Enable(bEnable);
+                    m_pPageNoCB->Enable(bEnable);
+                    m_pPageNoNF->Enable(bEnable && m_pPageNoCB->IsChecked());
                 }
             }
     }
@@ -1705,7 +1717,7 @@ IMPL_LINK_NOARG(SwTextFlowPage, PageBreakHdl_Impl, 
Button*, void)
             m_pPageCollCB->Check( false );
             m_pPageCollCB->Enable(false);
             m_pPageCollLB->Enable(false);
-            m_pPageNoFT->Enable(false);
+            m_pPageNoCB->Enable(false);
             m_pPageNoNF->Enable(false);
             m_pPgBrkRB->       Enable(false);
             m_pColBrkRB->      Enable(false);
@@ -1730,8 +1742,8 @@ IMPL_LINK_NOARG(SwTextFlowPage, ApplyCollClickHdl_Impl, 
Button*, void)
     m_pPageCollLB->Enable(bEnable);
     if(!bHtmlMode)
     {
-        m_pPageNoFT->Enable(bEnable);
-        m_pPageNoNF->Enable(bEnable);
+        m_pPageNoCB->Enable(bEnable);
+        m_pPageNoNF->Enable(bEnable && m_pPageNoCB->IsChecked());
     }
 }
 
@@ -1749,8 +1761,8 @@ IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, Button*, 
pBtn, void )
             m_pPageCollLB->Enable(bEnable);
             if(!bHtmlMode)
             {
-                m_pPageNoFT->Enable(bEnable);
-                m_pPageNoNF->Enable(bEnable);
+                m_pPageNoCB->Enable(bEnable);
+                m_pPageNoNF->Enable(bEnable && m_pPageNoCB->IsChecked());
             }
         }
         else if (pBtn == m_pPgBrkAfterRB)
@@ -1758,7 +1770,7 @@ IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, Button*, 
pBtn, void )
             m_pPageCollCB->Check( false );
             m_pPageCollCB->Enable(false);
             m_pPageCollLB->Enable(false);
-            m_pPageNoFT->Enable(false);
+            m_pPageNoCB->Enable(false);
             m_pPageNoNF->Enable(false);
         }
     }
@@ -1771,13 +1783,18 @@ IMPL_LINK( SwTextFlowPage, PageBreakTypeHdl_Impl, 
Button*, pBtn, void )
         m_pPageCollCB->Check(false);
         m_pPageCollCB->Enable(false);
         m_pPageCollLB->Enable(false);
-        m_pPageNoFT->Enable(false);
+        m_pPageNoCB->Enable(false);
         m_pPageNoNF->Enable(false);
     }
     else if ( m_pPgBrkBeforeRB->IsChecked() )
         PageBreakPosHdl_Impl(m_pPgBrkBeforeRB);
 }
 
+IMPL_LINK_NOARG(SwTextFlowPage, PageNoClickHdl_Impl, Button*, void)
+{
+    m_pPageNoNF->Enable(m_pPageNoCB->IsChecked());
+}
+
 IMPL_LINK( SwTextFlowPage, SplitHdl_Impl, Button*, pBox, void )
 {
     m_pSplitRowCB->Enable(static_cast<CheckBox*>(pBox)->IsChecked());
@@ -1804,7 +1821,7 @@ void SwTextFlowPage::DisablePageBreak()
     m_pPgBrkAfterRB->Disable();
     m_pPageCollCB->Disable();
     m_pPageCollLB->Disable();
-    m_pPageNoFT->Disable();
+    m_pPageNoCB->Disable();
     m_pPageNoNF->Disable();
 }
 
diff --git a/sw/source/uibase/table/tablepg.hxx 
b/sw/source/uibase/table/tablepg.hxx
index 63a2707..1a9ebb6 100644
--- a/sw/source/uibase/table/tablepg.hxx
+++ b/sw/source/uibase/table/tablepg.hxx
@@ -155,7 +155,7 @@ class SwTextFlowPage : public SfxTabPage
 
     VclPtr<CheckBox>       m_pPageCollCB;
     VclPtr<ListBox>        m_pPageCollLB;
-    VclPtr<FixedText>      m_pPageNoFT;
+    VclPtr<CheckBox>       m_pPageNoCB;
     VclPtr<NumericField>   m_pPageNoNF;
     VclPtr<CheckBox>       m_pSplitCB;
     VclPtr<TriStateBox>    m_pSplitRowCB;
@@ -176,6 +176,7 @@ class SwTextFlowPage : public SfxTabPage
     DECL_LINK(ApplyCollClickHdl_Impl, Button*, void);
     DECL_LINK( PageBreakPosHdl_Impl, Button*, void );
     DECL_LINK( PageBreakTypeHdl_Impl, Button*, void );
+    DECL_LINK(PageNoClickHdl_Impl, Button*, void);
     DECL_LINK( SplitHdl_Impl, Button*, void );
     DECL_STATIC_LINK( SwTextFlowPage, SplitRowHdl_Impl, Button*, void );
     DECL_LINK( HeadLineCBClickHdl, Button* = nullptr, void );
diff --git a/sw/uiconfig/swriter/ui/tabletextflowpage.ui 
b/sw/uiconfig/swriter/ui/tabletextflowpage.ui
index 76b2f3c..4cbc99c0 100644
--- a/sw/uiconfig/swriter/ui/tabletextflowpage.ui
+++ b/sw/uiconfig/swriter/ui/tabletextflowpage.ui
@@ -6,6 +6,7 @@
     <property name="upper">9999</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="value">1</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
     <property name="upper">100</property>
@@ -203,6 +204,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
+                        <property name="margin_left">22</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -216,12 +218,11 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="pagenoft">
+                      <object class="GtkCheckButton" id="pagenoft">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can_focus">True</property>
                         <property name="label" translatable="yes">Page 
_number</property>
                         <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">pagenonf</property>
                       </object>
                       <packing>
                         <property name="left_attach">2</property>
@@ -234,6 +235,9 @@
                         <property name="can_focus">True</property>
                         <property name="invisible_char">•</property>
                         <property name="adjustment">adjustment1</property>
+                        <accessibility>
+                          <relation type="labelled-by" target="pagenoft"/>
+                        </accessibility>
                       </object>
                       <packing>
                         <property name="left_attach">3</property>
commit 007e060c569ab87f89096cab32fbd7fd336e18c7
Author: Michael Meeks <michael.me...@collabora.com>
Date:   Wed Mar 1 15:13:19 2017 +0000

    Tolerate mouse move generation on disposed windows.
    
    
http://crashreport.libreoffice.org/stats/crash_details/524d28fb-4fd2-4d11-83b1-1360b5ab5068
    
    Change-Id: I19a13f751b5cf000c9938ff991d7d44bba0a4de7
    Reviewed-on: https://gerrit.libreoffice.org/34756
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Michael Meeks <michael.me...@collabora.com>
    (cherry picked from commit a9be0b6a4e39240871a9b35ae9afd04f242a3ea4)
    Reviewed-on: https://gerrit.libreoffice.org/34757
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit e2eb25a52d86eec868ace658dd3a27eaf536b311)

diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index adea785..a2a214b 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -160,7 +160,8 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool 
bModChanged )
 
 void Window::ImplGenerateMouseMove()
 {
-    if ( !mpWindowImpl->mpFrameData->mnMouseMoveId )
+    if ( mpWindowImpl && mpWindowImpl->mpFrameData &&
+         !mpWindowImpl->mpFrameData->mnMouseMoveId )
         mpWindowImpl->mpFrameData->mnMouseMoveId = Application::PostUserEvent( 
LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ), nullptr, 
true );
 }
 
commit 77d6732e1bc58588c9f8be84e70e34e68dbcb62b
Author: Tor Lillqvist <t...@collabora.com>
Date:   Wed Feb 22 17:13:13 2017 +0200

    Put also the LICENSE file in Resources on macOS
    
    Follow-up: Fix gb_Extension_LICENSEFILE_DEFAULT.
    
    Change-Id: Ia4888050099e74b93af67c58e988b4ae9e2516a1
    (cherry picked from commit 3c946d688627ba0c31bcb37dfed4e6e180608854)
    (cherry picked from commit c0c3575f7434712d294ccb0eaa7f49bf845437e0)
    Reviewed-on: https://gerrit.libreoffice.org/34758
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledho...@eglug.org>
    (cherry picked from commit 578c0236017833641d645a47dbaa7ae0e61e3a2d)

diff --git a/readlicense_oo/Package_files.mk b/readlicense_oo/Package_files.mk
index 1fa672d..fc0b34c 100644
--- a/readlicense_oo/Package_files.mk
+++ b/readlicense_oo/Package_files.mk
@@ -12,7 +12,11 @@ $(eval $(call 
gb_Package_Package,readlicense_oo_files,$(SRCDIR)/readlicense_oo/l
 # LICENSE (upper case) is copied without EOL conversion
 # license.txt is converted, prior to copy, see Package_license.mk
 ifneq ($(OS),WNT)
+ifneq ($(OS),MACOSX)
 $(eval $(call gb_Package_add_file,readlicense_oo_files,LICENSE,LICENSE))
+else
+$(eval $(call 
gb_Package_add_file,readlicense_oo_files,Resources/LICENSE,LICENSE))
+endif
 endif
 
 ifneq ($(OS),MACOSX)
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 9bf18c3..626f399 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -334,7 +334,7 @@ gb_CliAssemblyTarget_get_dll :=
 
 # Extension class
 
-gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE
+gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/Resources/LICENSE
 
 # UnpackedTarget class
 
commit fa28cb86dfc33b6b8bd17472bf5177ffb0f23014
Author: Michael Stahl <mst...@redhat.com>
Date:   Wed Mar 1 12:39:54 2017 +0100

    tdf#77111 cui,sw: fix page number offset on paragraph dialog "Text Flow"
    
    Commit c2ccd20c0fd92bddfff76447754541705e3eb8f3 introduced 0 as a valid
    value for page number offset in sw core.
    
    Unfortunately the paragraph dialog was not changed then; previously
    page number 0 would do automatic numbering, but since then 0 was set as
    the offset, and once you have a 0 offset there's no easy way to remove
    it, you have to remove the whole page break.
    
    * change the label before the text number edit widget to a checkbox
      that disables the edit widget
    
    * keep the id "labelPageNum" so that translations still work
    
    * adapt SfxToSwPageDescAttr so it can not just set but also clear the
      page number
    
    * set initial value to 1; 0 is a really bad default since we can't
      export it to ODF (see tdf#91306)
    
    Change-Id: Ic4ca9e2562bb65ac359b305a2202f782e8598307
    (cherry picked from commit d36fa0589ab822dc617c65b4d0d3bf68c092ad37)
    Reviewed-on: https://gerrit.libreoffice.org/34745
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit a5104f575a5acf8aea957cb79aa0fd67bc74f141)

diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index c38f65a..abe414a 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -234,7 +234,7 @@ private:
     VclPtr<ListBox>            m_pBreakPositionLB;
     VclPtr<TriStateBox>        m_pApplyCollBtn;
     VclPtr<ListBox>            m_pApplyCollBox;
-    VclPtr<FixedText>          m_pPagenumText;
+    VclPtr<TriStateBox>        m_pPageNumBox;
     VclPtr<NumericField>       m_pPagenumEdit;
 
     // paragraph division
@@ -262,6 +262,7 @@ private:
     DECL_LINK(ApplyCollClickHdl_Impl, Button*, void);
     DECL_LINK( PageBreakPosHdl_Impl, ListBox&, void );
     DECL_LINK( PageBreakTypeHdl_Impl, ListBox&, void );
+    DECL_LINK(PageNumBoxClickHdl_Impl, Button*, void);
 
     virtual void            PageCreated(const SfxAllItemSet& aSet) override;
 };
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 2f63044..5a26a65 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1402,18 +1402,27 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
         }
     }
 
-    if (m_pPagenumEdit->IsEnabled() && m_pPagenumEdit->IsValueModified())
+    if (m_pPageNumBox->IsEnabled()
+        && (m_pPageNumBox->IsValueChangedFromSaved() || 
m_pPagenumEdit->IsValueModified()))
     {
-        SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM,
-                                (sal_uInt16)m_pPagenumEdit->GetValue() );
-
         pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGENUM );
 
-        if ( !pOld || static_cast<const SfxUInt16Item*>(pOld)->GetValue() != 
aPageNum.GetValue() )
+        if (TRISTATE_TRUE == m_pPageNumBox->GetState()
+            && (!pOld || IsInvalidItem(pOld)
+                || static_cast<const SfxUInt16Item*>(pOld)->GetValue() != 
m_pPagenumEdit->GetValue()))
         {
+            SfxUInt16Item aPageNum(SID_ATTR_PARA_PAGENUM,
+                    static_cast<sal_uInt16>(m_pPagenumEdit->GetValue()));
             rOutSet->Put( aPageNum );
             bModified = true;
         }
+        else if (TRISTATE_FALSE == m_pPageNumBox->GetState()
+                && (pOld || IsInvalidItem(pOld)))
+        {
+            // need to tell sw to remove the item
+            rOutSet->DisableItem(SID_ATTR_PARA_PAGENUM);
+            bModified = true;
+        }
     }
 
     // pagebreak
@@ -1605,11 +1614,34 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* 
rSet )
 
     _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
 
-    if (rSet->GetItemState(_nWhich) >= SfxItemState::SET)
+    switch (rSet->GetItemState(_nWhich))
     {
-        const sal_uInt16 nPageNum =
-            static_cast<const SfxUInt16Item&>(rSet->Get( _nWhich ) 
).GetValue();
-        m_pPagenumEdit->SetValue( nPageNum );
+        case SfxItemState::SET:
+        {
+            m_pPageNumBox->EnableTriState(false);
+            m_pPageNumBox->SetState(TRISTATE_TRUE);
+            SfxUInt16Item const*const pItem(static_cast<const 
SfxUInt16Item*>(rSet->GetItem(_nWhich)));
+            const sal_uInt16 nPageNum(pItem->GetValue());
+            m_pPagenumEdit->SetValue( nPageNum );
+            break;
+        }
+        case SfxItemState::DONTCARE:
+        {
+            m_pPageNumBox->EnableTriState();
+            m_pPageNumBox->SetState(TRISTATE_INDET);
+            break;
+        }
+        case SfxItemState::UNKNOWN:
+        case SfxItemState::DEFAULT:
+        case SfxItemState::DISABLED:
+        {
+            m_pPageNumBox->EnableTriState(false);
+            m_pPageNumBox->SetState(TRISTATE_FALSE);
+            break;
+        }
+        default:
+            assert(false); // unexpected
+            break;
     }
 
     if ( bPageBreak )
@@ -1665,7 +1697,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* 
rSet )
             m_pApplyCollBtn->Enable(false);
             m_pApplyCollBox->Enable(false);
             m_pPagenumEdit->Enable(false);
-            m_pPagenumText->Enable(false);
+            m_pPageNumBox->Enable(false);
         }
 
         if ( !bIsPageModel )
@@ -1698,6 +1730,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* 
rSet )
                 if(!_bEnable)
                 {
                     m_pApplyCollBox->Enable(_bEnable);
+                    m_pPageNumBox->Enable(false);
                     m_pPagenumEdit->Enable(_bEnable);
                 }
 
@@ -1845,6 +1878,7 @@ void SvxExtParagraphTabPage::ChangesApplied()
     m_pBreakTypeLB->SaveValue();
     m_pApplyCollBtn->SaveValue();
     m_pApplyCollBox->SaveValue();
+    m_pPageNumBox->SaveValue();
     m_pPagenumEdit->SaveValue();
     m_pKeepTogetherBox->SaveValue();
     m_pKeepParaBox->SaveValue();
@@ -1870,6 +1904,7 @@ void SvxExtParagraphTabPage::DisablePageBreak()
     m_pBreakPositionLB->Enable(false);
     m_pApplyCollBtn->Enable(false);
     m_pApplyCollBox->Enable(false);
+    m_pPageNumBox->Enable(false);
     m_pPagenumEdit->Enable(false);
 }
 
@@ -1898,7 +1933,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( 
vcl::Window* pParent, const SfxI
     get(m_pPagenumEdit,"spinPageNumber");
     get(m_pBreakTypeFT,"labelType");
     get(m_pBreakPositionFT,"labelPosition");
-    get(m_pPagenumText,"labelPageNum");
+    get(m_pPageNumBox,"labelPageNum");
 
     // Options
     get(m_pKeepTogetherBox,"checkSplitPara");
@@ -1923,6 +1958,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( 
vcl::Window* pParent, const SfxI
     m_pApplyCollBtn->SetClickHdl(      LINK( this, SvxExtParagraphTabPage, 
ApplyCollClickHdl_Impl ) );
     m_pBreakTypeLB->SetSelectHdl(      LINK( this, SvxExtParagraphTabPage, 
PageBreakTypeHdl_Impl ) );
     m_pBreakPositionLB->SetSelectHdl(  LINK( this, SvxExtParagraphTabPage, 
PageBreakPosHdl_Impl ) );
+    m_pPageNumBox->SetClickHdl(        LINK( this, SvxExtParagraphTabPage, 
PageNumBoxClickHdl_Impl ) );
 
     SfxObjectShell* pSh = SfxObjectShell::Current();
     if ( pSh )
@@ -1954,7 +1990,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( 
vcl::Window* pParent, const SfxI
         m_pExtHyphenAfterBox   ->Enable(false);
         m_pMaxHyphenLabel      ->Enable(false);
         m_pMaxHyphenEdit       ->Enable(false);
-        m_pPagenumText         ->Enable(false);
+        m_pPageNumBox          ->Enable(false);
         m_pPagenumEdit         ->Enable(false);
         // no column break in HTML
         m_pBreakTypeLB->RemoveEntry(1);
@@ -1982,7 +2018,7 @@ void SvxExtParagraphTabPage::dispose()
     m_pBreakPositionLB.clear();
     m_pApplyCollBtn.clear();
     m_pApplyCollBox.clear();
-    m_pPagenumText.clear();
+    m_pPageNumBox.clear();
     m_pPagenumEdit.clear();
     m_pKeepTogetherBox.clear();
     m_pKeepParaBox.clear();
@@ -2015,8 +2051,8 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, 
PageBreakHdl_Impl, Button*, void)
                 m_pApplyCollBox->Enable(bEnable);
                 if(!bHtmlMode)
                 {
-                    m_pPagenumText->Enable(bEnable);
-                    m_pPagenumEdit->Enable(bEnable);
+                    m_pPageNumBox->Enable(bEnable);
+                    m_pPagenumEdit->Enable(bEnable && 
m_pPageNumBox->GetState() == TRISTATE_TRUE);
                 }
             }
             break;
@@ -2026,7 +2062,7 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, 
PageBreakHdl_Impl, Button*, void)
             m_pApplyCollBtn->SetState( TRISTATE_FALSE );
             m_pApplyCollBtn->Enable(false);
             m_pApplyCollBox->Enable(false);
-            m_pPagenumText->Enable(false);
+            m_pPageNumBox->Enable(false);
             m_pPagenumEdit->Enable(false);
             m_pBreakTypeFT->Enable(false);
             m_pBreakTypeLB->Enable(false);
@@ -2116,8 +2152,8 @@ IMPL_LINK_NOARG(SvxExtParagraphTabPage, 
ApplyCollClickHdl_Impl, Button*, void)
     m_pApplyCollBox->Enable(bEnable);
     if(!bHtmlMode)
     {
-        m_pPagenumText->Enable(bEnable);
-        m_pPagenumEdit->Enable(bEnable);
+        m_pPageNumBox->Enable(bEnable);
+        m_pPagenumEdit->Enable(bEnable && m_pPageNumBox->GetState() == 
TRISTATE_TRUE);
     }
 }
 
@@ -2133,8 +2169,8 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, 
ListBox&, rListBox, voi
         m_pApplyCollBox->Enable(bEnable);
         if(!bHtmlMode)
         {
-            m_pPagenumText->Enable(bEnable);
-            m_pPagenumEdit->Enable(bEnable);
+            m_pPageNumBox->Enable(bEnable);
+            m_pPagenumEdit->Enable(bEnable && m_pPageNumBox->GetState() == 
TRISTATE_TRUE);
         }
     }
     else if ( 1 == rListBox.GetSelectEntryPos() )
@@ -2142,7 +2178,7 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, 
ListBox&, rListBox, voi
         m_pApplyCollBtn->SetState( TRISTATE_FALSE );
         m_pApplyCollBtn->Enable(false);
         m_pApplyCollBox->Enable(false);
-        m_pPagenumText->Enable(false);
+        m_pPageNumBox->Enable(false);
         m_pPagenumEdit->Enable(false);
     }
 }
@@ -2156,13 +2192,18 @@ IMPL_LINK( SvxExtParagraphTabPage, 
PageBreakTypeHdl_Impl, ListBox&, rListBox, vo
         m_pApplyCollBtn->SetState( TRISTATE_FALSE );
         m_pApplyCollBtn->Enable(false);
         m_pApplyCollBox->Enable(false);
-        m_pPagenumText->Enable(false);
+        m_pPageNumBox->Enable(false);
         m_pPagenumEdit->Enable(false);
     }
     else
         PageBreakPosHdl_Impl( *m_pBreakPositionLB );
 }
 
+IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageNumBoxClickHdl_Impl, Button*, void)
+{
+    m_pPagenumEdit->Enable(m_pPageNumBox->GetState() == TRISTATE_TRUE);
+}
+
 void SvxExtParagraphTabPage::PageCreated(const SfxAllItemSet& aSet)
 {
     const SfxBoolItem* pDisablePageBreakItem = 
aSet.GetItem<SfxBoolItem>(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK, false);
diff --git a/cui/uiconfig/ui/textflowpage.ui b/cui/uiconfig/ui/textflowpage.ui
index 6a0d14d..8ce7a43 100644
--- a/cui/uiconfig/ui/textflowpage.ui
+++ b/cui/uiconfig/ui/textflowpage.ui
@@ -18,6 +18,7 @@
     <property name="upper">9999</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
+    <property name="value">1</property>
   </object>
   <object class="GtkGrid" id="TextFlowPage">
     <property name="visible">True</property>
@@ -243,6 +244,9 @@
                     <property name="can_focus">True</property>
                     <property name="invisible_char">•</property>
                     <property name="adjustment">adjustment3</property>
+                    <accessibility>
+                      <relation type="labelled-by" target="labelPageNum"/>
+                    </accessibility>
                   </object>
                   <packing>
                     <property name="left_attach">4</property>
@@ -250,13 +254,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="labelPageNum">
+                  <object class="GtkCheckButton" id="labelPageNum">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can_focus">True</property>
                     <property name="label" translatable="yes">Page 
_number:</property>
                     <property name="use_underline">True</property>
+                    <property name="inconsistent">True</property>
                     <property name="justify">right</property>
-                    <property name="mnemonic_widget">spinPageNumber</property>
                     <property name="xalign">1</property>
                   </object>
                   <packing>
diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index d40e71c..9783a63 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -600,10 +600,25 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, 
SfxItemSet& rSet )
 
     bool bChanged = false;
     // Page number
-    if(SfxItemState::SET == rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, 
&pItem))
+    switch (rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem))
     {
-        aPgDesc.SetNumOffset(static_cast<const 
SfxUInt16Item*>(pItem)->GetValue());
-        bChanged = true;
+        case SfxItemState::SET:
+        {
+            aPgDesc.SetNumOffset(static_cast<const 
SfxUInt16Item*>(pItem)->GetValue());
+            bChanged = true;
+            break;
+        }
+        case SfxItemState::DISABLED:
+        {
+            bChanged = true; // default initialised aPgDesc clears the number
+            break;
+        }
+        case SfxItemState::UNKNOWN:
+        case SfxItemState::DEFAULT:
+            break;
+        default:
+            assert(false); // unexpected
+            break;
     }
     if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, false, 
&pItem ))
     {
commit 10b61e9aa6e65bc75f9180b4629ff1952bfd8789
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Fri Feb 3 01:56:42 2017 +0530

    tdf#51358 Importing ClockWipe in SVG engine
    
    Most of the constants and transition info table were already
    written, i just added the perform method.
    
    Change-Id: Ib8e2d8e7ca7e26dc54a1e309a2b6271ee7603f34
    Reviewed-on: https://gerrit.libreoffice.org/33847
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit 74b54e33135bb99513142e671369e4f3f6370d55)

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index bcf8b38..2bd2de0 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -9377,6 +9377,8 @@ function createClipPolyPolygon( nType, nSubtype )
                     return null;
             }
             return new PinWheelWipePath( nBlades );
+        case CLOCKWIPE_TRANSITION:
+            return new ClockWipePath();
         case RANDOMBARWIPE_TRANSITION:
             return new RandomWipePath( 128, true /* bars */ );
         case CHECKERBOARDWIPE_TRANSITION:
@@ -9619,7 +9621,19 @@ EllipseWipePath.prototype.perform = function( nT )
 };
 
 
+/**
+ * Class ClockWipePath
+ *
+ */
+function ClockWipePath() { }
 
+ClockWipePath.prototype.perform = function( nT ) {
+    const aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 
0.5).translate(0.5, 0.5);
+    var aPolyPath = PinWheelWipePath.calcCenteredClock(nT, 1.0);
+    aPolyPath.matrixTransform( aTransform );
+
+    return aPolyPath;
+}
 
 /** Class PinWheelWipePath
  *  This class handles a parametric poly-path that is used for performing
commit 1ddf1896e574ffc28e2fa8177e3af623f4a41ec8
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Tue Jan 31 23:27:07 2017 +0530

    tdf#51358 Support for VeeWipe transition in SVG Support
    
    Ported the class Veewipe
    
    Change-Id: I13b9d7235967e3dd1b1b1638c27e76d11708d1e0
    Reviewed-on: https://gerrit.libreoffice.org/33764
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit b5b6317e4e35a2a1a81c90dda6e6e4e5457471ee)

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index fb88588..bcf8b38 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5154,6 +5154,7 @@ CHECKERBOARDWIPE_TRANSITION = 11; // 39
 DISSOLVE_TRANSITION         = 12; // 40
 SNAKEWIPE_TRANSITION        = 13; // 30
 IRISWIPE_TRANSITION         = 14; // 12
+VEEWIPE_TRANSITION          = 17; // 8
 
 aTransitionTypeInMap = {
     'barWipe'           : BARWIPE_TRANSITION,
@@ -5169,7 +5170,8 @@ aTransitionTypeInMap = {
     'checkerBoardWipe'  : CHECKERBOARDWIPE_TRANSITION,
     'dissolve'          : DISSOLVE_TRANSITION,
     'snakeWipe'         : SNAKEWIPE_TRANSITION,
-    'irisWipe'          : IRISWIPE_TRANSITION
+    'irisWipe'          : IRISWIPE_TRANSITION,
+    'veeWipe'           : VEEWIPE_TRANSITION
 };
 
 aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 
'ellipseWipe',
@@ -5227,6 +5229,9 @@ TOPCENTER_TRANS_SUBTYPE             = 40; // 7
 RIGHTCENTER_TRANS_SUBTYPE           = 41; // 8
 BOTTOMCENTER_TRANS_SUBTYPE          = 42; // 9
 LEFTCENTER_TRANS_SUBTYPE            = 43; // 10
+LEFT_TRANS_SUBTYPE                  = 44; // 20
+UP_TRANS_SUBTYPE                    = 45; // 21
+RIGHT_TRANS_SUBTYPE                 = 46; // 22
 
 aTransitionSubtypeInMap = {
     'default'           : DEFAULT_TRANS_SUBTYPE,
@@ -5272,7 +5277,10 @@ aTransitionSubtypeInMap = {
     'topCenter'         : TOPCENTER_TRANS_SUBTYPE,
     'rightCenter'       : RIGHTCENTER_TRANS_SUBTYPE,
     'bottomCenter'      : BOTTOMCENTER_TRANS_SUBTYPE,
-    'leftCenter'        : LEFTCENTER_TRANS_SUBTYPE
+    'leftCenter'        : LEFTCENTER_TRANS_SUBTYPE,
+    'left'              : LEFT_TRANS_SUBTYPE,
+    'up'                : UP_TRANS_SUBTYPE,
+    'right'             : RIGHT_TRANS_SUBTYPE
 };
 
 aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 
'cornersIn',
@@ -5610,6 +5618,48 @@ 
aTransitionInfoTable[CLOCKWIPE_TRANSITION][CLOCKWISENINE_TRANS_SUBTYPE] =
     'scaleIsotropically' : false
 };
 
+aTransitionInfoTable[VEEWIPE_TRANSITION] = {};
+aTransitionInfoTable[VEEWIPE_TRANSITION][DOWN_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[VEEWIPE_TRANSITION][LEFT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[VEEWIPE_TRANSITION][UP_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[VEEWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : -90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION] = {};
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION][ONEBLADE_TRANS_SUBTYPE] =
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEVERTICAL_TRANS_SUBTYPE] =
@@ -9344,6 +9394,8 @@ function createClipPolyPolygon( nType, nSubtype )
             }
         case DISSOLVE_TRANSITION:
             return new RandomWipePath( 16 * 16, false /* dissolve */ );
+        case VEEWIPE_TRANSITION:
+            return new VeeWipePath();
         case SNAKEWIPE_TRANSITION:
             return new SnakeWipePath( 8 * 8, // diagonal
                                              nSubtype == 
TOPLEFTDIAGONAL_TRANS_SUBTYPE     ||
@@ -10004,6 +10056,24 @@ RandomWipePath.prototype.perform = function( nT )
     return this.aClipPath.cloneNode( true );
 };
 
+/** Class VeeWipePath
+  *
+  */
+function VeeWipePath() { }
+
+VeeWipePath.prototype.perform = function( nT ) {
+    const d = pruneScaleValue(2.0 * nT);
+    var polyPath = 'M ' + 0.0 + ' ' + -1.0 + ' ';
+    polyPath += 'L ' + 0.0 + ' ' + (d - 1.0) + ' ';
+    polyPath += 'L ' + 0.5 + ' ' + d + ' ';
+    polyPath += 'L ' + 1.0 + ' ' + (d - 1.0) + ' ';
+    polyPath += 'L ' + 1.0 + ' ' + -1.0 + ' ';
+    polyPath += 'L ' + 0.0 + ' ' + -1.0 + ' ';
+
+    var aPolyPolyPath = document.createElementNS( NSS['svg'], 'path');
+    aPolyPolyPath.setAttribute('d', polyPath);
+    return aPolyPolyPath;
+}
 
 
 /** Class AnimatedSlide
commit a54355fd6fe5e1aaa5d90fcf0f7f27fbef2eb28e
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Tue Jan 24 01:40:55 2017 +0530

    tdf#51358 Support for SnakeWipe transition animation in SVG support
    
    ported the class SnakeWipe.
    
    Change-Id: Icb41072bbd276e0edf3ef2ecea6148c81110b53e
    Reviewed-on: https://gerrit.libreoffice.org/23285
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit 6e901f86511bd773c1b80f5aebe435f29527e118)

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index df69b14..fb88588 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4558,6 +4558,12 @@ SVGPathElement.prototype.appendPath = function( aPath )
     this.setAttribute( 'd', sPathData );
 };
 
+function flipOnYAxis( aPath )
+{
+    var aMatrix = SVGIdentityMatrix.scaleNonUniform(-1, 1).translate(1, 0);
+    aPath.matrixTransform(aMatrix);
+    return aPath;
+}
 /** SVGPathElement.matrixTransform
  *  Apply the transformation defined by the passed matrix to the referenced
  *  svg <path> element.
@@ -5146,6 +5152,7 @@ FADE_TRANSITION             = 9; // 37
 RANDOMBARWIPE_TRANSITION    = 10; // 38
 CHECKERBOARDWIPE_TRANSITION = 11; // 39
 DISSOLVE_TRANSITION         = 12; // 40
+SNAKEWIPE_TRANSITION        = 13; // 30
 IRISWIPE_TRANSITION         = 14; // 12
 
 aTransitionTypeInMap = {
@@ -5161,6 +5168,7 @@ aTransitionTypeInMap = {
     'randomBarWipe'     : RANDOMBARWIPE_TRANSITION,
     'checkerBoardWipe'  : CHECKERBOARDWIPE_TRANSITION,
     'dissolve'          : DISSOLVE_TRANSITION,
+    'snakeWipe'         : SNAKEWIPE_TRANSITION,
     'irisWipe'          : IRISWIPE_TRANSITION
 };
 
@@ -5203,6 +5211,12 @@ THREEBLADE_TRANS_SUBTYPE            = 24;
 EIGHTBLADE_TRANS_SUBTYPE            = 25;
 ONEBLADE_TRANS_SUBTYPE              = 26; // 107
 ACROSS_TRANS_SUBTYPE                = 27;
+TOPLEFTVERTICAL_TRANS_SUBTYPE       = 28; // 109
+TOPLEFTHORIZONTAL_TRANS_SUBTYPE     = 29; // 64
+TOPLEFTDIAGONAL_TRANS_SUBTYPE       = 30; // 65
+TOPRIGHTDIAGONAL_TRANS_SUBTYPE      = 31; // 66
+BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE   = 32; // 67
+BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE    = 33; // 68
 RECTANGLE_TRANS_SUBTYPE             = 34; // 101
 DIAMOND_TRANS_SUBTYPE               = 35; // 102
 TOPLEFT_TRANS_SUBTYPE               = 36  // 3
@@ -5214,7 +5228,6 @@ RIGHTCENTER_TRANS_SUBTYPE           = 41; // 8
 BOTTOMCENTER_TRANS_SUBTYPE          = 42; // 9
 LEFTCENTER_TRANS_SUBTYPE            = 43; // 10
 
-
 aTransitionSubtypeInMap = {
     'default'           : DEFAULT_TRANS_SUBTYPE,
     'leftToRight'       : LEFTTORIGHT_TRANS_SUBTYPE,
@@ -5244,6 +5257,12 @@ aTransitionSubtypeInMap = {
     'eightBlade'        : EIGHTBLADE_TRANS_SUBTYPE,
     'oneBlade'          : ONEBLADE_TRANS_SUBTYPE,
     'across'            : ACROSS_TRANS_SUBTYPE,
+    'topLeftVertical'   : TOPLEFTVERTICAL_TRANS_SUBTYPE,
+    'topLeftHorizontal' : TOPLEFTHORIZONTAL_TRANS_SUBTYPE,
+    'topLeftDiagonal'   : TOPLEFTDIAGONAL_TRANS_SUBTYPE,
+    'topRightDiagonal'  : TOPRIGHTDIAGONAL_TRANS_SUBTYPE,
+    'bottomRightDiagonal': BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE,
+    'bottomLeftDiagonal': BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE,
     'rectangle'         : RECTANGLE_TRANS_SUBTYPE,
     'diamond'           : DIAMOND_TRANS_SUBTYPE,
     'topLeft'           : TOPLEFT_TRANS_SUBTYPE,
@@ -5315,6 +5334,68 @@ aTransitionInfoTable[0][0] =
     'scaleIsotropically' : false
 };
 
+aTransitionInfoTable[SNAKEWIPE_TRANSITION] = {};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTVERTICAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : -90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTHORIZONTAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTDIAGONAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPRIGHTDIAGONAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[SNAKEWIPE_TRANSITION][BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_ROTATE_180,
+    'outInvertSweep' : true,
+    'scaleIsotropically' : false
+};
+
 aTransitionInfoTable[IRISWIPE_TRANSITION] = {};
 aTransitionInfoTable[IRISWIPE_TRANSITION][RECTANGLE_TRANS_SUBTYPE] =
 {
@@ -9263,6 +9344,17 @@ function createClipPolyPolygon( nType, nSubtype )
             }
         case DISSOLVE_TRANSITION:
             return new RandomWipePath( 16 * 16, false /* dissolve */ );
+        case SNAKEWIPE_TRANSITION:
+            return new SnakeWipePath( 8 * 8, // diagonal
+                                             nSubtype == 
TOPLEFTDIAGONAL_TRANS_SUBTYPE     ||
+                                             nSubtype == 
TOPRIGHTDIAGONAL_TRANS_SUBTYPE    ||
+                                             nSubtype == 
BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE ||
+                                             nSubtype == 
BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE   ,
+                                             // flipOnYAxis
+                                             nSubtype == 
TOPLEFTVERTICAL_TRANS_SUBTYPE     ||
+                                             nSubtype == 
TOPRIGHTDIAGONAL_TRANS_SUBTYPE    ||
+                                             nSubtype == 
BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE
+                                             );
     }
 }
 
@@ -9684,6 +9776,194 @@ function RandomWipePath( nElements, bRandomBars )
     }
 }
 
+/** Class SnakeWipeSlide
+ *
+ *  @param nElements
+ *  @param bDiagonal
+ *  @param bFlipOnYaxis
+ */
+function SnakeWipePath(nElements, bDiagonal, bflipOnYAxis)
+{
+    this.sqrtElements = Math.floor(Math.sqrt(nElements));
+    this.elementEdge  = (1.0 / this.sqrtElements);
+    this.diagonal     = bDiagonal;
+    this.flipOnYAxis  = bflipOnYAxis;
+    this.aBasePath    = createUnitSquarePath();
+}
+
+SnakeWipePath.prototype.calcSnake = function(t)
+{
+    var aPolyPath = createEmptyPath();
+    var res = this.aBasePath.cloneNode(true);
+    var area   = (t * this.sqrtElements * this.sqrtElements);
+    var line_  = Math.floor(area / this.sqrtElements);
+    var line   = pruneScaleValue(line_ / this.sqrtElements);
+    var col    = pruneScaleValue((area - (line_ * this.sqrtElements)) / 
this.sqrtElements);
+    var aTransform;
+
+    if(line != 0) {
+        var aPoint = document.documentElement.createSVGPoint();
+        var aPath = 'M '+ aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = line;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = 1.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = 0.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPath += 'L 0 0 ';
+        var poly = document.createElementNS( NSS['svg'], 'path');
+        poly.setAttribute('d', aPath);
+        aPolyPath.appendPath(poly);
+    }
+    if(col != 0) {
+        var offset = 0.0;
+        if((line_ & 1) == 1) {
+            // odd line: => right to left
+            offset = (1.0 - col);
+        }
+        var aPoint = document.documentElement.createSVGPoint();
+        aPoint.x = offset;
+        aPoint.y = line;
+        var aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y += this.elementEdge;
+        aPath += 'L '+ aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = offset + col;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = line;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = offset;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        var poly = document.createElementNS( NSS['svg'], 'path');
+        poly.setAttribute('d', aPath);
+        aPolyPath.appendPath(poly);
+    }
+
+    return aPolyPath;
+}
+
+SnakeWipePath.prototype.calcHalfDiagonalSnake = function(nT, bIn) {
+    var res = createEmptyPath(), aTransform;
+
+    if(bIn) {
+        const sqrtArea2 = Math.sqrt(nT * this.sqrtElements * 
this.sqrtElements);
+        const edge = pruneScaleValue(sqrtArea2 / this.sqrtElements);
+
+        var aPath, aPoint = document.documentElement.createSVGPoint();
+        if(edge) {
+            aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.y = edge;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.x = edge;
+            aPoint.y = 0.0;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.x = 0.0;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            var poly = document.createElementNS( NSS['svg'], 'path');
+            poly.setAttribute('d', aPath);
+            res.appendPath(poly);
+        }
+        const a = (Math.SQRT1_2 / this.sqrtElements);
+        const d = (sqrtArea2 - Math.floor(sqrtArea2));
+        const len = (nT * Math.SQRT1_2 * d);
+        const height = pruneScaleValue(Math.SQRT1_2 / this.sqrtElements);
+        aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = height;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = len + a;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = 0.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = 0.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        var poly = document.createElementNS( NSS['svg'], 'path');
+        poly.setAttribute('d', aPath);
+        var aTransform;
+
+        if((Math.floor(sqrtArea2) & 1) == 1) {
+            // odd line
+            aTransform = SVGIdentityMatrix.rotate((Math.PI)/2 + (Math.PI)/4);
+            aTransform.translate(edge + this.elementEdge, 0.0);
+        }
+        else {
+            aTransform = SVGIdentityMatrix.translate(-a, 0.0);
+            aTransform.rotate(-(Math.PI/4));
+            aTransform.translate(0.0, edge);
+        }
+
+        poly.matrixTransform(aTransform);
+        res.appendPath(poly);
+    }
+    else { //out
+        const sqrtArea2 = Math.sqrt(nT * this.sqrtElements * 
this.sqrtElements);
+        const edge = pruneScaleValue(Math.floor(sqrtArea2)/this.sqrtElements);
+
+        var aPath, aPoint = document.documentElement.createSVGPoint();
+        if(edge != 0) {
+            aPoint.y = 1.0;
+            aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.x = edge;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.x = 1.0;
+            aPoint.y = edge;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.y = 0.0;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            aPoint.x = 0.0;
+            aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+            var poly = document.createElementNS( NSS['svg'], 'path');
+            poly.setAttribute('d', aPath);
+            res.appendPath(poly);
+        }
+        const a = (Math.SQRT1_2 / this.sqrtElements);
+        const d = (sqrtArea2 - Math.floor(sqrtArea2));
+        const len = ((1.0 - nT) * Math.SQRT2 * d);
+        const height = pruneScaleValue(Math.SQRT1_2 / this.sqrtElements);
+        aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = height;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = len + a;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.y = 0.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        aPoint.x = 0.0;
+        aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
+        var poly = document.createElementNS( NSS['svg'], 'path');
+        poly.setAttribute('d', aPath);
+        var aTransform;
+
+        if((Math.floor(sqrtArea2) & 1) == 1) {
+            // odd line
+            aTransform = SVGIdentityMatrix.translate(0.0, -height);
+            aTransform.rotate(Math.PI/2 + Math.PI/4);
+            aTransform.translate(1.0, edge);
+        }
+        else {
+            aTransform = SVGIdentityMatrix.rotate(-(Math.PI/4));
+            aTransform = aTransform.translate(edge, 1.0);
+        }
+        poly.matrixTransform(aTransform);
+        res.appendPath(poly);
+    }
+    return res;
+}
+
+SnakeWipePath.prototype.perform = function(nT) {
+    var res = createEmptyPath();
+    if(this.diagonal) {
+        if(nT >= 0.5) {
+            res.appendPath(this.calcHalfDiagonalSnake(1.0, true));
+            res.appendPath(this.calcHalfDiagonalSnake(2.0*(nT-0.5), false));
+        }
+        else
+            res.appendPath(this.calcHalfDiagonalSnake(2.0*nT, true));
+    }
+    else
+        res = this.calcSnake(nT);
+
+    return this.flipOnYAxis ? flipOnYAxis(res) : res;
+}
+
+
 /** perform
  *
  *  @param nT
commit 37aee797f1f067dd42c2bac209bbc7c64f88519c
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Tue Jan 10 22:29:54 2017 +0530

    tdf#51358 Support for BoxWipe transition in SVG Export
    
    Ported the class BoxWipe
    
    Change-Id: Iad93bfa9e414028ba842c3d43edcb8a94c15a104
    Reviewed-on: https://gerrit.libreoffice.org/32933
    Reviewed-by: jan iversen <j...@documentfoundation.org>
    Tested-by: jan iversen <j...@documentfoundation.org>
    (cherry picked from commit 3ce861adbe4e6f04d9d322e649fccd6cfcbd088f)

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 2f59ea3..df69b14 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5205,6 +5205,15 @@ ONEBLADE_TRANS_SUBTYPE              = 26; // 107
 ACROSS_TRANS_SUBTYPE                = 27;
 RECTANGLE_TRANS_SUBTYPE             = 34; // 101
 DIAMOND_TRANS_SUBTYPE               = 35; // 102
+TOPLEFT_TRANS_SUBTYPE               = 36  // 3
+TOPRIGHT_TRANS_SUBTYPE              = 37  // 4
+BOTTOMRIGHT_TRANS_SUBTYPE           = 38  // 5
+BOTTOMLEFT_TRANS_SUBTYPE            = 39  // 6
+TOPCENTER_TRANS_SUBTYPE             = 40; // 7
+RIGHTCENTER_TRANS_SUBTYPE           = 41; // 8
+BOTTOMCENTER_TRANS_SUBTYPE          = 42; // 9
+LEFTCENTER_TRANS_SUBTYPE            = 43; // 10
+
 
 aTransitionSubtypeInMap = {
     'default'           : DEFAULT_TRANS_SUBTYPE,
@@ -5236,7 +5245,15 @@ aTransitionSubtypeInMap = {
     'oneBlade'          : ONEBLADE_TRANS_SUBTYPE,
     'across'            : ACROSS_TRANS_SUBTYPE,
     'rectangle'         : RECTANGLE_TRANS_SUBTYPE,
-    'diamond'           : DIAMOND_TRANS_SUBTYPE
+    'diamond'           : DIAMOND_TRANS_SUBTYPE,
+    'topLeft'           : TOPLEFT_TRANS_SUBTYPE,
+    'topRight'          : TOPRIGHT_TRANS_SUBTYPE,
+    'bottomRight'       : BOTTOMRIGHT_TRANS_SUBTYPE,
+    'bottomLeft'        : BOTTOMLEFT_TRANS_SUBTYPE,
+    'topCenter'         : TOPCENTER_TRANS_SUBTYPE,
+    'rightCenter'       : RIGHTCENTER_TRANS_SUBTYPE,
+    'bottomCenter'      : BOTTOMCENTER_TRANS_SUBTYPE,
+    'leftCenter'        : LEFTCENTER_TRANS_SUBTYPE
 };
 
 aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 
'cornersIn',
@@ -5246,7 +5263,7 @@ aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 
'topToBottom', 'cornersIn
                              'fourBlade', 'fromLeft', 'fromTop', 'fromRight',
                              'fromBottom', 'crossfade', 'fadeToColor', 
'fadeFromColor',
                              'fadeOverColor', 'threeBlade', 'eightBlade', 
'oneBlade',
-                             'across', 'rectangle', 'diamond' ];
+                             'across', 'rectangle', 'diamond'];
 
 
 // Transition Modes
@@ -5343,6 +5360,88 @@ 
aTransitionInfoTable[BARWIPE_TRANSITION][TOPTOBOTTOM_TRANS_SUBTYPE] =
     'scaleIsotropically' : false
 };
 
+aTransitionInfoTable[BOXWIPE_TRANSITION] = {};
+aTransitionInfoTable[BOXWIPE_TRANSITION][TOPLEFT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_IGNORE,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][TOPRIGHT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_IGNORE,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMRIGHT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_IGNORE,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMLEFT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : -90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_IGNORE,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][TOPCENTER_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][RIGHTCENTER_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMCENTER_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[BOXWIPE_TRANSITION][LEFTCENTER_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : -90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+
 aTransitionInfoTable[FOURBOXWIPE_TRANSITION] = {};
 aTransitionInfoTable[FOURBOXWIPE_TRANSITION][CORNERSIN_TRANS_SUBTYPE] =
 aTransitionInfoTable[FOURBOXWIPE_TRANSITION][CORNERSOUT_TRANS_SUBTYPE] =
@@ -9112,6 +9211,11 @@ function createClipPolyPolygon( nType, nSubtype )
             return new BarWipePath( 1 );
         case FOURBOXWIPE_TRANSITION:
             return new FourBoxWipePath( nSubtype === CORNERSOUT_TRANS_SUBTYPE 
);
+        case BOXWIPE_TRANSITION:
+            return new BoxWipePath( nSubtype == LEFTCENTER_TRANS_SUBTYPE ||
+                                    nSubtype == TOPCENTER_TRANS_SUBTYPE ||
+                                    nSubtype == RIGHTCENTER_TRANS_SUBTYPE ||
+                                    nSubtype == BOTTOMCENTER_TRANS_SUBTYPE );
         case ELLIPSEWIPE_TRANSITION:
             return new EllipseWipePath( nSubtype );
         case PINWHEELWIPE_TRANSITION:
@@ -9239,6 +9343,31 @@ BarWipePath.prototype.perform = function( nT )
 };
 
 
+/** Class BoxWipePath
+ *  This class handles a path made up by one square and is utilized for
+ *  performing BoxWipe transitions.
+ *
+ *  @param bIsTopCentered
+ *      if true the transition subtype is top centered else not.
+ */
+function BoxWipePath(bIsTopCentered) {
+    this.bIsTopCentered = bIsTopCentered;
+    this.aBasePath = createUnitSquarePath();
+}
+
+BoxWipePath.prototype.perform = function( nT ) {
+    var d = pruneScaleValue(nT);
+    var aTransform = SVGIdentityMatrix;
+    if(this.bIsTopCentered) {
+        aTransform = aTransform.translate(-0.5, 0.0).scale(d, 
d).translate(0.5, 0.0);
+    }
+    else {
+        aTransform = aTransform.scale(d, d);
+    }
+    var aPath = this.aBasePath.cloneNode(true);
+    aPath.matrixTransform(aTransform);
+    return aPath;
+}
 
 
 /** Class FourBoxWipePath
commit cb3e0a681601667ddbf9d512b68cd7099221d6d8
Author: Rohan Kumar <rohankanojia...@gmail.com>
Date:   Thu Dec 29 00:10:36 2016 +0530

    tdf#51358 Support for IrisWipe transition animation in SVG Export
    
    Ported the class IrisWipe
    
    Change-Id: If56f846e9a48941cdd240adfb15f5b36674cadd3
    Reviewed-on: https://gerrit.libreoffice.org/32421
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: jan iversen <j...@documentfoundation.org>
    (cherry picked from commit 4a1d52e7e434269e1331e6fdd6c24d45703a9711)

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 9de750a..2f59ea3 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5127,6 +5127,11 @@ TRANSITION_SPECIAL              = 2;    // Transition 
expressed by hand-crafted
 
 aTransitionClassOutMap = ['invalid', 'clip polypolygon', 'special'];
 
+/*
+ * All Transition types should be in sync with aTransitionTypeInMap:
+ * Comments '//' followed by integers represent the transition values in their 
+ * C++ implementations.
+ */
 
 // Transition Types
 BARWIPE_TRANSITION          = 1;
@@ -5141,6 +5146,7 @@ FADE_TRANSITION             = 9; // 37
 RANDOMBARWIPE_TRANSITION    = 10; // 38
 CHECKERBOARDWIPE_TRANSITION = 11; // 39
 DISSOLVE_TRANSITION         = 12; // 40
+IRISWIPE_TRANSITION         = 14; // 12
 
 aTransitionTypeInMap = {
     'barWipe'           : BARWIPE_TRANSITION,
@@ -5154,14 +5160,20 @@ aTransitionTypeInMap = {
     'fade'              : FADE_TRANSITION,
     'randomBarWipe'     : RANDOMBARWIPE_TRANSITION,
     'checkerBoardWipe'  : CHECKERBOARDWIPE_TRANSITION,
-    'dissolve'          : DISSOLVE_TRANSITION
+    'dissolve'          : DISSOLVE_TRANSITION,
+    'irisWipe'          : IRISWIPE_TRANSITION
 };
 
 aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 
'ellipseWipe',
                           'clockWipe', 'pinWheelWipe', 'pushWipe', 'slideWipe',
-                          'fade', 'randomBarWipe', 'checkerBoardWipe', 
'dissolve' ];
+                          'fade', 'randomBarWipe', 'checkerBoardWipe', 
'dissolve' , 'irisWipe'];
 
 
+/*
+ * All Transition subtypes should be in sync with aTransitionSubtypeInMap:
+ * Comments '//' followed by integers represent the transition values in their 
+ * C++ implementations.
+ */
 // Transition Subtypes
 DEFAULT_TRANS_SUBTYPE               = 0;
 LEFTTORIGHT_TRANS_SUBTYPE           = 1;
@@ -5191,6 +5203,8 @@ THREEBLADE_TRANS_SUBTYPE            = 24;
 EIGHTBLADE_TRANS_SUBTYPE            = 25;
 ONEBLADE_TRANS_SUBTYPE              = 26; // 107
 ACROSS_TRANS_SUBTYPE                = 27;
+RECTANGLE_TRANS_SUBTYPE             = 34; // 101
+DIAMOND_TRANS_SUBTYPE               = 35; // 102
 
 aTransitionSubtypeInMap = {
     'default'           : DEFAULT_TRANS_SUBTYPE,
@@ -5220,7 +5234,9 @@ aTransitionSubtypeInMap = {
     'threeBlade'        : THREEBLADE_TRANS_SUBTYPE,
     'eightBlade'        : EIGHTBLADE_TRANS_SUBTYPE,
     'oneBlade'          : ONEBLADE_TRANS_SUBTYPE,
-    'across'            : ACROSS_TRANS_SUBTYPE
+    'across'            : ACROSS_TRANS_SUBTYPE,
+    'rectangle'         : RECTANGLE_TRANS_SUBTYPE,
+    'diamond'           : DIAMOND_TRANS_SUBTYPE
 };
 
 aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 
'cornersIn',
@@ -5230,7 +5246,7 @@ aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 
'topToBottom', 'cornersIn
                              'fourBlade', 'fromLeft', 'fromTop', 'fromRight',
                              'fromBottom', 'crossfade', 'fadeToColor', 
'fadeFromColor',
                              'fadeOverColor', 'threeBlade', 'eightBlade', 
'oneBlade',
-                             'across' ];
+                             'across', 'rectangle', 'diamond' ];
 
 
 // Transition Modes
@@ -5282,6 +5298,28 @@ aTransitionInfoTable[0][0] =
     'scaleIsotropically' : false
 };
 
+aTransitionInfoTable[IRISWIPE_TRANSITION] = {};
+aTransitionInfoTable[IRISWIPE_TRANSITION][RECTANGLE_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle': 0.0,
+    'scaleX': 1.0,
+    'scaleY': 1.0,
+    'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+    'outInvertsSweep': true,
+    'scaleIsotropically': false
+};
+
+aTransitionInfoTable[IRISWIPE_TRANSITION][DIAMOND_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle': 45.0,
+    'scaleX': Math.SQRT2,
+    'scaleY': Math.SQRT2,
+    'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
+    'outInvertsSweep': true,
+    'scaleIsotropically': false
+};
 
 aTransitionInfoTable[BARWIPE_TRANSITION] = {};
 aTransitionInfoTable[BARWIPE_TRANSITION][LEFTTORIGHT_TRANS_SUBTYPE] =
@@ -9108,6 +9146,17 @@ function createClipPolyPolygon( nType, nSubtype )
             return new RandomWipePath( 128, true /* bars */ );
         case CHECKERBOARDWIPE_TRANSITION:
             return new CheckerBoardWipePath( 10 );
+        case IRISWIPE_TRANSITION:
+            switch(nSubtype)
+            {
+                case RECTANGLE_TRANS_SUBTYPE:
+                    return new IrisWipePath(0);
+                case DIAMOND_TRANS_SUBTYPE:
+                    return new IrisWipePath(1);
+                default:
+                    log( 'createClipPolyPolygon: unknown subtype: ' + nSubtype 
);
+                    return null;
+            }
         case DISSOLVE_TRANSITION:
             return new RandomWipePath( 16 * 16, false /* dissolve */ );
     }
@@ -9371,7 +9420,32 @@ PinWheelWipePath.prototype.perform = function( nT )
     return aPolyPath;
 };
 
+/** Class Iriswipe
+  *
+  * @param unitRect
+  *
+  */
+function IrisWipePath(unitRect) {
+    this.unitRect = unitRect;
+    this.aBasePath = createUnitSquarePath();
+}
+
 
+/** perform
+  *
+  *  @param nT
+  *      A parameter in [0,1] representing the diamond or rectangle.
+  *  @return SVGPathElement
+  *      A svg <path> element representing a transition.
+  */
+IrisWipePath.prototype.perform = function( nT ) {
+    var d = pruneScaleValue(nT);
+    var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
+    aTransform = aTransform.multiply(SVGIdentityMatrix.scaleNonUniform(d, 
d).translate(0.5, 0.5));
+    var aPath = this.aBasePath.cloneNode(true);
+    aPath.matrixTransform(aTransform);
+    return aPath;
+}
 
 /** Class CheckerBoardWipePath
  *
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to