[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.4' - 19 commits - download.lst external/openssl filter/source officecfg/Configuration_officecfg.mk officecfg/registry postprocess/CustomTarget_registry.mk sd/source sfx2/source svx/source sw/qa sw/source toolkit/source vcl/source xmloff/source

Michael Stahl mstahl at redhat.com
Thu Apr 16 14:09:47 PDT 2015


 download.lst                                                 |    4 
 external/openssl/UnpackedTarball_openssl.mk                  |   17 +-
 external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1       |    8 -
 external/openssl/openssl-3650-masm.patch.1                   |   35 +++++
 external/openssl/opensslmingw.patch                          |   68 ++++++-----
 external/openssl/opensslosxppc.patch                         |    4 
 external/openssl/opensslsol.patch                            |   68 +----------
 external/openssl/opensslwnt.patch                            |   64 +++++-----
 filter/source/msfilter/escherex.cxx                          |   37 +++--
 filter/source/svg/svgexport.cxx                              |    5 
 officecfg/Configuration_officecfg.mk                         |    1 
 officecfg/registry/data/org/openoffice/ucb/Configuration.xcu |    6 
 postprocess/CustomTarget_registry.mk                         |    3 
 sd/source/filter/eppt/epptso.cxx                             |    2 
 sd/source/filter/eppt/pptx-epptooxml.cxx                     |    2 
 sfx2/source/appl/fileobj.cxx                                 |   20 ++-
 sfx2/source/appl/fileobj.hxx                                 |    4 
 sfx2/source/sidebar/Theme.cxx                                |   10 -
 svx/source/core/extedit.cxx                                  |    3 
 svx/source/unodraw/unobrushitemhelper.cxx                    |   27 ++--
 sw/qa/extras/mailmerge/data/empty.odt                        |binary
 sw/qa/extras/mailmerge/mailmerge.cxx                         |    5 
 sw/qa/extras/odfimport/data/PageBackground.odt               |binary
 sw/qa/extras/odfimport/data/fdo90130-1.odt                   |binary
 sw/qa/extras/odfimport/data/fdo90130-2.odt                   |binary
 sw/qa/extras/odfimport/odfimport.cxx                         |   37 +++++
 sw/source/core/doc/docnew.cxx                                |   26 ++++
 sw/source/core/layout/paintfrm.cxx                           |    3 
 sw/source/core/unocore/unoframe.cxx                          |   23 ++-
 sw/source/core/unocore/unomap.cxx                            |   66 ++++++++++
 sw/source/ui/index/cnttab.cxx                                |    2 
 sw/source/uibase/uiview/view.cxx                             |    4 
 toolkit/source/awt/vclxwindow.cxx                            |    5 
 vcl/source/outdev/transparent.cxx                            |    1 
 xmloff/source/style/PageMasterStyleMap.cxx                   |    1 
 35 files changed, 361 insertions(+), 200 deletions(-)

New commits:
commit 2b32cb7a06e89a86e4a961541b453df31410c126
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Apr 16 15:14:48 2015 +0200

    tdf#84294: vcl: fix PDF export of transparent Writer frames in LO 4.3
    
    The transparent frame background is painted opaque because
    OutputDevice::DrawTransparent() records a MetaTransparentAction
    instead of returning early.
    
    Note that master and 4.4 use drawinglayer to paint backgrounds
    so the problem is only visible in 4.3.
    
    (regression from 36b59f2efc2bfb2c9256c39eb5687808deb)
    
    Change-Id: Ide7a076b72123097a9fe099b96d36cda7f7bb082
    (cherry picked from commit 581314958f0ddd6c3a0536ce2d7e7e6f0c53a8ec)
    Reviewed-on: https://gerrit.libreoffice.org/15342
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index d3d7393..be6ed00 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -611,6 +611,7 @@ void OutputDevice::DrawTransparent( const tools::PolyPolygon& rPolyPoly,
     if( !mbFillColor || (nTransparencePercent >= 100) )
     {
         DrawInvisiblePolygon( rPolyPoly );
+        return; // tdf#84294: do not record it in metafile
     }
 
     // handle metafile recording
commit aec373f9f43a032e465bb4ef61a6d15557f50399
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 31 13:36:37 2015 +0100

    Resolves: tdf#90228 1.06 turns into a monster
    
    (cherry picked from commit 2ec9d9dd81f3f4ee6785ba938f9a79395972b71e)
    
    Also happens to fix tdf#89987
    
    Change-Id: I8ebb57fe8b94da2569593ffa7cf374cae64a846a
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 6940762..290555f 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -2331,8 +2331,9 @@ void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::sta
         // The implicit conversion from float to double can result in a precision loss, i.e. 1.2 is converted to
         // 1.200000000047something. To prevent this, we convert explicitly to double, and round it.
         double nZoom( fZoomX );
-        nZoom = ::rtl::math::round( nZoom, 4 );
-        GetWindow()->SetZoom( Fraction( nZoom ) );
+        Fraction aZoom(::rtl::math::round(nZoom, 4));
+        aZoom.ReduceInaccurate(10); // to avoid runovers and BigInt mapping
+        GetWindow()->SetZoom(aZoom);
     }
 }
 
commit cbdb3a6abac8e054c2b50a2ebb5cade8d8de0a72
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 15 11:11:03 2015 +0100

    fix crash on re-export of fdo39974-1.odt to odt
    
    (cherry picked from commit c2c22d26db03949771d5a0bb4f8abf6d2dc850ea)
    
    sw: DrawFillAttributes: move check for empty rPaintRegion
    
    Tweak c2c22d26db03949771d5a0bb4f8abf6d2dc850ea a bit: if the paint
    region is empty, nothing should be painted.
    
    (cherry picked from commit dc6a6475bcc7625a648e840de97ebd7a1ab03270)
    
    Change-Id: Ib4246987a3665f655ad44339ade0350b074c3266
    Reviewed-on: https://gerrit.libreoffice.org/15329
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 5557de3..7c395fb 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1858,7 +1858,8 @@ bool DrawFillAttributes(
             rPaintRegion.GetOrigin().Right(),
             rPaintRegion.GetOrigin().Bottom());
 
-        if(!aPaintRange.isEmpty() &&
+        if (!aPaintRange.isEmpty() &&
+            !rPaintRegion.empty() &&
             !basegfx::fTools::equalZero(aPaintRange.getWidth()) &&
             !basegfx::fTools::equalZero(aPaintRange.getHeight()))
         {
commit 881605e23bb22d48d138fc8ab7822565e7334f04
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 15 12:48:47 2015 +0100

    fix crash on re-export of fdo50057-2.odt to odt
    
    Change-Id: Ice7a754dd4f42b5cf62ae2038b63d893b8a92fd8
    (cherry picked from commit 66c9aec156d974b939b680dccbb27e18fb153a23)
    Reviewed-on: https://gerrit.libreoffice.org/15324
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 8876145..88f1e05 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -47,7 +47,9 @@
 #define FILETYPE_OBJECT     3
 
 SvFileObject::SvFileObject()
-    : pOldParent(NULL)
+    : nPostUserEventId(0)
+    , pDelMed(NULL)
+    , pOldParent(NULL)
     , nType(FILETYPE_TEXT)
     , bLoadAgain(true)
     , bSynchron(false)
@@ -64,14 +66,16 @@ SvFileObject::SvFileObject()
 
 SvFileObject::~SvFileObject()
 {
-    if ( xMed.Is() )
+    if (xMed.Is())
     {
         xMed->SetDoneLink( Link() );
         xMed.Clear();
     }
+    if (nPostUserEventId)
+        Application::RemoveUserEvent(nPostUserEventId);
+    delete pDelMed;
 }
 
-
 bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
                                 const OUString & rMimeType,
                                 bool bGetSynchron )
@@ -482,10 +486,10 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG )
         if( pThis->xMed.Is() )
         {
             pThis->xMed->SetDoneLink( Link() );
-
-            Application::PostUserEvent(
+            pThis->pDelMed = new SfxMediumRef(pThis->xMed);
+            pThis->nPostUserEventId = Application::PostUserEvent(
                         STATIC_LINK( pThis, SvFileObject, DelMedium_Impl ),
-                        new SfxMediumRef( pThis->xMed ));
+                        pThis->pDelMed);
             pThis->xMed.Clear();
         }
     }
@@ -495,7 +499,9 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG )
 
 IMPL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef*, pDelMed )
 {
-    (void)pThis;
+    pThis->nPostUserEventId = 0;
+    assert(pThis->pDelMed == pDelMed);
+    pThis->pDelMed = NULL;
     delete pDelMed;
     return 0;
 }
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 78aa1fb..85fb53b 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -33,7 +33,9 @@ class SvFileObject : public sfx2::SvLinkSource
     OUString            sReferer;
     Link                aEndEditLink;
     SfxMediumRef        xMed;
-    vcl::Window*             pOldParent;
+    ImplSVEvent*        nPostUserEventId;
+    SfxMediumRef*       pDelMed;
+    vcl::Window*        pOldParent;
 
     sal_uInt8 nType;
 
commit 951b2319e0a073c88d9e1ba67dc5db42e626aaf1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 14 23:40:06 2015 +0200

    tdf#89750: svx: fix ExternalToolEdit on Windows
    
    While adding check that the temp file move succeeds, overlooked that the
    file handle is actually leaked, which means the move will fail on WNT
    because the file is already open.
    
    (regression from ef490df2119523e1761f99b5fdbb387c2c71608d)
    
    Change-Id: I779ccde79871930fef3bad7e17b633fb62e36a46
    (cherry picked from commit 582cdc273ec0e91d27be8a7893994acadf4d7d18)
    Reviewed-on: https://gerrit.libreoffice.org/15315
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index 1511fdf..67bd9f0 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -113,9 +113,8 @@ void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
     OUString aTempFileBase;
     OUString aTempFileName;
 
-    oslFileHandle pHandle;
     osl::FileBase::RC rc =
-        osl::FileBase::createTempFile(0, &pHandle, &aTempFileBase);
+        osl::FileBase::createTempFile(nullptr, nullptr, &aTempFileBase);
     if (osl::FileBase::E_None != rc)
     {
         SAL_WARN("svx", "ExternalToolEdit::Edit: cannot create temp file");
commit f5e66bd5702b626bf170b46bbaa3c0eacb45de9c
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Sat Apr 4 20:55:29 2015 +0200

    tdf#56467 / tdf#88117: SVG export further improved
    
    omitting the clip-path from the <svg> element and keeping it only in
    the slides enables rendering of exported selection in viewers like
    firefox and inkscape
    
    Change-Id: If296a78a3f948728e8b2ec257849be129bec5d92
    Reviewed-on: https://gerrit.libreoffice.org/15155
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/15312
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 7d0914a..a73ce92 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -799,13 +799,9 @@ bool SVGFilter::implExportDocument()
 
     aAttr += OUString::number(nDocWidth) + " " + OUString::number(nDocHeight);
 
-    msClipPathId = "presentation_clip_path";
-    OUString sClipPathAttrValue = "url(#" + msClipPathId + ")";
-
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr );
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "xMidYMid" );
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", "evenodd" );
-    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
 
     // standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm)
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::number( 28.222 ) );
@@ -822,6 +818,7 @@ bool SVGFilter::implExportDocument()
         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "ClipPathGroup" );
         SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
         {
+            msClipPathId = "presentation_clip_path";
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", msClipPathId );
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" );
             SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", true, true );
commit a0fcdf552b1f750bd501b9ba929d8f8fa8c5c8bb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 14 17:05:10 2015 +0100

    fix export of ooo120353-1.odp to pptx, mismatch of start and end element
    
    cut and paste error I guess from the block above it
    
    Change-Id: I121e1d1a9f08ea3731bb7f65c385f264b3c2d2f4
    (cherry picked from commit 1d4e66a79453f7b020a3dcea328c03637407add9)
    Reviewed-on: https://gerrit.libreoffice.org/15308
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1f1362b..ece21dd 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1107,7 +1107,7 @@ void PowerPointExport::WriteAnimationNodeCommonPropsStart( FSHelperPtr pFS, cons
         WriteAnimationCondition( pFS, aCondSeq[ i ], false, bMainSeqChild );
     } else
         WriteAnimationCondition( pFS, aAny, false, bMainSeqChild );
-    pFS->endElementNS( XML_p, XML_stCondLst );
+    pFS->endElementNS( XML_p, XML_endCondLst );
     }
 
     Reference< XEnumerationAccess > xEnumerationAccess( rXNode, UNO_QUERY );
commit 5259e757f1009b33b4130b1a80f5d07b7be40004
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Apr 13 20:29:25 2015 +0200

    Cherry-pick 2 fixes:
    
    tdf#90566: memory leak: maChangeListeners is not properly disposed
    cbbb24d0afcdbdac21d03ec4ee1455a3834afff4
    
    fix loop
    d170afda29bf4557df568732b1feba47f2c9439f
    
    Change-Id: Ie575d503349b3218c7a0211e1f81d791e995297e
    Reviewed-on: https://gerrit.libreoffice.org/15290
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 4acbe85..262f363 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -429,15 +429,15 @@ void Theme::UpdateTheme (void)
 void SAL_CALL Theme::disposing (void)
 {
     ChangeListeners aListeners;
-    maChangeListeners.swap(aListeners);
+    aListeners.swap(maChangeListeners);
 
     const lang::EventObject aEvent (static_cast<XWeak*>(this));
 
     for (ChangeListeners::const_iterator
-             iContainer(maChangeListeners.begin()),
-             iContainerEnd(maChangeListeners.end());
-         iContainerEnd!=iContainerEnd;
-         ++iContainerEnd)
+             iContainer(aListeners.begin()),
+             iContainerEnd(aListeners.end());
+         iContainer != iContainerEnd;
+         ++iContainer)
     {
         for (ChangeListenerContainer::const_iterator
                  iListener(iContainer->second.begin()),
commit f22875bc193ba5f41c3fb0d3f7621735381a080c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 14 20:59:50 2015 +0100

    fix assert on re-export of ooo48994-1.ppt to ppt
    
    Change-Id: Ic8274e7d060f315d7891f8f5cf576f834ca89117
    (cherry picked from commit eece059c1f728059b536763bffd2d4fc3537833e)
    Reviewed-on: https://gerrit.libreoffice.org/15313
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 939751a..1082b6b 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1140,7 +1140,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
                                 aFile = aFile.replaceAll( "/", "\\" );
                                 aTarget = aFile;
                             }
-                            else if ( pFieldEntry->aFieldUrl[0] == '#' )
+                            else if ( pFieldEntry->aFieldUrl.startsWith("#") )
                             {
                                 OUString aPage( INetURLObject::decode( pFieldEntry->aFieldUrl, '%', INetURLObject::DECODE_WITH_CHARSET ) );
                                 aPage = aPage.copy( 1 );
commit fa4fb5b45b72ff66659606040ce3ad89609d526f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 14 16:25:42 2015 +0200

    tdf#89478: svx: ODF import: SvxBrushItem Graphics should override Color
    
    The bugdoc has:
    
    <style:page-layout-properties fo:background-color="#007f7f" >
        <style:background-image
         xlink:href="Pictures/2000003900002FA3000055F455EC9F63.svm"/>
    </style:page-layout-properties>
    
    In this case it's clearly better to prefer the Graphics.
    
    The old code could actually store both in the model but the UI only
    allows setting either Color or Graphic, so this should be good enough.
    
    (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)
    
    Change-Id: Id33231ad90815d9791f90289fb0b55455d334c14
    (cherry picked from commit b82791e3c586d6e4247d0eb1bb94681bcb113762)
    Reviewed-on: https://gerrit.libreoffice.org/15307
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx
index 4a2ec1d..d10aab6 100644
--- a/svx/source/unodraw/unobrushitemhelper.cxx
+++ b/svx/source/unodraw/unobrushitemhelper.cxx
@@ -50,19 +50,8 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI
 
     const sal_uInt8 nTransparency(rBrush.GetColor().GetTransparency());
 
-    if(0xff != nTransparency)
-    {
-        // we have a color fill
-        const Color aColor(rBrush.GetColor().GetRGBColor());
-
-        rToSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
-        rToSet.Put(XFillColorItem(OUString(), aColor));
-
-        // #125189# nTransparency is in range [0..254], convert to [0..100] which is used in
-        // XFillTransparenceItem (caution with the range which is in an *item-specific* range)
-        rToSet.Put(XFillTransparenceItem((((sal_Int32)nTransparency * 100) + 127) / 254));
-    }
-    else if(GPOS_NONE != rBrush.GetGraphicPos())
+    // tdf#89478 check for image first
+    if (GPOS_NONE != rBrush.GetGraphicPos())
     {
         // we have a graphic fill, set fill style
         rToSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
@@ -131,6 +120,18 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI
             rToSet.Put(XFillTransparenceItem(nGraphicTransparency));
         }
     }
+    else if (0xff != nTransparency)
+    {
+        // we have a color fill
+        const Color aColor(rBrush.GetColor().GetRGBColor());
+
+        rToSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
+        rToSet.Put(XFillColorItem(OUString(), aColor));
+
+        // #125189# nTransparency is in range [0..254], convert to [0..100] which is used in
+        // XFillTransparenceItem (caution with the range which is in an *item-specific* range)
+        rToSet.Put(XFillTransparenceItem((((sal_Int32)nTransparency * 100) + 127) / 254));
+    }
     else
     {
         // GPOS_NONE == rBrush.GetGraphicPos() && 0xff == rBrush.GetColor().GetTransparency(),
diff --git a/sw/qa/extras/odfimport/data/PageBackground.odt b/sw/qa/extras/odfimport/data/PageBackground.odt
index dbb1082..3733d5b 100644
Binary files a/sw/qa/extras/odfimport/data/PageBackground.odt and b/sw/qa/extras/odfimport/data/PageBackground.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index a4de654..5db4370 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -315,6 +315,12 @@ DECLARE_ODFIMPORT_TEST(testPageBackground, "PageBackground.odt")
     CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(xPropertySet, "FillStyle"));
     CPPUNIT_ASSERT_EQUAL(OUString("Sky"), getProperty<OUString>(xPropertySet, "FillBitmapName"));
     CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_REPEAT, getProperty<drawing::BitmapMode>(xPropertySet, "FillBitmapMode"));
+
+    uno::Reference<beans::XPropertySet> xPropertySetOld(getStyles("PageStyles")->getByName("OldStandard"), uno::UNO_QUERY);
+    // The background image was overridden by color
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(xPropertySetOld, "FillStyle"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Sky"), getProperty<OUString>(xPropertySetOld, "FillBitmapName"));
+    CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_REPEAT, getProperty<drawing::BitmapMode>(xPropertySetOld, "FillBitmapMode"));
 }
 
 DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt")
commit 90357315c1a5f2d6051351b4bac47dfb8ac8385c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 14 14:35:44 2015 +0200

    xmloff: add back the presumably accidentally removed "FootnoteLineStyle"
    
    (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)
    
    Change-Id: I67ec4516ff431efd47451ff07fc261ba32e80385
    (cherry picked from commit ea8db4ad8e1c75c3ab2f31fea4e061600231f9d1)
    Reviewed-on: https://gerrit.libreoffice.org/15306
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx
index 16dac27..da1308b 100644
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -153,6 +153,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
     PLMAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE,    XML__EMPTY,     XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM,    CTF_PM_FTN_LINE_WIDTH ),
     PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE,    XML__EMPTY,     XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM,    CTF_PM_FTN_LINE_DISTANCE ),
     PLMAP( "FootnoteLineWeight",        XML_NAMESPACE_STYLE,    XML_FOOTNOTE_SEP,    XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM,    CTF_PM_FTN_LINE_WEIGHT ),
+    PLMAP( "FootnoteLineStyle",     XML_NAMESPACE_STYLE,    XML_EMPTY,  XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM,  CTF_PM_FTN_LINE_STYLE ),
 
     //////////////////////////////////////////////////////////////////////////
     //UUUUIndex 92: Section for 'header-style' own section, all members *have* to use CTF_PM_HEADERFLAG in the context entry (the 5th one)
commit 662b368fd204066f2668c27e18f11ef9434d674a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 14 10:37:01 2015 +0200

    tdf#88337 tdf#89193: sw: add missing SwXPageStyle properties
    
    Add the fill style properties so background images etc. are not lost.
    
    (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)
    
    Change-Id: I517350eec2f32e4b4bb80427666aad23a31d666a
    (cherry picked from commit 65a56636a68451d15499a37c2d5bd9efb71b1279)
    Reviewed-on: https://gerrit.libreoffice.org/15305
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/odfimport/data/PageBackground.odt b/sw/qa/extras/odfimport/data/PageBackground.odt
new file mode 100644
index 0000000..dbb1082
Binary files /dev/null and b/sw/qa/extras/odfimport/data/PageBackground.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index c0534d7..a4de654 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -11,6 +11,8 @@
 #if !defined(WNT)
 
 #include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
 #include <com/sun/star/style/PageStyleLayout.hpp>
 #include <com/sun/star/table/XCell.hpp>
 #include <com/sun/star/table/BorderLine.hpp>
@@ -306,6 +308,15 @@ DECLARE_ODFIMPORT_TEST(testFdo79269_header, "fdo79269_header.odt")
     CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString());
 }
 
+DECLARE_ODFIMPORT_TEST(testPageBackground, "PageBackground.odt")
+{
+    uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default Style"), uno::UNO_QUERY);
+    // The background image was lost
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(xPropertySet, "FillStyle"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Sky"), getProperty<OUString>(xPropertySet, "FillBitmapName"));
+    CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_REPEAT, getProperty<drawing::BitmapMode>(xPropertySet, "FillBitmapMode"));
+}
+
 DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt")
 {
     uno::Reference<drawing::XShape> xShape = getShape(1);
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index cb7cdf0..540f4b5 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1070,6 +1070,72 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_GRID_SNAP_TO_CHARS), RES_TEXTGRID, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_GRID_SNAPTOCHARS},
                     { OUString(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_GRID_STANDARD_MODE},
                     { OUString(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
+
+                    //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+                    // but need own defines in Writer due to later association of strings
+                    // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+                    // This entry is for adding that properties to style import/export
+                    FILL_PROPERTIES_SW
+
+                    //UUUU Added DrawingLayer FillStyle Properties for Header. These need an own unique name,
+                    // but reuse the same WhichIDs as the regular fill. The implementation will decide to which
+                    // group of fill properties it belongs based on the start of the name (was already done in
+                    // the implementation partially), thus all SlotNames *have* to start with 'Header'
+                    { OUString(UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE),           XATTR_FILLBMP_SIZELOG,          cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_OFFSET_X),               XATTR_FILLBMP_TILEOFFSETX,      cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_OFFSET_Y),               XATTR_FILLBMP_TILEOFFSETY,      cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X),      XATTR_FILLBMP_POSOFFSETX,       cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y),      XATTR_FILLBMP_POSOFFSETY,       cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT),        XATTR_FILLBMP_POS,              cppu::UnoType<css::drawing::RectanglePoint>::get() , 0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_SIZE_X),                 XATTR_FILLBMP_SIZEX,            cppu::UnoType<sal_Int32>::get() ,          0,  SFX_METRIC_ITEM},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_SIZE_Y),                 XATTR_FILLBMP_SIZEY,            cppu::UnoType<sal_Int32>::get() ,          0,  SFX_METRIC_ITEM},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_STRETCH),                XATTR_FILLBMP_STRETCH,          cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_TILE),                   XATTR_FILLBMP_TILE,             cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBMP_MODE),                   OWN_ATTR_FILLBMP_MODE,          cppu::UnoType<css::drawing::BitmapMode>::get(),      0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLCOLOR),                      XATTR_FILLCOLOR,                cppu::UnoType<sal_Int32>::get(),           0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBACKGROUND),                 XATTR_FILLBACKGROUND,           cppu::UnoType<bool>::get(),         0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLBITMAP),                     XATTR_FILLBITMAP,               cppu::UnoType<css::awt::XBitmap>::get(),       0,  MID_BITMAP},
+                    { OUString(UNO_NAME_HEADER_FILLBITMAPNAME),                 XATTR_FILLBITMAP,               cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_HEADER_FILLBITMAPURL),                  XATTR_FILLBITMAP,               cppu::UnoType<OUString>::get(),        0,  MID_GRAFURL },
+                    { OUString(UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT),          XATTR_GRADIENTSTEPCOUNT,        cppu::UnoType<sal_Int16>::get(),           0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLGRADIENT),                   XATTR_FILLGRADIENT,             cppu::UnoType<css::awt::Gradient>::get(),        0,  MID_FILLGRADIENT},
+                    { OUString(UNO_NAME_HEADER_FILLGRADIENTNAME),               XATTR_FILLGRADIENT,             cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_HEADER_FILLHATCH),                      XATTR_FILLHATCH,                cppu::UnoType<css::drawing::Hatch>::get(),           0,  MID_FILLHATCH},
+                    { OUString(UNO_NAME_HEADER_FILLHATCHNAME),                  XATTR_FILLHATCH,                cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_HEADER_FILLSTYLE),                      XATTR_FILLSTYLE,                cppu::UnoType<css::drawing::FillStyle>::get(),       0,  0},
+                    { OUString(UNO_NAME_HEADER_FILL_TRANSPARENCE),              XATTR_FILLTRANSPARENCE,         cppu::UnoType<sal_Int16>::get(),           0,  0},
+                    { OUString(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENT),       XATTR_FILLFLOATTRANSPARENCE,    cppu::UnoType<css::awt::Gradient>::get(),        0,  MID_FILLGRADIENT},
+                    { OUString(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENTNAME),   XATTR_FILLFLOATTRANSPARENCE,    cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_HEADER_FILLCOLOR_2),                    XATTR_SECONDARYFILLCOLOR,       cppu::UnoType<sal_Int32>::get(),           0,  0},
+
+                    //UUUU Added DrawingLayer FillStyle Properties for Footer, similar as for Header (see there)
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_LOGICAL_SIZE),           XATTR_FILLBMP_SIZELOG,          cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_OFFSET_X),               XATTR_FILLBMP_TILEOFFSETX,      cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_OFFSET_Y),               XATTR_FILLBMP_TILEOFFSETY,      cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_X),      XATTR_FILLBMP_POSOFFSETX,       cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_Y),      XATTR_FILLBMP_POSOFFSETY,       cppu::UnoType<sal_Int32>::get() ,          0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_RECTANGLE_POINT),        XATTR_FILLBMP_POS,              cppu::UnoType<css::drawing::RectanglePoint>::get() , 0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_SIZE_X),                 XATTR_FILLBMP_SIZEX,            cppu::UnoType<sal_Int32>::get() ,          0,  SFX_METRIC_ITEM},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_SIZE_Y),                 XATTR_FILLBMP_SIZEY,            cppu::UnoType<sal_Int32>::get() ,          0,  SFX_METRIC_ITEM},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_STRETCH),                XATTR_FILLBMP_STRETCH,          cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_TILE),                   XATTR_FILLBMP_TILE,             cppu::UnoType<bool>::get() ,        0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBMP_MODE),                   OWN_ATTR_FILLBMP_MODE,          cppu::UnoType<css::drawing::BitmapMode>::get(),      0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLCOLOR),                      XATTR_FILLCOLOR,                cppu::UnoType<sal_Int32>::get(),           0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBACKGROUND),                 XATTR_FILLBACKGROUND,           cppu::UnoType<bool>::get(),         0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLBITMAP),                     XATTR_FILLBITMAP,               cppu::UnoType<css::awt::XBitmap>::get(),       0,  MID_BITMAP},
+                    { OUString(UNO_NAME_FOOTER_FILLBITMAPNAME),                 XATTR_FILLBITMAP,               cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_FOOTER_FILLBITMAPURL),                  XATTR_FILLBITMAP,               cppu::UnoType<OUString>::get(),        0,  MID_GRAFURL },
+                    { OUString(UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT),          XATTR_GRADIENTSTEPCOUNT,        cppu::UnoType<sal_Int16>::get(),           0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLGRADIENT),                   XATTR_FILLGRADIENT,             cppu::UnoType<css::awt::Gradient>::get(),        0,  MID_FILLGRADIENT},
+                    { OUString(UNO_NAME_FOOTER_FILLGRADIENTNAME),               XATTR_FILLGRADIENT,             cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_FOOTER_FILLHATCH),                      XATTR_FILLHATCH,                cppu::UnoType<css::drawing::Hatch>::get(),           0,  MID_FILLHATCH},
+                    { OUString(UNO_NAME_FOOTER_FILLHATCHNAME),                  XATTR_FILLHATCH,                cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_FOOTER_FILLSTYLE),                      XATTR_FILLSTYLE,                cppu::UnoType<css::drawing::FillStyle>::get(),       0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILL_TRANSPARENCE),              XATTR_FILLTRANSPARENCE,         cppu::UnoType<sal_Int16>::get(),           0,  0},
+                    { OUString(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENT),       XATTR_FILLFLOATTRANSPARENCE,    cppu::UnoType<css::awt::Gradient>::get(),        0,  MID_FILLGRADIENT},
+                    { OUString(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENTNAME),   XATTR_FILLFLOATTRANSPARENCE,    cppu::UnoType<OUString>::get(),        0,  MID_NAME },
+                    { OUString(UNO_NAME_FOOTER_FILLCOLOR_2),                    XATTR_SECONDARYFILLCOLOR,       cppu::UnoType<sal_Int32>::get(),           0,  0},
+
                     { OUString(), 0, css::uno::Type(), 0, 0 }
                 };
                 aMapEntriesArr[nPropertyId] = aPageStyleMap;
commit a6c4ecd05dfaedd05960c1edf14fd70bb51012e6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Apr 10 11:54:03 2015 +0200

    tdf#90230 SwDoc::AppendDoc: take care of marks when inserting page break
    
    SwDoc::AppendDoc() inserts nodes from an other document, and before
    doing that, it inserts a page break at the end of the document. In case
    there are marks at the end of the last paragraph, the insertion of the
    page break moves them to the next page. This is a rare situation, but
    happens e.g. when the source document is an empty one: then MM puts a
    mark at the first paragraph of each inserted MM part, and then the first
    paragraph == the last paragraph, so the mark of the only paragraph in
    the document gets moved to the next page.
    
    This is a problem on its own, but is detected by the SwIndexReg dtor
    when that empty paragraph gets deleted later in SwNodes::Delete() called
    by SwDoc::AppendDoc(), resulting in an assertion failure.
    
    Triggered by commit a305a2c91420652db450b7f8edd140e1d69f42cf (use
    bookmarks to mark mailmerge parts in a mailmerge document (fdo#80823),
    2014-10-20), these not adjusted bookmarks were not detected before.
    
    (cherry picked from commit 2819ee71da631116662401f14f8a0fb78c2a7f3a)
    
    Conflicts:
    	sw/qa/extras/mailmerge/mailmerge.cxx
    
    Change-Id: I89775b477a2fd3182b2bc87144aed2bfe7912aff
    Reviewed-on: https://gerrit.libreoffice.org/15310
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/mailmerge/data/empty.odt b/sw/qa/extras/mailmerge/data/empty.odt
new file mode 100644
index 0000000..311cb06
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/empty.odt differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 3ac9724..37bbed4 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -346,6 +346,11 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf89214, "tdf89214.odt", "10-testing-addresses
     CPPUNIT_ASSERT(!getProperty<OUString>(xParagraph, "ListId").isEmpty());
 }
 
+DECLARE_SHELL_MAILMERGE_TEST(testTdf90230, "empty.odt", "10-testing-addresses.ods", "testing-addresses")
+{
+    // MM of an empty document caused an assertion in the SwIndexReg dtor.
+    executeMailMerge();
+}
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index c6d353b..95a3ded 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -985,6 +985,32 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
         if ( pTargetPageDesc ) {
             OUString name = pTargetPageDesc->GetName();
             pTargetShell->InsertPageBreak( &name, nStartPageNumber );
+
+            // There is now a new empty text node on the new page. If it has
+            // any marks, those are from the previous page: move them back
+            // there, otherwise later we can't delete that empty text node.
+            SwNodeIndex aNodeIndex(GetNodes().GetEndOfContent(), -1);
+            if (SwTxtNode* pTxtNode = aNodeIndex.GetNode().GetTxtNode())
+            {
+                // Position of the last paragraph on the previous page.
+                --aNodeIndex;
+                SwPaM aPaM(aNodeIndex);
+                // Collect the marks starting or ending at this text node.
+                std::set<sw::mark::IMark*> aSeenMarks;
+                IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
+                for (const SwIndex* pIndex = pTxtNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
+                {
+                    sw::mark::IMark* pMark = const_cast<sw::mark::IMark*>(pIndex->GetMark());
+                    if (!pMark)
+                        continue;
+                    if (aSeenMarks.find(pMark) != aSeenMarks.end())
+                        continue;
+                    aSeenMarks.insert(pMark);
+                }
+                // And move them back.
+                for (sw::mark::IMark* pMark : aSeenMarks)
+                    pMarkAccess->repositionMark(pMark, aPaM);
+            }
         }
     }
 #ifdef DBG_UTIL
commit 963b2dbd0fe10e7533bed4c284bcf4ecaf6d827d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 13 12:46:34 2015 +0100

    Related: tdf#74018 fix int wraparound + crash on export
    
    of fdo74018-2.docx to doc
    
    nPoints is 16bit and accumulated value wraps around, so use
    a 32bit nTotalPoints instead and move 16bit declarations to
    use points to confirm no other wraparounds
    
    (cherry picked from commit ce705ac56a8709970356d634abb964adef105594)
    
    Change-Id: If97ccb46ed8eb7f4305cdfe328ae83bc2b0c778c
    Reviewed-on: https://gerrit.libreoffice.org/15280
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 23fcc48..517b548 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -2056,42 +2056,43 @@ bool EscherPropertyContainer::CreatePolygonProperties(
         {
             Polygon aPolygon;
 
-            sal_uInt16 i, j, k, nPoints, nBezPoints, nPolyCount = aPolyPolygon.Count();
+            sal_uInt16 nPolyCount = aPolyPolygon.Count();
+            sal_uInt32 nTotalPoints(0), nTotalBezPoints(0);
             Rectangle aRect( aPolyPolygon.GetBoundRect() );
             rGeoRect = ::com::sun::star::awt::Rectangle( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight() );
 
-            for ( nBezPoints = nPoints = i = 0; i < nPolyCount; i++ )
+            for (sal_uInt16 i = 0; i < nPolyCount; ++i)
             {
-                k = aPolyPolygon[ i ].GetSize();
-                nPoints = nPoints + k;
-                for ( j = 0; j < k; j++ )
+                sal_uInt16 k = aPolyPolygon[ i ].GetSize();
+                nTotalPoints += k;
+                for (sal_uInt16 j = 0; j < k; ++j)
                 {
                     if ( aPolyPolygon[ i ].GetFlags( j ) != POLY_CONTROL )
-                        nBezPoints++;
+                        nTotalBezPoints++;
                 }
             }
-            sal_uInt32 nVerticesBufSize = ( nPoints << 2 ) + 6;
+            sal_uInt32 nVerticesBufSize = ( nTotalPoints << 2 ) + 6;
             sal_uInt8* pVerticesBuf = new sal_uInt8[ nVerticesBufSize ];
 
 
-            sal_uInt32 nSegmentBufSize = ( ( nBezPoints << 2 ) + 8 );
+            sal_uInt32 nSegmentBufSize = ( ( nTotalBezPoints << 2 ) + 8 );
             if ( nPolyCount > 1 )
                 nSegmentBufSize += ( nPolyCount << 1 );
             sal_uInt8* pSegmentBuf = new sal_uInt8[ nSegmentBufSize ];
 
             sal_uInt8* pPtr = pVerticesBuf;
-            *pPtr++ = (sal_uInt8)( nPoints );                    // Little endian
-            *pPtr++ = (sal_uInt8)( nPoints >> 8 );
-            *pPtr++ = (sal_uInt8)( nPoints );
-            *pPtr++ = (sal_uInt8)( nPoints >> 8 );
+            *pPtr++ = (sal_uInt8)( nTotalPoints );                    // Little endian
+            *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 );
+            *pPtr++ = (sal_uInt8)( nTotalPoints );
+            *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 );
             *pPtr++ = (sal_uInt8)0xf0;
             *pPtr++ = (sal_uInt8)0xff;
 
-            for ( j = 0; j < nPolyCount; j++ )
+            for (sal_uInt16 j = 0; j < nPolyCount; ++j)
             {
                 aPolygon = aPolyPolygon[ j ];
-                nPoints = aPolygon.GetSize();
-                for ( i = 0; i < nPoints; i++ )             // write points from polygon to buffer
+                sal_uInt16 nPoints = aPolygon.GetSize();
+                for (sal_uInt16 i = 0; i < nPoints; ++i)             // write points from polygon to buffer
                 {
                     Point aPoint = aPolygon[ i ];
                     aPoint.X() -= rGeoRect.X;
@@ -2112,13 +2113,13 @@ bool EscherPropertyContainer::CreatePolygonProperties(
             *pPtr++ = (sal_uInt8)2;
             *pPtr++ = (sal_uInt8)0;
 
-            for ( j = 0; j < nPolyCount; j++ )
+            for (sal_uInt16 j = 0; j < nPolyCount; ++j)
             {
                 *pPtr++ = 0x0;          // Polygon start
                 *pPtr++ = 0x40;
                 aPolygon = aPolyPolygon[ j ];
-                nPoints = aPolygon.GetSize();
-                for ( i = 0; i < nPoints; i++ )         // write Polyflags to Buffer
+                sal_uInt16 nPoints = aPolygon.GetSize();
+                for (sal_uInt16 i = 0; i < nPoints; ++i)         // write Polyflags to Buffer
                 {
                     *pPtr++ = 0;
                     if ( bBezier )
commit 83d04b17e131663d6ecf4e6c631ada2ade463df8
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Mon Apr 6 01:46:45 2015 +0400

    tdf#89630 Remove extra space added when assigning styles for TOC
    
    Change-Id: I05deaf5360fb2d64419f2e47ed348edc9e3adefe
    Reviewed-on: https://gerrit.libreoffice.org/15165
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index c0065b7..a528f65 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3623,7 +3623,7 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, AssignHdl)
        nTemplPos != LISTBOX_ENTRY_NOTFOUND)
     {
         const OUString aStr(m_pLevelLB->GetEntry(nLevPos).getToken(0, aDeliStart)
-            + " " + OUString(aDeliStart)
+            + OUString(aDeliStart)
             + m_pParaLayLB->GetSelectEntry()
             + OUString(aDeliEnd));
 
commit 8f91f1bc16147a931469873b1a9f41ba9da1c73d
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Jan 28 13:45:32 2015 +0100

    tdf#80960: Attempt to fix the cursor placement after document load.
    
    This is a blind attempt - don't have a 32bit system at hand to really try it.
    
    Change-Id: I4fe8c65b794d01e79aa93cbac440f710b630c7dd
    Reviewed-on: https://gerrit.libreoffice.org/15131
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 358937f..c3d3f2a 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1254,8 +1254,8 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
         const Rectangle &rVis = GetVisArea();
         const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
 
-        long nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
-        long nRight = bBrowse ? LONG_MIN : rVis.Right(), nBottom = bBrowse ? LONG_MIN : rVis.Bottom();
+        sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
+        sal_Int64 nRight = bBrowse ? LONG_MIN : rVis.Right(), nBottom = bBrowse ? LONG_MIN : rVis.Bottom();
         sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
         sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
         bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
commit d023ced283c98c8a1b36115eb6a59aeeb4847f3f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 7 11:51:50 2015 +0100

    upgrade to openssl-1.0.2a
    
    and de-ifdef-per-platform the patch makefile so an upgrade attempt on one
    platform tests the patchs applying on all platforms
    
    ubsan.patch.0 was effectively applied upstream while need
    to add http://rt.openssl.org/Ticket/Display.html?id=3650 to build
    under windows
    
    Reviewed-on: https://gerrit.libreoffice.org/15183
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 04a98015101b8fea3b200e0bf3a2469d8c75fdf7)
    
    Conflicts:
    	external/openssl/UnpackedTarball_openssl.mk
    
    Change-Id: Ieffd9bc3dd861a94a083d8b6b8d4117bba7f527c
    Reviewed-on: https://gerrit.libreoffice.org/15221
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/download.lst b/download.lst
index cb087d1..4f4f28a 100644
--- a/download.lst
+++ b/download.lst
@@ -115,8 +115,8 @@ export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
 export OPENCOLLADA_MD5SUM := 4ca8a6ef0afeefc864e9ef21b9f14bd6
 export OPENCOLLADA_TARBALL := OpenCOLLADA-master-6509aa13af.tar.bz2
 export OPENLDAP_TARBALL := 804c6cb5698db30b75ad0ff1c25baefd-openldap-2.4.31.tgz
-export OPENSSL_MD5SUM := f7175c9cd3c39bb1907ac8bba9df8ed3
-export OPENSSL_TARBALL := openssl-1.0.1j.tar.gz
+export OPENSSL_MD5SUM := a06c547dac9044161a477211049f60ef
+export OPENSSL_TARBALL := openssl-1.0.2a.tar.gz
 export ORCUS_TARBALL := 7681383be6ce489d84c1c74f4e7f9643-liborcus-0.7.0.tar.bz2
 export PAGEMAKER_MD5SUM := 795cc7a59ace4db2b12586971d668671
 export PAGEMAKER_TARBALL := libpagemaker-0.0.2.tar.bz2
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index 98844b9..b44f576 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -22,14 +22,15 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,openssl,\
 endif
 
 $(eval $(call gb_UnpackedTarball_add_patches,openssl,\
-	$(if $(filter LINUX FREEBSD ANDROID,$(OS)),external/openssl/openssllnx.patch) \
-	$(if $(filter WNTGCC,$(OS)$(COM)),external/openssl/opensslmingw.patch) \
-	$(if $(filter MSC,$(COM)),external/openssl/opensslwnt.patch) \
-	$(if $(filter MSC,$(COM)),external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1) \
-	$(if $(filter MSC,$(COM)),external/openssl/openssl-1.0.1h-win64.patch.1) \
-	$(if $(filter SOLARIS,$(OS)),external/openssl/opensslsol.patch) \
-	$(if $(filter IOS,$(OS)),external/openssl/opensslios.patch) \
-	$(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),external/openssl/opensslosxppc.patch) \
+	external/openssl/openssllnx.patch \
+	external/openssl/opensslmingw.patch \
+	external/openssl/opensslwnt.patch \
+	external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 \
+	external/openssl/openssl-1.0.1h-win64.patch.1 \
+	external/openssl/opensslsol.patch \
+	external/openssl/opensslios.patch \
+	external/openssl/opensslosxppc.patch \
+	external/openssl/openssl-3650-masm.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 b/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1
index 611ffbc..de9e6fc 100644
--- a/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1
+++ b/external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1
@@ -1,7 +1,7 @@
 --- openssl.org/util/pl/VC-32.pl	2014-05-18 23:41:39.336594400 +0200
 +++ openssl/util/pl/VC-32.pl	2014-05-18 23:47:40.055279300 +0200
-@@ -49,7 +49,7 @@
-     $lib_cflag='/Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
+@@ -48,7 +48,7 @@
+     my $f = $shlib || $fips ?' /MD':' /MT';
      $opt_cflags=$f.' /Ox';
      $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
 -    $lflags="/nologo /subsystem:console /opt:ref";
@@ -9,12 +9,12 @@
  
      *::perlasm_compile_target = sub {
  	my ($target,$source,$bname)=@_;
-@@ -131,7 +131,7 @@
+@@ -135,7 +135,7 @@
      $ff = "/fixed";
      $opt_cflags=$f.' -Ox -O2 -Ob2';
      $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG';
 -    $lflags="/nologo /subsystem:console /opt:ref";
 +    $lflags="/nologo /subsystem:console,5.01 /opt:ref";
      }
+ $lib_cflag='-Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
  $mlflags='';
- 
diff --git a/external/openssl/openssl-3650-masm.patch.1 b/external/openssl/openssl-3650-masm.patch.1
new file mode 100644
index 0000000..97f1eb64
--- /dev/null
+++ b/external/openssl/openssl-3650-masm.patch.1
@@ -0,0 +1,35 @@
+diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl
+index 1741342..917d0f8 100644
+--- a/crypto/perlasm/x86masm.pl
++++ b/crypto/perlasm/x86masm.pl
+@@ -18,10 +18,10 @@ sub ::generic
+ 
+     if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/)	# no []
+     {	$opcode="mov";	}
+-    elsif ($opcode !~ /movq/)
++    elsif ($opcode !~ /mov[dq]$/)
+     {	# fix xmm references
+-	$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
+-	$arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
++	$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[-1]=~/\bxmm[0-7]\b/i);
++	$arg[-1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
+     }
+ 
+     &::emit($opcode, at arg);
+@@ -160,13 +160,13 @@ sub ::public_label
+ {   push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n");   }
+ 
+ sub ::data_byte
+-{   push(@out,("DB\t").join(',', at _)."\n");	}
++{   push(@out,("DB\t").join(',',splice(@_,0,16))."\n") while(@_);	}
+ 
+ sub ::data_short
+-{   push(@out,("DW\t").join(',', at _)."\n");	}
++{   push(@out,("DW\t").join(',',splice(@_,0,8))."\n") while(@_);	}
+ 
+ sub ::data_word
+-{   push(@out,("DD\t").join(',', at _)."\n");	}
++{   push(@out,("DD\t").join(',',splice(@_,0,4))."\n") while(@_);	}
+ 
+ sub ::align
+ {   push(@out,"ALIGN\t$_[0]\n");	}
diff --git a/external/openssl/opensslmingw.patch b/external/openssl/opensslmingw.patch
index 127cb04..81dc953 100644
--- a/external/openssl/opensslmingw.patch
+++ b/external/openssl/opensslmingw.patch
@@ -1,37 +1,47 @@
 --- misc/openssl-0.9.8v/Makefile.shared	2008-09-17 17:56:40.000000000 +0200
 +++ misc/build/openssl-0.9.8v/Makefile.shared	2009-03-30 11:52:53.684538000 +0200
-@@ -254,13 +254,17 @@
+@@ -278,7 +278,7 @@
+ link_a.cygwin:
+ 	@ $(CALC_VERSIONS); \
+ 	INHIBIT_SYMLINKS=yes; \
+-	SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
++	SHLIB=cyg$(LIBNAME); SHLIB_SOVER=; SHLIB_SUFFIX=.dll; \
+ 	dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
  	base=-Wl,--enable-auto-image-base; \
  	if expr $(PLATFORM) : 'mingw' > /dev/null; then \
- 		SHLIB=$(LIBNAME)eay32; \
--		base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
-+		base=;  \
-+                if test $(LIBNAME) = "crypto"; then \
-+                        SHLIB=libeay32; \
-+                        base=-Wl,--image-base,0x63000000; \
-+                fi; \
+@@ -289,7 +289,11 @@
+ 		SHLIB_SOVER=32; \
+ 		extras="$(LIBNAME).def"; \
+ 		$(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
+-		base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
++                base=;  \
++                 if test $(LIBNAME) = "crypto"; then \
++                         SHLIB=libeay32; \
++                         base=-Wl,--image-base,0x63000000; \
++                 fi; \
  	fi; \
- 	SHLIB_SUFFIX=.dll; \
--	SHLIB_SOVER=-$(LIBVERSION); \
-+	SHLIB_SOVER=; \
+ 	dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
+ 	$(PERL) util/mkrc.pl $$dll_name | \
+@@ -297,7 +301,7 @@
+ 	extras="$$extras rc.o"; \
  	ALLSYMSFLAGS='-Wl,--whole-archive'; \
  	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
--	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
-+	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--export-all-symbols -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
- 	[ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
- 	[ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
+-	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
++	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--export-all-symbols -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
+ 	[ -f apps/$$dll_name ] && rm apps/$$dll_name; \
+ 	[ -f test/$$dll_name ] && rm test/$$dll_name; \
  	$(LINK_SO_A) || exit 1; \
 --- misc/openssl-0.9.8v/e_os2.h	2005-12-19 03:57:07.000000000 +0900
 +++ misc/build/openssl-0.9.8v/e_os2.h	2009-04-04 23:07:15.324250000 +0900
-@@ -264,7 +264,7 @@
- # define OPENSSL_IMPLEMENT_GLOBAL(type,name)			     \
- 	extern type _hide_##name;				     \
- 	type *_shadow_##name(void) { return &_hide_##name; }	     \
--	static type _hide_##name
-+	type _hide_##name
- # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
- # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
- #else
+@@ -287,7 +287,7 @@
+ # ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
+ #  define OPENSSL_IMPLEMENT_GLOBAL(type,name,value)                      \
+         type *_shadow_##name(void)                                      \
+-        { static type _hide_##name=value; return &_hide_##name; }
++        { type _hide_##name=value; return &_hide_##name; }
+ #  define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
+ #  define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
+ # else
 --- misc/openssl-0.9.8v/ms/mingw32.bat	2006-05-05 15:19:32.000000000 +0200
 +++ misc/build/openssl-0.9.8v/ms/mingw32.bat	2009-03-30 11:54:10.000000000 +0200
 @@ -79,15 +79,41 @@
@@ -43,33 +53,33 @@
  if errorlevel 1 goto end
  
  echo Generating the DLLs and input libraries
--dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32
+-dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lws2_32 -lgdi32
 +mv out/libcrypto.a out/libcrypto_static.a
 +mv out/libssl.a out/libssl_static.a
 +dlltool --dllname libeay32.dll --output-lib out/libcrypto.a --input-def ms/libeay32.def
  if errorlevel 1 goto end
 -dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
-+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lws2_32 -lgdi32
  if errorlevel 1 goto end
 +dlltool --dllname ssleay32.dll --output-lib out/libssl.a --input-def ms/ssleay32.def
 +if errorlevel 1 goto end
 +if "%MINGW_SHARED_GXXLIB%"=="TRUE" goto shared_gxxlib
 +if "%MINGW_SHARED_GCCLIB%"=="TRUE" goto shared_gcclib
-+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 
++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lws2_32 -lgdi32 
 +if errorlevel 1 goto end
 +gcc --shared --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto 
 +if errorlevel 1 goto end
 +goto finished
 +
 +:shared_gcclib
-+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lws2_32 -lgdi32 
 +if errorlevel 1 goto end
 +gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto 
 +if errorlevel 1 goto end
 +goto finished
 +
 +:shared_gxxlib
-+gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 %MINGW_SHARED_LIBSTDSPP%
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lws2_32 -lgdi32 %MINGW_SHARED_LIBSTDSPP%
 +if errorlevel 1 goto end
 +gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto %MINGW_SHARED_LIBSTDSPP%
 +if errorlevel 1 goto end
diff --git a/external/openssl/opensslosxppc.patch b/external/openssl/opensslosxppc.patch
index 5f513ae..2e9168e 100644
--- a/external/openssl/opensslosxppc.patch
+++ b/external/openssl/opensslosxppc.patch
@@ -2,7 +2,7 @@
 
 --- a/openssl/Configure
 +++ b/openssl/Configure
-@@ -577,8 +577,8 @@
+@@ -620,8 +620,8 @@
  
  ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
  "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
@@ -12,4 +12,4 @@
 +"darwin64-ppc-cc","cc:-m64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
  "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
  "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
- "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
diff --git a/external/openssl/opensslsol.patch b/external/openssl/opensslsol.patch
index a22dc05..ef70130 100644
--- a/external/openssl/opensslsol.patch
+++ b/external/openssl/opensslsol.patch
@@ -1,81 +1,33 @@
 --- misc/openssl-0.9.8v/Configure	Mon Nov  9 15:14:26 2009
 +++ build/openssl-0.9.8v/Configure	Fri Mar 26 16:01:32 2010
-@@ -212,8 +212,8 @@
- "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+@@ -228,8 +228,8 @@
+ "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
   
  #### Solaris x86 with Sun C setups
--"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"solaris-x86-cc","cc:-O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"solaris64-x86_64-cc","cc:-xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+-"solaris-x86-cc","cc:-fast -xarch=generic -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+-"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
++"solaris-x86-cc","cc:-xarch=generic -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"solaris64-x86_64-cc","cc:-xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
  
  #### SPARC Solaris with GNU C setups
  "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 --- misc/openssl-0.9.8v/Makefile.shared	Wed Sep 17 17:56:40 2008
 +++ build/openssl-0.9.8v/Makefile.shared	Fri Mar 26 16:04:41 2010
-@@ -93,7 +93,7 @@
+@@ -95,7 +95,7 @@
      LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
-     LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
      LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
 -    LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
 +    LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
      $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
  
  LINK_SO=	\
-@@ -103,7 +103,7 @@
+@@ -105,7 +105,7 @@
      SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
-     LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
      LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
 -    LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
 +    LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
      $${SHAREDCMD} $${SHAREDFLAGS} \
  	-o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
  	$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
---- misc/openssl-0.9.8v/config	Tue Mar  9 18:08:24 2010
-+++ build/openssl-0.9.8v/config	Fri Mar 26 16:07:55 2010
-@@ -399,28 +399,25 @@
- # this is where the translation occurs into SSLeay terms
- # ---------------------------------------------------------------------------
- 
--GCCVER=`(gcc -dumpversion) 2>/dev/null`
--if [ "$GCCVER" != "" ]; then
--  # then strip off whatever prefix egcs prepends the number with...
--  # Hopefully, this will work for any future prefixes as well.
--  GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
--  # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
--  # does give us what we want though, so we use that.  We just just the
--  # major and minor version numbers.
--  # peak single digit before and after first dot, e.g. 2.95.1 gives 29
--  GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
-+if [ -z "$CC" ];then
-+  GCCVER=`(gcc -dumpversion) 2>/dev/null`
-+ if [ "$GCCVER" != "" ]; then
-+   CC=gcc
-+    # then strip off whatever prefix egcs prepends the number with...
-+    # Hopefully, this will work for any future prefixes as well.
-+    GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
-+    # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
-+    # does give us what we want though, so we use that.  We just just the
-+    # major and minor version numbers.
-+    # peak single digit before and after first dot, e.g. 2.95.1 gives 29
-+    GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
-+ else
-+   CC=cc
-+ fi
-+else
-+    CC=`echo $CC | sed 's/^[^ ]*\/\(..\).*/\1/'`
- fi
- 
--# Only set CC if not supplied already
--if [ -z "$CC" ]; then
--# figure out if gcc is available and if so we use it otherwise
--# we fallback to whatever cc does on the system
--  if [ "$GCCVER" != "" ]; then
--    CC=gcc
--  else
--    CC=cc
--  fi
--fi
- GCCVER=${GCCVER:-0}
- if [ "$SYSTEM" = "HP-UX" ];then
-   # By default gcc is a ILP32 compiler (with long long == 64).
diff --git a/external/openssl/opensslwnt.patch b/external/openssl/opensslwnt.patch
index 5be9c95..e033d25 100644
--- a/external/openssl/opensslwnt.patch
+++ b/external/openssl/opensslwnt.patch
@@ -1,8 +1,8 @@
 --- misc/openssl-0.9.8v/crypto/x509v3/v3_pci.c	2007-03-05 01:06:47.000000000 +0100
 +++ build/openssl-0.9.8v/crypto/x509v3/v3_pci.c	2010-03-26 12:04:20.961547300 +0100
-@@ -2,7 +2,7 @@
- /* Contributed to the OpenSSL Project 2004
-  * by Richard Levitte (richard at levitte.org)
+@@ -3,7 +3,7 @@
+  * Contributed to the OpenSSL Project 2004 by Richard Levitte
+  * (richard at levitte.org)
   */
 -/* Copyright (c) 2004 Kungliga Tekniska Högskolan
 +/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
@@ -11,9 +11,9 @@
   *
 --- misc/openssl-0.9.8v/crypto/x509v3/v3_pcia.c	2004-12-28 01:21:33.000000000 +0100
 +++ build/openssl-0.9.8v/crypto/x509v3/v3_pcia.c	2010-03-26 12:04:20.961547300 +0100
-@@ -2,7 +2,7 @@
- /* Contributed to the OpenSSL Project 2004
-  * by Richard Levitte (richard at levitte.org)
+@@ -3,7 +3,7 @@
+  * Contributed to the OpenSSL Project 2004 by Richard Levitte
+  * (richard at levitte.org)
   */
 -/* Copyright (c) 2004 Kungliga Tekniska Högskolan
 +/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
@@ -45,7 +45,7 @@
 +%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
 --- misc/openssl-0.9.8v/util/mk1mf.pl	2009-09-20 14:46:42.000000000 +0200
 +++ build/openssl-0.9.8v/util/mk1mf.pl	2010-03-26 12:04:20.977172300 +0100
-@@ -128,7 +128,7 @@
+@@ -163,7 +163,7 @@
  $inc_def="outinc";
  $tmp_def="tmp";
  
@@ -54,7 +54,7 @@
  $mkdir="-mkdir" unless defined $mkdir;
  
  ($ssl,$crypto)=("ssl","crypto");
-@@ -290,6 +290,11 @@
+@@ -343,6 +343,11 @@
  	chop;
  
  	($key,$val)=/^([^=]+)=(.*)/;
@@ -66,7 +66,7 @@
  	if ($key eq "RELATIVE_DIRECTORY")
  		{
  		if ($lib ne "")
-@@ -529,7 +529,7 @@
+@@ -469,7 +474,7 @@
  # Set your compiler options
  PLATFORM=$platform
  CC=$bin_dir${cc}
@@ -75,27 +75,27 @@
  APP_CFLAG=$app_cflag
  LIB_CFLAG=$lib_cflag
  SHLIB_CFLAG=$shl_cflag
-@@ -544,7 +544,7 @@
+@@ -484,7 +489,7 @@
  
  LINK=$link
  LFLAGS=$lflags
 -RSC=$rsc
 +RSC=$rsc \$(SOLARINC)
  
- # The output directory for everything intersting
+ # The output directory for everything interesting
  OUT_D=$out_dir
-@@ -730,7 +735,7 @@
+@@ -665,7 +670,7 @@
  printf OUT <<EOF;
  #ifdef $platform_cpp_symbol
    /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
--  #define CFLAGS "$cc $cflags"
-+  #define CFLAGS "$cflags"
+-  #define CFLAGS "compiler: $cc $cflags"
++  #define CFLAGS "compiler: $cflags"
    #define PLATFORM "$platform"
  EOF
  printf OUT "  #define DATE \"%s\"\n", scalar gmtime();
 --- misc/openssl-0.9.8v/util/pl/VC-32.pl	2010-02-04 02:10:24.000000000 +0100
 +++ build/openssl-0.9.8v/util/pl/VC-32.pl	2010-03-26 12:04:20.977172300 +0100
-@@ -32,7 +32,7 @@
+@@ -30,7 +30,7 @@
  my $ff = "";
  
  # C compiler stuff
@@ -104,29 +104,31 @@
  if ($FLAVOR =~ /WIN64/)
      {
      # Note that we currently don't have /WX on Win64! There is a lot of
-@@ -103,22 +103,22 @@
+@@ -114,7 +114,7 @@
      }
  
-     $cc='$(CC)';
+     $cc=($ENV{CC} or "cl");
 -    $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
 +    $base_cflags=' -W3 -GF -Gy -nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
      $base_cflags.=" $wcecdefs";
      $base_cflags.=' -I$(WCECOMPAT)/include'		if (defined($ENV{'WCECOMPAT'}));
      $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include'	if (defined($ENV{'PORTSDK_LIBPATH'}));
--    $opt_cflags=' /MC /O1i';	# optimize for space, but with intrinsics...
--    $dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG';
-+    $opt_cflags=' -MC -O1i';	# optimize for space, but with intrinsics...
-+    $dbg_cflags=' -MC -Od -DDEBUG -D_DEBUG';
+@@ -123,20 +123,21 @@
+     } else {
+ 	$base_cflags.=' /MC';
+     }
+-    $opt_cflags=' /O1i';	# optimize for space, but with intrinsics...
+-    $dbg_cflags=' /Od -DDEBUG -D_DEBUG';
++    $opt_cflags=' -O1i';   # optimize for space, but with intrinsics...
++    $dbg_cflags=' -Od -DDEBUG -D_DEBUG';
++
      $lflags="/nologo /opt:ref $wcelflag";
      }
  else	# Win32
      {
--    $base_cflags= " $mf_cflag";
-+    $base_cflags= " $mf_cflag";
+     $base_cflags= " $mf_cflag";
 -    my $f = $shlib || $fips ?' /MD':' /MT';
--    $lib_cflag='/Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
 +    my $f = $shlib || $fips ? (($ENV{MSVC_USE_DEBUG_RUNTIME} eq "TRUE") ? ' -MDd' : ' -MD' ):' -MT';
-+    $lib_cflag='-Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
      $ff = "/fixed";
 -    $opt_cflags=$f.' /Ox /O2 /Ob2';
 -    $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
@@ -134,8 +136,12 @@
 +    $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG';
      $lflags="/nologo /subsystem:console /opt:ref";
      }
+-$lib_cflag='/Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
++$lib_cflag='-Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
  $mlflags='';
-@@ -138,7 +138,7 @@
+ 
+ $out_def ="out32";	$out_def.="dll"			if ($shlib);
+@@ -161,7 +162,7 @@
  
  $obj='.obj';
  $asm_suffix='.asm';
@@ -148,8 +154,8 @@
 +++ build/openssl-0.9.8v/ms/uplink.c
 @@ -1,5 +1,6 @@
  #if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE)
- #define UNICODE
-+#define _CRT_NON_CONFORMING_SWPRINTFS
+ # define UNICODE
++# define _CRT_NON_CONFORMING_SWPRINTFS
  #endif
  #if defined(UNICODE) && !defined(_UNICODE)
- #define _UNICODE
+ # define _UNICODE
commit 11730ab931e67e26efd8a7f46dff17c2b8a97e2c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 13 20:56:45 2015 +0100

    Resolves: tdf#90130 don't clobber new solid-color on seeing old transparency
    
    ...and tdf#90130 gradient transparency goes missing
    
    (cherry picked from commit bc892b04144d82507ccd59953c9f4da357c2e7b4)
    
    Change-Id: I1ea86dca37cbce416564c5e198779dd132125b02
    Reviewed-on: https://gerrit.libreoffice.org/15291
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/odfimport/data/fdo90130-1.odt b/sw/qa/extras/odfimport/data/fdo90130-1.odt
new file mode 100644
index 0000000..6839b36
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo90130-1.odt differ
diff --git a/sw/qa/extras/odfimport/data/fdo90130-2.odt b/sw/qa/extras/odfimport/data/fdo90130-2.odt
new file mode 100644
index 0000000..6cf08950
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo90130-2.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index e880ee0..c0534d7 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -548,6 +548,26 @@ DECLARE_ODFIMPORT_TEST(fdo81223, "fdo81223.odt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeffffff), nValue);
 }
 
+DECLARE_ODFIMPORT_TEST(fdo90130_1, "fdo90130-1.odt")
+{
+    uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+    sal_Int32 nValue(0);
+    xFrame->getPropertyValue("BackColor") >>= nValue;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff3333), nValue);
+}
+
+DECLARE_ODFIMPORT_TEST(fdo90130_2, "fdo90130-2.odt")
+{
+    uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+    sal_Int32 nValue(0);
+    xFrame->getPropertyValue("BackColorTransparency") >>= nValue;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(50), nValue);
+}
+
 DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
 {
     // Document's second paragraph wants to be together with the third one, but:
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index db5cb5b..7cd950e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -352,6 +352,9 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
 
             aXFillColorItem.PutValue(*pXFillColorItem);
             rToSet.Put(aXFillColorItem);
+            //set old-school brush color if we later encounter the
+            //MID_BACK_COLOR_TRANSPARENCY case below
+            aBrush = getSvxBrushItemFromSourceSet(rToSet, RES_BACKGROUND, false);
         }
         else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && (pCol || pRGBCol))
         {
@@ -446,20 +449,24 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
             }
         }
 
-        if(pXFillTransparenceItem)
+        if (pXFillTransparenceItem)
         {
-            const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
             XFillTransparenceItem aXFillTransparenceItem;
-
             aXFillTransparenceItem.PutValue(*pXFillTransparenceItem);
             rToSet.Put(aXFillTransparenceItem);
         }
-        else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && pColTrans)
+        else if (pColTrans)
         {
-            // Fill style is set to solid, but no fill transparency is given.
-            // On the other hand, we have a BackColorTransparency, so use that.
-            aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
-            setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+            // No fill transparency is given.  On the other hand, we have a
+            // BackColorTransparency, so use that.
+            sal_Int8 nGraphicTransparency(0);
+            *pColTrans >>= nGraphicTransparency;
+            rToSet.Put(XFillTransparenceItem(nGraphicTransparency));
+            if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID)
+            {
+                aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
+                setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+            }
         }
 
         if(pXGradientStepCountItem)
commit 739e4188f41b4d4beec75fd943e5e096071d14ef
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 13 18:27:33 2015 +0200

    rhbz#1134285: Access dav, davs URLs via GVFS
    
    ...so that LO shares the credentials with Nautilus once the connection has been
    set up in Nautilus.
    
    The reason the (non-standard) dav, davs URLs used by GNOME's old GnomeVFS and
    successor GVFS/GIO were handled via LO's webdav UCP rather than the GNOME-
    specific gnomevfs resp. gio UCP since b07a5fcc600ad564315d36fbd18495184fdf69cf
    "INTEGRATION: CWS tkr10: i84676 neon and gnome-vfs2" is discussed at
    <https://bz.apache.org/ooo/show_bug.cgi?id=84676> "mixing neon and the hidden
    embedded contents old [sic] another neon inside libhttp.so of gnome-vfs2 is
    unreliable" and only pertains to the legacy gnomevfs UCP, not the new gio one.
    So keep handling dav, davs URLs via LO's internal webdav UCP under legacy
    --enable-gnome-vfs, but handle them via the GNOME-specific gio UCP under the
    default --enable-gio.
    
    Change-Id: Ib132168701a7ae0a7dcabdead6a299eda0cd4594
    (cherry picked from commit 51e0d789c344547956764c3b5f0ef5a304f4e0aa)
    Reviewed-on: https://gerrit.libreoffice.org/15295
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk
index 7e2af03..af992b9 100644
--- a/officecfg/Configuration_officecfg.mk
+++ b/officecfg/Configuration_officecfg.mk
@@ -121,6 +121,7 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat
 	org/openoffice/TypeDetection/UISort-math.xcu \
 	org/openoffice/ucb/Configuration-gio.xcu \
 	org/openoffice/ucb/Configuration-neon.xcu \
+	org/openoffice/ucb/Configuration-neon_gnomevfs.xcu \
 	org/openoffice/ucb/Configuration-win.xcu \
 ))
 
diff --git a/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu b/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
index e9704d3..9cb2a1a 100644
--- a/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
+++ b/officecfg/registry/data/org/openoffice/ucb/Configuration.xcu
@@ -89,7 +89,8 @@
                 <value/>
               </prop>
             </node>
-            <node oor:name="Provider7" oor:op="replace" install:module="neon">
+            <node oor:name="Provider7" oor:op="replace"
+                install:module="neon_gnomevfs">
               <prop oor:name="ServiceName">
                 <value>com.sun.star.ucb.WebDAVContentProvider</value>
               </prop>
@@ -155,7 +156,8 @@
                 <value/>
               </prop>
             </node>
-            <node oor:name="Provider13" oor:op="replace" install:module="neon">
+            <node oor:name="Provider13" oor:op="replace"
+                install:module="neon_gnomevfs">
               <prop oor:name="ServiceName">
                 <value>com.sun.star.ucb.WebDAVContentProvider</value>
               </prop>
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 28b30ad..e8d90da 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -328,6 +328,9 @@ postprocess_DRIVERS += ado
 endif
 ifneq ($(WITH_WEBDAV),)
 postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-neon.xcu
+ifeq ($(ENABLE_GNOMEVFS),TRUE)
+postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-neon_gnomevfs.xcu
+endif
 endif
 ifeq ($(ENABLE_EVOAB2),TRUE)
 postprocess_FILES_main += $(call gb_XcuModuleTarget_get_target,connectivity/registry/evoab2)/org/openoffice/Office/DataAccess/Drivers-evoab2.xcu


More information about the Libreoffice-commits mailing list