[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 125 commits - avmedia/source basctl/source basic/source configmgr/source configure.ac cui/Library_cui.mk cui/source editeng/source filter/qa filter/source include/basic include/comphelper include/editeng include/filter include/svx include/tools include/vcl include/xmloff instsetoo_native/CustomTarget_setup.mk offapi/com readlicense_oo/license sal/osl scp2/source sc/qa sc/source sd/qa sd/source sfx2/source svx/source sw/CppunitTest_sw_odfexport.mk sw/inc sw/qa sw/source tools/source vcl/inc vcl/Library_vcl.mk vcl/opengl vcl/Package_opengl.mk vcl/qa vcl/README.vars vcl/source vcl/unx vcl/win vcl/workben xmloff/source

Michael Meeks michael.meeks at collabora.com
Mon Aug 31 08:07:28 PDT 2015


 avmedia/source/framework/mediaplayer.cxx                       |    6 
 basctl/source/dlged/managelang.cxx                             |   36 
 basic/source/classes/image.cxx                                 |  171 
 basic/source/classes/sbxmod.cxx                                |    5 
 basic/source/inc/filefmt.hxx                                   |   30 
 basic/source/uno/scriptcont.cxx                                |    5 
 configmgr/source/components.cxx                                |   21 
 configmgr/source/winreg.cxx                                    |    5 
 configmgr/source/winreg.hxx                                    |    4 
 configure.ac                                                   |   17 
 cui/Library_cui.mk                                             |    1 
 cui/source/dialogs/about.cxx                                   |    6 
 cui/source/options/optgdlg.cxx                                 |   12 
 editeng/source/editeng/editattr.cxx                            |    6 
 editeng/source/items/textitem.cxx                              |   38 
 filter/qa/cppunit/data/pbm/fail/crash-1.pbm                    |    6 
 filter/qa/cppunit/data/tiff/fail/hang-10.tiff                  |binary
 filter/source/graphicfilter/ipbm/ipbm.cxx                      |   35 
 filter/source/graphicfilter/itiff/lzwdecom.cxx                 |   12 
 filter/source/msfilter/msdffimp.cxx                            |   60 
 filter/source/msfilter/svdfppt.cxx                             |  216 
 include/basic/sbmod.hxx                                        |    1 
 include/comphelper/windowserrorstring.hxx                      |   46 
 include/editeng/colritem.hxx                                   |    1 
 include/filter/msfilter/dffpropset.hxx                         |    1 
 include/filter/msfilter/svdfppt.hxx                            |   12 
 include/svx/numvset.hxx                                        |    1 
 include/svx/unobrushitemhelper.hxx                             |    3 
 include/tools/color.hxx                                        |    2 
 include/vcl/idle.hxx                                           |    2 
 include/vcl/opengl/OpenGLHelper.hxx                            |   22 
 include/xmloff/PageMasterStyleMap.hxx                          |   12 
 include/xmloff/txtprmap.hxx                                    |    2 
 include/xmloff/xmlexppr.hxx                                    |    3 
 instsetoo_native/CustomTarget_setup.mk                         |    2 
 offapi/com/sun/star/drawing/FillProperties.idl                 |    2 
 readlicense_oo/license/CREDITS.fodt                            | 2451 +++++-----
 sal/osl/unx/signal.cxx                                         |    2 
 sc/qa/extras/macros-test.cxx                                   |   33 
 sc/qa/extras/testdocuments/testTypePassword.ods                |binary
 sc/qa/unit/data/ods/header-image.ods                           |binary
 sc/qa/unit/subsequent_export-test.cxx                          |   16 
 sc/source/core/tool/address.cxx                                |   11 
 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx |   29 
 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx              |   75 
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx |   71 
 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx |   89 
 sc/source/ui/formdlg/formula.cxx                               |    1 
 sc/source/ui/inc/RandomNumberGeneratorDialog.hxx               |    1 
 sc/source/ui/inc/SamplingDialog.hxx                            |    1 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx               |    1 
 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx               |    1 
 scp2/source/ooo/common_brand.scp                               |   14 
 sd/qa/unit/data/ppt/pass/crash-1.ppt                           |binary
 sd/qa/unit/data/ppt/pass/crash-2.ppt                           |binary
 sd/qa/unit/data/ppt/pass/crash-3.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-1.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-10.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-11.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-12.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-13.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-14.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-15.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-16.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-17.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-18.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-19.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-2.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-20.ppt                           |binary
 sd/qa/unit/data/ppt/pass/hang-3.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-4.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-5.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-6.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-7.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-8.ppt                            |binary
 sd/qa/unit/data/ppt/pass/hang-9.ppt                            |binary
 sd/source/filter/ppt/pptin.cxx                                 |  121 
 sd/source/filter/ppt/propread.cxx                              |   88 
 sfx2/source/doc/oleprops.cxx                                   |   17 
 svx/source/dialog/svxbmpnumvalueset.cxx                        |   11 
 svx/source/svdraw/svdoedge.cxx                                 |    2 
 svx/source/unodraw/unobrushitemhelper.cxx                      |    6 
 sw/CppunitTest_sw_odfexport.mk                                 |    3 
 sw/inc/editsh.hxx                                              |    1 
 sw/qa/core/data/ww5/pass/crash-1.doc                           |binary
 sw/qa/core/data/ww5/pass/crash-2.doc                           |binary
 sw/qa/core/data/ww5/pass/crash-3.doc                           |binary
 sw/qa/core/data/ww5/pass/hang-1.doc                            |binary
 sw/qa/core/data/ww5/pass/hang-2.doc                            |binary
 sw/qa/core/data/ww6/pass/crash-1.doc                           |binary
 sw/qa/core/data/ww6/pass/crash-2.doc                           |binary
 sw/qa/core/data/ww6/pass/crash-3.doc                           |binary
 sw/qa/core/data/ww6/pass/crash-4.doc                           |binary
 sw/qa/core/data/ww6/pass/crash-6.doc                           |binary
 sw/qa/core/data/ww6/pass/crash-7.doc                           |binary
 sw/qa/core/data/ww6/pass/hang-1.doc                            |binary
 sw/qa/core/data/ww8/pass/crash-3.doc                           |binary
 sw/qa/core/data/ww8/pass/hang-4.doc                            |binary
 sw/qa/core/data/ww8/pass/hang-5.doc                            |binary
 sw/qa/core/filters-test.cxx                                    |    4 
 sw/qa/extras/odfexport/data/tdf92379.fodt                      |   89 
 sw/qa/extras/odfexport/odfexport.cxx                           |   80 
 sw/source/core/doc/DocumentContentOperationsManager.cxx        |   17 
 sw/source/core/edit/edfld.cxx                                  |    5 
 sw/source/core/layout/paintfrm.cxx                             |    4 
 sw/source/core/text/itrpaint.cxx                               |    2 
 sw/source/core/unocore/swunohelper.cxx                         |   14 
 sw/source/core/unocore/unostyle.cxx                            |   10 
 sw/source/filter/basflt/fltshell.cxx                           |   39 
 sw/source/filter/ww8/ww8glsy.cxx                               |   10 
 sw/source/filter/ww8/ww8graf.cxx                               |   90 
 sw/source/filter/ww8/ww8par.cxx                                |   52 
 sw/source/filter/ww8/ww8par.hxx                                |   17 
 sw/source/filter/ww8/ww8par2.cxx                               |   33 
 sw/source/filter/ww8/ww8par4.cxx                               |    9 
 sw/source/filter/ww8/ww8scan.cxx                               |  268 -
 sw/source/filter/ww8/ww8scan.hxx                               |    5 
 sw/source/filter/xml/xmlimp.cxx                                |   12 
 sw/source/uibase/dbui/dbmgr.cxx                                |   13 
 tools/source/generic/color.cxx                                 |    2 
 vcl/Library_vcl.mk                                             |    1 
 vcl/Package_opengl.mk                                          |    1 
 vcl/README.vars                                                |   23 
 vcl/inc/opengl/FixedTextureAtlas.hxx                           |   39 
 vcl/inc/opengl/program.hxx                                     |    7 
 vcl/inc/opengl/texture.hxx                                     |   44 
 vcl/inc/opengl/watchdog.hxx                                    |   31 
 vcl/inc/opengl/x11/gdiimpl.hxx                                 |    2 
 vcl/inc/opengl/zone.hxx                                        |   45 
 vcl/inc/outfont.hxx                                            |    2 
 vcl/inc/sft.hxx                                                |   21 
 vcl/inc/win/salgdi.h                                           |   14 
 vcl/opengl/FixedTextureAtlas.cxx                               |   71 
 vcl/opengl/areaScaleFastFragmentShader.glsl                    |    3 
 vcl/opengl/areaScaleFragmentShader.glsl                        |    1 
 vcl/opengl/blendedTextureFragmentShader.glsl                   |    8 
 vcl/opengl/blendedTextureVertexShader.glsl                     |    3 
 vcl/opengl/diffTextureFragmentShader.glsl                      |    6 
 vcl/opengl/framebuffer.cxx                                     |    8 
 vcl/opengl/gdiimpl.cxx                                         |  157 
 vcl/opengl/maskedTextureFragmentShader.glsl                    |    6 
 vcl/opengl/maskedTextureVertexShader.glsl                      |   24 
 vcl/opengl/program.cxx                                         |   19 
 vcl/opengl/salbmp.cxx                                          |   52 
 vcl/opengl/scale.cxx                                           |   13 
 vcl/opengl/texture.cxx                                         |  129 
 vcl/opengl/transformedTextureVertexShader.glsl                 |    3 
 vcl/qa/cppunit/graphicfilter/data/wmf/fail/hang-3.wmf          |binary
 vcl/source/app/svmain.cxx                                      |   10 
 vcl/source/filter/wmf/enhwmf.cxx                               |   19 
 vcl/source/fontsubset/sft.cxx                                  |   23 
 vcl/source/gdi/pdfwriter_impl.cxx                              |   58 
 vcl/source/gdi/salgdilayout.cxx                                |   40 
 vcl/source/opengl/OpenGLContext.cxx                            |   80 
 vcl/source/opengl/OpenGLHelper.cxx                             |  224 
 vcl/source/outdev/font.cxx                                     |    5 
 vcl/source/window/builder.cxx                                  |    1 
 vcl/source/window/stacking.cxx                                 |    2 
 vcl/unx/gtk3/app/gtk3gtkinst.cxx                               |    3 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx                  |   29 
 vcl/unx/kde4/KDESalGraphics.cxx                                |    2 
 vcl/unx/kde4/tst_exclude_socket_notifiers.hxx                  |    3 
 vcl/win/source/gdi/salgdi.cxx                                  |    5 
 vcl/win/source/gdi/salgdi3.cxx                                 |   51 
 vcl/win/source/gdi/winlayout.cxx                               | 1358 ++---
 vcl/win/source/gdi/winlayout.hxx                               |   89 
 vcl/workben/vcldemo.cxx                                        |   69 
 xmloff/source/draw/sdpropls.cxx                                |    4 
 xmloff/source/style/impastpl.cxx                               |    1 
 xmloff/source/style/styleexp.cxx                               |    8 
 xmloff/source/style/xmlexppr.cxx                               |   23 
 xmloff/source/text/txtimppr.cxx                                |   14 
 172 files changed, 4616 insertions(+), 2862 deletions(-)

New commits:
commit 419ae0c8a4954e561cda2a3c7cc7e2311f4a86bf
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Aug 28 17:35:05 2015 +0100

    Add missing helpful GL trace messages outside of the impl. itself.
    
    Change-Id: I5b71e3c9edc3e1e89e52c2e17b5fe0a025ac66ea
    Reviewed-on: https://gerrit.libreoffice.org/18109
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 6d9a4d1..6ddd299 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -305,7 +305,7 @@ bool OpenGLSalBitmap::ImplScaleArea( double rScaleX, double rScaleY )
 
 bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
-    SAL_INFO( "vcl.opengl", "::ImplScale" );
+    VCL_GL_INFO( "vcl.opengl", "::ImplScale" );
 
     maUserBuffer.reset();
     makeCurrent();
@@ -353,13 +353,13 @@ ScaleOp::ScaleOp(
 
 bool ScaleOp::Execute()
 {
-    SAL_INFO( "vcl.opengl", "::Execute" );
+    VCL_GL_INFO( "vcl.opengl", "::Execute" );
     return mpBitmap->ImplScale( mfScaleX, mfScaleY, mnScaleFlag );
 }
 
 void ScaleOp::GetSize( Size& rSize ) const
 {
-    SAL_INFO( "vcl.opengl", "::GetSize" );
+    VCL_GL_INFO( "vcl.opengl", "::GetSize" );
     rSize.setWidth( rSize.Width() * mfScaleX );
     rSize.setHeight( rSize.Height() * mfScaleY );
 }
@@ -368,7 +368,7 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc
 {
     OpenGLZone aZone;
 
-    SAL_INFO("vcl.opengl", "::Scale " << int(nScaleFlag)
+    VCL_GL_INFO("vcl.opengl", "::Scale " << int(nScaleFlag)
              << " from " << mnWidth << "x" << mnHeight
              << " to " << (mnWidth * rScaleX) << "x" << (mnHeight * rScaleY) );
 
@@ -382,7 +382,7 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc
         makeCurrent();
         if( mpContext == NULL )
         {
-            SAL_INFO( "vcl.opengl", "Add ScaleOp to pending operations" );
+            VCL_GL_INFO( "vcl.opengl", "Add ScaleOp to pending operations" );
             maPendingOps.push_back( new ScaleOp( this, rScaleX, rScaleY, nScaleFlag ) );
         }
         else
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 6d222f7..5861f76 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -46,7 +46,7 @@ ImplOpenGLTexture::ImplOpenGLTexture( int nWidth, int nHeight, bool bAllocate )
         glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, nWidth, nHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL );
     glBindTexture( GL_TEXTURE_2D, 0 );
 
-    SAL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " allocate" );
+    VCL_GL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " allocate" );
 
     CHECK_GL_ERROR();
 }
@@ -73,7 +73,7 @@ ImplOpenGLTexture::ImplOpenGLTexture( int nX, int nY, int nWidth, int nHeight )
     CHECK_GL_ERROR();
     glBindTexture( GL_TEXTURE_2D, 0 );
 
-    SAL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " from x" << nX << ", y" << nY );
+    VCL_GL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " from x" << nX << ", y" << nY );
 
     CHECK_GL_ERROR();
 }
@@ -98,14 +98,14 @@ ImplOpenGLTexture::ImplOpenGLTexture( int nWidth, int nHeight, int nFormat, int
     glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, mnWidth, mnHeight, 0, nFormat, nType, pData );
     glBindTexture( GL_TEXTURE_2D, 0 );
 
-    SAL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " from data" );
+    VCL_GL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " " << nWidth << "x" << nHeight << " from data" );
 
     CHECK_GL_ERROR();
 }
 
 ImplOpenGLTexture::~ImplOpenGLTexture()
 {
-    SAL_INFO( "vcl.opengl", "~OpenGLTexture " << mnTexture );
+    VCL_GL_INFO( "vcl.opengl", "~OpenGLTexture " << mnTexture );
     if( mnTexture != 0 )
         glDeleteTextures( 1, &mnTexture );
 }
@@ -119,7 +119,7 @@ bool ImplOpenGLTexture::InsertBuffer(int nX, int nY, int nWidth, int nHeight, in
     glTexSubImage2D(GL_TEXTURE_2D, 0, nX, mnHeight - nY - nHeight, nWidth, nHeight, nFormat, nType, pData);
     glBindTexture(GL_TEXTURE_2D, 0);
 
-    SAL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " Insert buff. to " << nX << " " << nY
+    VCL_GL_INFO( "vcl.opengl", "OpenGLTexture " << mnTexture << " Insert buff. to " << nX << " " << nY
                                              << " size " << nWidth << "x" << nHeight << " from data" );
     CHECK_GL_ERROR();
 
@@ -208,7 +208,7 @@ OpenGLTexture::OpenGLTexture( const OpenGLTexture& rTexture,
     mnSlotNumber = rTexture.mnSlotNumber;
     if (mpImpl)
         mpImpl->IncreaseRefCount(mnSlotNumber);
-    SAL_INFO( "vcl.opengl", "Copying texture " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() );
+    VCL_GL_INFO( "vcl.opengl", "Copying texture " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() );
 }
 
 OpenGLTexture::~OpenGLTexture()
@@ -245,7 +245,7 @@ int OpenGLTexture::GetHeight() const
 
 void OpenGLTexture::GetCoord( GLfloat* pCoord, const SalTwoRect& rPosAry, bool bInverted ) const
 {
-    SAL_INFO( "vcl.opengl", "Getting coord " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() );
+    VCL_GL_INFO( "vcl.opengl", "Getting coord " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() );
 
     if( mpImpl == NULL )
     {
@@ -362,7 +362,7 @@ void OpenGLTexture::Read( GLenum nFormat, GLenum nType, sal_uInt8* pData )
     Bind();
     glPixelStorei( GL_PACK_ALIGNMENT, 1 );
 
-    SAL_INFO( "vcl.opengl", "Reading texture " << Id() << " " << GetWidth() << "x" << GetHeight() );
+    VCL_GL_INFO( "vcl.opengl", "Reading texture " << Id() << " " << GetWidth() << "x" << GetHeight() );
 
     if( GetWidth() == mpImpl->mnWidth && GetHeight() == mpImpl->mnHeight )
     {
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index c703c64..5c64448 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -70,7 +70,7 @@ OpenGLContext::OpenGLContext():
     mpPrevContext(NULL),
     mpNextContext(NULL)
 {
-    SAL_INFO("vcl.opengl", "new context: " << this);
+    VCL_GL_INFO("vcl.opengl", "new context: " << this);
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
     mbPixmap = false;
@@ -92,7 +92,7 @@ OpenGLContext::OpenGLContext():
 
 OpenGLContext::~OpenGLContext()
 {
-    SAL_INFO("vcl.opengl", "delete context: " << this);
+    VCL_GL_INFO("vcl.opengl", "delete context: " << this);
     reset();
 
     ImplSVData* pSVData = ImplGetSVData();
@@ -571,7 +571,7 @@ GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubl
     if( dpy == 0 || !glXQueryExtension( dpy, NULL, NULL ) )
         return NULL;
 
-    SAL_INFO("vcl.opengl", "window: " << win);
+    VCL_GL_INFO("vcl.opengl", "window: " << win);
 
     XWindowAttributes xattr;
     if( !XGetWindowAttributes( dpy, win, &xattr ) )
@@ -658,7 +658,7 @@ Visual* getVisual(Display* dpy, Window win)
         SAL_WARN("vcl.opengl", "Failed to get window attributes for getVisual " << win);
         xattr.visual = NULL;
     }
-    SAL_INFO("vcl.opengl", "using VisualID " << xattr.visual);
+    VCL_GL_INFO("vcl.opengl", "using VisualID " << xattr.visual);
     return xattr.visual;
 }
 
@@ -765,7 +765,7 @@ bool OpenGLContext::ImplInit()
     TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler);
 #endif
 
-    SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
+    VCL_GL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
 
     if (!g_vShareList.empty())
         pSharedCtx = g_vShareList.front();
@@ -865,7 +865,7 @@ bool OpenGLContext::ImplInit()
             if( errorTriggered )
                 SAL_WARN("vcl.opengl", "error when trying to set swap interval, NVIDIA or Mesa bug?");
             else
-                SAL_INFO("vcl.opengl", "set swap interval to 1 (enable vsync)");
+                VCL_GL_INFO("vcl.opengl", "set swap interval to 1 (enable vsync)");
         }
     }
 
@@ -888,7 +888,7 @@ bool OpenGLContext::ImplInit()
 {
     OpenGLZone aZone;
 
-    SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
+    VCL_GL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
     // PixelFormat tells Windows how we want things to be
     PIXELFORMATDESCRIPTOR PixelFormatFront =
     {
@@ -1012,7 +1012,7 @@ bool OpenGLContext::ImplInit()
 {
     OpenGLZone aZone;
 
-    SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
+    VCL_GL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start");
     NSOpenGLView* pView = getOpenGLView();
     OpenGLWrapper::makeCurrent(pView);
 
@@ -1023,7 +1023,7 @@ bool OpenGLContext::ImplInit()
 
 bool OpenGLContext::ImplInit()
 {
-    SAL_INFO("vcl.opengl", "OpenGLContext not implemented for this platform");
+    VCL_GL_INFO("vcl.opengl", "OpenGLContext not implemented for this platform");
     return false;
 }
 
@@ -1069,7 +1069,7 @@ bool OpenGLContext::InitGLEW()
     VCL_GL_INFO("vcl.opengl", "LibreOffice GLContext initialized: " << this);
 #endif
 
-    SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----end");
+    VCL_GL_INFO("vcl.opengl", "OpenGLContext::ImplInit----end");
     mbInitialized = true;
     return true;
 }
@@ -1350,7 +1350,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool)
 
     if( vi )
     {
-        SAL_INFO("vcl.opengl", "using VisualID " << vi->visualid);
+        VCL_GL_INFO("vcl.opengl", "using VisualID " << vi->visualid);
         aWinData.pVisual = (void*)(vi->visual);
     }
 #endif
@@ -1427,7 +1427,7 @@ void OpenGLContext::makeCurrent()
 
     // move the context to the end of the contexts list
     static int nSwitch = 0;
-    SAL_INFO("vcl.opengl", "******* CONTEXT SWITCH " << ++nSwitch << " *********");
+    VCL_GL_INFO("vcl.opengl", "******* CONTEXT SWITCH " << ++nSwitch << " *********");
     if( mpNextContext )
     {
         if( mpPrevContext )
commit 308756058b77d6a0fd2f454d116185680c2bbe6b
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Aug 28 20:05:44 2015 +0100

    Avoid bogus warnings with VCL_GL_INFO, by making the optimizer work.
    
    Change-Id: Ia4afcd58b4ce0b4d6d9708a4cede0857b7633b9e
    Reviewed-on: https://gerrit.libreoffice.org/18171
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index f2fb214..646a2d3 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -24,16 +24,15 @@
 #endif
 
 /// Helper to do a SAL_INFO as well as a GL log.
-#if OSL_DEBUG_LEVEL > 0
-#  define VCL_GL_INFO(area,stream)          \
-    do {                                    \
-        ::std::ostringstream detail_stream; \
-        detail_stream << stream;            \
-        OpenGLHelper::debugMsgStream((area),detail_stream); \
-    } while (0)
-#else
-#  define VCL_GL_INFO(area,stream)
-#endif
+#define VCL_GL_INFO(area,stream) \
+    do { \
+        if (SAL_DETAIL_ENABLE_LOG_INFO) \
+        { \
+            ::std::ostringstream detail_stream; \
+            detail_stream << stream;            \
+            OpenGLHelper::debugMsgStream((area),detail_stream); \
+        } \
+    } while (false)
 
 class VCL_DLLPUBLIC OpenGLHelper
 {
commit 2be6126640a6c7a87c249f22d6647fa5a0eb88dd
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Aug 31 11:25:18 2015 +0100

    tdf#93798 - avoid apitrace provoked infinite loop dumping errors.
    
    Change-Id: I6c42e6a9ead90ed6fad2f289cd686a72cffa0c2d
    Reviewed-on: https://gerrit.libreoffice.org/18165
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index f255b3a..958d523 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -400,9 +400,14 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
 {
     OpenGLZone aZone;
 
-    GLenum glErr = glGetError();
-    if (glErr != GL_NO_ERROR)
+    int nErrors = 0;
+    for (;;)
     {
+        GLenum glErr = glGetError();
+        if (glErr == GL_NO_ERROR)
+        {
+            break;
+        }
         const char* sError = OpenGLHelper::GLErrorString(glErr);
 
         if (sError)
@@ -410,7 +415,12 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
         else
             SAL_WARN("vcl.opengl", "GL Error #" << glErr << " (no message available) in File " << pFile << " at line: " << nLine);
 
-        glErr = glGetError();
+        // tdf#93798 - apitrace appears to sometimes cause issues with an infinite loop here.
+        if (++nErrors >= 8)
+        {
+            SAL_WARN("vcl.opengl", "Breaking potentially recursive glGetError loop");
+            break;
+        }
     }
 }
 
commit 35ad7827d4d945c793d1b8bb92e71c5aec93c8bd
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Aug 26 13:06:05 2015 +0200

    do not parse range fragments as valid ranges
    
    For example, "B2:" or ":B2" were accepted as valid range, with the
    missing part set to A1, which resulted in a A1:B2 range.
    
    An omitted sheet specifier always results in a valid relative sheet,
    hence that flag is set, so testing flags for non-null before the final
    result is available isn't sufficient.
    
    Additionally this revealed a flaw in handling of external references
    when loading documents if the original file name differs from the
    resulting real file name due to relative paths.
    
    Actually now the displayed file name matches the real file name when
    such a document was loaded, where before the original file name was
    displayed.
    
    Probably such references didn't even work before if the reference
    spanned more than one sheet, which is a rather rare case for external
    references.
    
    Change-Id: I38035f2e4b3a11c0280457498cf62b02f882d2a1
    (cherry picked from commit 56238d58a7da705e4e91604964e6564d819a9196)
    Reviewed-on: https://gerrit.libreoffice.org/18035
    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>

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index fa34c64..051b062 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1198,7 +1198,14 @@ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo
             // Need document name if inherited.
             if (bExtDocInherited)
             {
-                const OUString* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId);
+                // The FileId was created using the original file name, so
+                // obtain that. Otherwise lcl_ScRange_External_TabSpan() would
+                // retrieve a FileId for the real name and bail out if that
+                // differed from pExtInfo->mnFileId, as is the case when
+                // loading documents that refer external files relative to the
+                // current own document but were saved from a different path
+                // than loaded.
+                const OUString* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId, true);
                 if (pFileName)
                     aDocName = *pFileName;
                 else
@@ -1521,7 +1528,7 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange& rRange,
                     nRes2 |= SCA_COL_ABSOLUTE;
                 }
             }
-            if (nRes1 && nRes2)
+            if ((nRes1 & SCA_VALID) && (nRes2 & SCA_VALID))
             {
                 // PutInOrder / Justify
                 sal_uInt16 nMask, nBits1, nBits2;
commit 58c105c2a0f68100c5dc5e93e31a6e48ac1a61c0
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 31 09:05:59 2015 +0200

    tdf#89245 xmloff: fix Calc header background image saving
    
    Regression from commit 7d9bb549d498d6beed2c4050c402d09643febdfa
    (Related: #i124638# Second step of DrawingLayer FillAttributes...,
    2014-06-02), the problem was that the new
    CTF_PM_REPEAT_OFFSET_X..CTF_PM_FILLTRANSNAME range's values overlapped with the
    existing CTF_PM_HEADERHEIGHT..CTF_PM_HEADERGRAPHICURL range's values, so
    when the new code in XMLPageMasterExportPropMapper::ContextFilter()
    tried to tweak header repeat offset properties, it actually disabled
    HeaderBackGraphicURL instead.
    
    (cherry picked from commit 3b40329f9a64b93b1e1230b1bff74ed8cda8cd70)
    
    Conflicts:
    	sc/qa/unit/subsequent_export-test.cxx
    
    Change-Id: I9c2700fa71a4ef2a813ec671049ee9d98171b57e
    Reviewed-on: https://gerrit.libreoffice.org/18163
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/include/xmloff/PageMasterStyleMap.hxx b/include/xmloff/PageMasterStyleMap.hxx
index a4007bd..859f3e0 100644
--- a/include/xmloff/PageMasterStyleMap.hxx
+++ b/include/xmloff/PageMasterStyleMap.hxx
@@ -90,12 +90,12 @@
 // at export time using CTF_PM_FLAGMASK and XML_PM_CTF_START as detector
 // to find the first entry for header/footer (!), see
 // SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER
-#define CTF_PM_REPEAT_OFFSET_X          (XML_PM_CTF_START + 0x0035)
-#define CTF_PM_REPEAT_OFFSET_Y          (XML_PM_CTF_START + 0x0036)
-#define CTF_PM_FILLGRADIENTNAME         (XML_PM_CTF_START + 0x0037)
-#define CTF_PM_FILLHATCHNAME            (XML_PM_CTF_START + 0x0038)
-#define CTF_PM_FILLBITMAPNAME           (XML_PM_CTF_START + 0x0039)
-#define CTF_PM_FILLTRANSNAME            (XML_PM_CTF_START + 0x0040)
+#define CTF_PM_REPEAT_OFFSET_X          (XML_PM_CTF_START + 0x0037)
+#define CTF_PM_REPEAT_OFFSET_Y          (XML_PM_CTF_START + 0x0038)
+#define CTF_PM_FILLGRADIENTNAME         (XML_PM_CTF_START + 0x0039)
+#define CTF_PM_FILLHATCHNAME            (XML_PM_CTF_START + 0x0040)
+#define CTF_PM_FILLBITMAPNAME           (XML_PM_CTF_START + 0x0041)
+#define CTF_PM_FILLTRANSNAME            (XML_PM_CTF_START + 0x0042)
 
 #define CTF_PM_SCALETO                  (XML_PM_CTF_START + 0x0051) // calc specific
 #define CTF_PM_SCALETOPAGES             (XML_PM_CTF_START + 0x0052)
diff --git a/sc/qa/unit/data/ods/header-image.ods b/sc/qa/unit/data/ods/header-image.ods
new file mode 100644
index 0000000..c19b902
Binary files /dev/null and b/sc/qa/unit/data/ods/header-image.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index bccb0cd..f6a39a29 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -146,6 +146,7 @@ public:
     void testSheetRunParagraphProperty();
     void testHiddenShape();
     void testMoveCellAnchoredShapes();
+    void testHeaderImage();
 
     CPPUNIT_TEST_SUITE(ScExportTest);
     CPPUNIT_TEST(test);
@@ -201,6 +202,7 @@ public:
     CPPUNIT_TEST(testSheetRunParagraphProperty);
     CPPUNIT_TEST(testHiddenShape);
     CPPUNIT_TEST(testMoveCellAnchoredShapes);
+    CPPUNIT_TEST(testHeaderImage);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -2808,6 +2810,20 @@ void ScExportTest::testMoveCellAnchoredShapes()
     xDocSh2->DoClose();
 }
 
+void ScExportTest::testHeaderImage()
+{
+    // Graphic as header background was lost on export.
+    ScDocShellRef xShell = loadDoc("header-image.", ODS);
+    ScDocShellRef xDocSh = saveAndReload(&(*xShell), ODS);
+    uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xDocSh->GetModel(), uno::UNO_QUERY);
+    uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
+    uno::Reference<container::XNameAccess> xPageStyles(xStyleFamilies->getByName("PageStyles"), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+    OUString aURL;
+    xStyle->getPropertyValue("HeaderBackGraphicURL") >>= aURL;
+    CPPUNIT_ASSERT(aURL.startsWith("vnd.sun.star.GraphicObject:"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit c2d6b859ad8754f9c6b329c94a3d1600d99adafc
Author: Laurent Godard <lgodard.libre at laposte.net>
Date:   Tue Aug 18 16:44:55 2015 +0200

    tdf#75973 : User Defined Types in password encrypted macros
    
    save/load basic script so that when executing password protected
    the user defined types can be rebuilt
    
    supports array and nested types
    
    New identifier B_USERTYPE for save/open macro with user defined types
    No version bump but saves binary format now to current_version
    
    a unit test in sc macros-test.cxx
    
    full round trip on password protected document (ie. use binary storage)
    master --(0)--> master --(1)--> libreoffice 4.4 --(2)--> master --(3)--> master
    (0) in master, User type supported, big module supported
    (1) in libreoffice 4.4, user type not supported, big module supported, no loss of code
    (2) in master, user type not supported, big module not found, no loss of code
    it is OK as libreoffice 4.4 saves to LegacyVersion (see sbxmod.cxx changes)
    (3) in master, User type supported, big module supported (all is restored)
    it is OK as module was saved with CURRENT_VERSION (see sbxmod.cxx changes)
    
    Change-Id: Idab5de85e948dc11f4aba631b1569a1cc1cb4bf6
    Reviewed-on: https://gerrit.libreoffice.org/17841
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index d99259b..6726da1 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -240,6 +240,99 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                 }
                 break;
             }
+            case B_USERTYPES:
+            {
+                //assuming an empty string with just the lead 32bit/16bit len indicator
+                const size_t nMinStringSize = (eCharSet == RTL_TEXTENCODING_UNICODE) ? 4 : 2;
+                const size_t nMinRecordSize = nMinStringSize + sizeof(sal_Int16);
+                const size_t nMaxRecords = r.remainingSize() / nMinRecordSize;
+                if (nCount > nMaxRecords)
+                {
+                    SAL_WARN("basic", "Parsing error: " << nMaxRecords <<
+                             " max possible entries, but " << nCount << " claimed, truncating");
+                    nCount = nMaxRecords;
+                }
+
+                // User defined types
+                for (sal_uInt16 i = 0; i < nCount; i++)
+                {
+                    OUString aTypeName = r.ReadUniOrByteString(eCharSet);
+
+                    sal_Int16 nTypeMembers;
+                    r.ReadInt16(nTypeMembers);
+
+                    SbxObject *pType = new SbxObject(aTypeName);
+                    SbxArray *pTypeMembers = pType->GetProperties();
+
+                    for (sal_uInt16 j = 0; j < nTypeMembers; j++)
+                    {
+                        OUString aMemberName = r.ReadUniOrByteString(eCharSet);
+
+                        sal_Int16 aIntMemberType;
+                        r.ReadInt16(aIntMemberType);
+                        SbxDataType aMemberType = static_cast< SbxDataType > ( aIntMemberType );
+
+                        SbxProperty *pTypeElem = new SbxProperty( aMemberName, aMemberType );
+
+                        sal_uInt32 aIntFlag;
+                        r.ReadUInt32(aIntFlag);
+                        SbxFlagBits nElemFlags = static_cast< SbxFlagBits > ( aIntFlag );
+
+                        pTypeElem->SetFlags(nElemFlags);
+
+                        sal_Int16 hasObject;
+                        r.ReadInt16(hasObject);
+
+                        if (hasObject == 1)
+                        {
+                            if(aMemberType == SbxOBJECT)
+                            {
+                                // nested user defined types
+                                // declared before use, so it is ok to reference it by name on load
+                                OUString aNestedTypeName = r.ReadUniOrByteString(eCharSet);
+                                SbxObject* pNestedTypeObj = static_cast< SbxObject* >( rTypes->Find( aNestedTypeName, SbxCLASS_OBJECT ) );
+                                if (pNestedTypeObj)
+                                {
+                                    SbxObject* pCloneObj = cloneTypeObjectImpl( *pNestedTypeObj );
+                                    pTypeElem->PutObject( pCloneObj );
+                                }
+                            }
+                            else
+                            {
+                                // an array
+                                SbxDimArray* pArray = new SbxDimArray();
+
+                                sal_Int16 isFixedSize;
+                                r.ReadInt16(isFixedSize);
+                                if (isFixedSize == 1)
+                                    pArray->setHasFixedSize( true );
+
+                                sal_Int32 nDims;
+                                r.ReadInt32(nDims);
+                                for (sal_Int32 d = 0; d < nDims; d++)
+                                {
+                                    sal_Int32 lBound;
+                                    sal_Int32 uBound;
+                                    r.ReadInt32(lBound).ReadInt32(uBound);
+                                    pArray->unoAddDim32(lBound, uBound);
+                                }
+
+                                pTypeElem->PutObject( pArray );
+                            }
+                        }
+
+                        pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
+
+                    }
+
+                    pType->Remove( OUString("Name"), SbxCLASS_DONTCARE );
+                    pType->Remove( OUString("Parent"), SbxCLASS_DONTCARE );
+
+                    AddType(pType);
+                }
+
+                break;
+            }
             case B_MODEND:
                 goto done;
             default:
@@ -360,6 +453,84 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
         pByteStrings.reset();
         SbiCloseRecord( r, nPos );
     }
+    // User defined types
+    if (rTypes)
+    {
+        sal_uInt16 nTypes = rTypes->Count();
+        if (nTypes > 0 )
+        {
+            nPos = SbiOpenRecord( r, B_USERTYPES, nTypes );
+
+            for (sal_uInt16 i = 0; i < nTypes; i++)
+            {
+                SbxObject* pType = static_cast< SbxObject* > ( rTypes->Get(i) );
+                OUString aTypeName = pType->GetClassName();
+
+                r.WriteUniOrByteString( aTypeName, eCharSet );
+
+                SbxArray  *pTypeMembers = pType->GetProperties();
+                sal_uInt16 nTypeMembers = pTypeMembers->Count();
+
+                r.WriteInt16(nTypeMembers);
+
+                for (sal_uInt16 j = 0; j < nTypeMembers; j++)
+                {
+
+                    SbxProperty* pTypeElem = static_cast< SbxProperty* > ( pTypeMembers->Get(j) );
+
+                    OUString aElemName = pTypeElem->GetName();
+                    r.WriteUniOrByteString( aElemName, eCharSet );
+
+                    SbxDataType dataType =   pTypeElem->GetType();
+                    r.WriteInt16(dataType);
+
+                    SbxFlagBits nElemFlags = pTypeElem->GetFlags();
+                    r.WriteUInt32(static_cast< sal_uInt32 > (nElemFlags) );
+
+                    SbxBase* pElemObject = pTypeElem->GetObject();
+
+                    if (pElemObject)
+                    {
+                        r.WriteInt16(1); // has elem Object
+
+                        if( dataType == SbxOBJECT )
+                        {
+                            // nested user defined types
+                            // declared before use, so it is ok to reference it by name on load
+                            SbxObject* pNestedType = static_cast< SbxObject* > ( pElemObject );
+                            r.WriteUniOrByteString( pNestedType->GetClassName(), eCharSet );
+                        }
+                        else
+                        {
+                            // an array
+                            SbxDimArray* pArray = static_cast< SbxDimArray* > ( pElemObject );
+
+                            bool bFixedSize = pArray->hasFixedSize();
+                            if (bFixedSize)
+                                r.WriteInt16(1);
+                            else
+                                r.WriteInt16(0);
+
+                            sal_Int32 nDims = pArray->GetDims();
+                            r.WriteInt32(nDims);
+
+                            for (sal_Int32 d = 0; d < nDims; d++)
+                            {
+                                sal_Int32 lBound;
+                                sal_Int32 uBound;
+                                pArray->GetDim32(d, lBound, uBound);
+                                r.WriteInt32(lBound).WriteInt32(uBound);
+                            }
+                        }
+                    }
+                    else
+                        r.WriteInt16(0); // no elem Object
+
+                }
+            }
+        SbiCloseRecord( r, nPos );
+        }
+    }
     // Set overall length
     SbiCloseRecord( r, nStart );
     if( !SbiGood( r ) )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index e6375e2..aaa9db9 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1806,11 +1806,6 @@ bool SbModule::HasExeCode()
 }
 
 // Store only image, no source
-bool SbModule::StoreBinaryData( SvStream& rStrm )
-{
-    return StoreBinaryData( rStrm, 0 );
-}
-
 bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
 {
     bool bRet = Compile();
diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx
index 9b294a8..db0b1f6 100644
--- a/basic/source/inc/filefmt.hxx
+++ b/basic/source/inc/filefmt.hxx
@@ -38,10 +38,13 @@ class SvStream;
 // Version  F: #57844 introduction of SvNumberformat::StringToDouble
 // Version 10: #29955 generate for-loop-level in Statement-PCodes
 // Version 11: #29955 force anew compilation because of build-inconsistences
+// Version 12: aoo#64377 increase code size that basic can handle
+//             tdf#75973 support user defined types B_USERTYPES in password protected macros
+//
 
 #define B_LEGACYVERSION 0x00000011L
-#define B_CURVERSION 0x00000012L
 #define B_EXT_IMG_VERSION 0x00000012L
+#define B_CURVERSION 0x00000012L
 
 // The file contains either a module- or a library-record.
 // Those records contain further records. Every record's got
@@ -69,6 +72,9 @@ class SvStream;
 #define B_SBXOBJECTS    0x5853      // SX SBX objects
 #define B_EXTSOURCE     0x5345      // ES extended source
 
+#define B_USERTYPES     0x4369      // UT user defined types
+
+
 // A library record contains only module records
 //  sal_uInt16 identifier BL
 //  sal_uInt32 the record's length
@@ -153,6 +159,28 @@ class SvStream;
 // sal_uInt16 number of objects
 // ....   object data
 
+// user defined types B_USERTYPES :
+//  sal_uInt16  identifier UT
+//  sal_uInt32  the record's length
+//  sal_uInt16  number of types
+//  Data for every user defined type:
+//    string instance type name
+//    sal_Int16  number of type members
+//    Data for every type member:
+//      string     name
+//      sal_Int16 type
+//      sal_uInt32 flags
+//      sal_Int16 hasObjects (0/1)
+//      If hasObjects
+//        If member type is nested type
+//          string   nested type name
+//        Else (array declaration)
+//          sal_Int16  isFixedSize (0/1)
+//          sal_Int32  number of dimensions
+//          Data for every dimension:
+//            sal_Int32  lower bound
+//            sal_Int32  upper bound
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index ae1b9bf..bbf1fa6 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "scriptcont.hxx"
+#include <filefmt.hxx>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/xml/sax/Parser.hpp>
 #include <com/sun/star/xml/sax/InputSource.hpp>
@@ -652,7 +653,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
                         throw uno::RuntimeException();
                     }
                     SvMemoryStream aMemStream;
-                    /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream );
+                    /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream, B_CURVERSION );
 
                     sal_Size nSize = aMemStream.Tell();
                     Sequence< sal_Int8 > aBinSeq( nSize );
@@ -795,7 +796,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
                                             embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
 
                         SvMemoryStream aMemStream;
-                        /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream );
+                        /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream, B_CURVERSION );
 
                         sal_Size nSize = aMemStream.Tell();
                         Sequence< sal_Int8 > aBinSeq( nSize );
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx
index c5a9e16..cddfffb 100644
--- a/include/basic/sbmod.hxx
+++ b/include/basic/sbmod.hxx
@@ -119,7 +119,6 @@ public:
     void ClearAllBP();
 
     // Store only image, no source (needed for new password protection)
-    bool     StoreBinaryData( SvStream& );
     bool     StoreBinaryData( SvStream&, sal_uInt16 nVer );
     bool     LoadBinaryData( SvStream&, sal_uInt16 nVer );
     bool     LoadBinaryData( SvStream& );
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 3bc3a94..745de86 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -40,6 +40,7 @@ public:
     void testStarBasic();
     void testVba();
     void testMSP();
+    void testPasswordProtectedStarBasic();
 #endif
     CPPUNIT_TEST_SUITE(ScMacrosTest);
 #if !defined(MACOSX)
@@ -48,6 +49,7 @@ public:
     CPPUNIT_TEST(testStarBasic);
     CPPUNIT_TEST(testMSP);
     CPPUNIT_TEST(testVba);
+    CPPUNIT_TEST(testPasswordProtectedStarBasic);
 #endif
 
     CPPUNIT_TEST_SUITE_END();
@@ -96,6 +98,37 @@ void ScMacrosTest::testMSP()
     xDocSh->DoClose();
 }
 
+void ScMacrosTest::testPasswordProtectedStarBasic()
+{
+    const OUString aFileNameBase("testTypePassword.ods");
+    OUString aFileName;
+    createFileURL(aFileNameBase, aFileName);
+    uno::Reference< com::sun::star::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+
+    CPPUNIT_ASSERT_MESSAGE("Failed to load testTypePassword.ods", xComponent.is());
+
+    Any aRet;
+    Sequence< sal_Int16 > aOutParamIndex;
+    Sequence< Any > aOutParam;
+    Sequence< uno::Any > aParams;
+
+    SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent);
+
+    CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
+    ScDocShell* xDocSh = static_cast<ScDocShell*>(pFoundShell);
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    SfxObjectShell::CallXScript(
+        xComponent,
+        "vnd.sun.Star.script:MyLibrary.Module1.Main?language=Basic&location=document",
+        aParams, aRet, aOutParamIndex, aOutParam);
+
+    OUString aValue = rDoc.GetString(0,0,0);
+    CPPUNIT_ASSERT_MESSAGE("script did not change the value of Sheet1.A1", aValue == "success");
+
+    xDocSh->DoClose();
+}
+
 void ScMacrosTest::testStarBasic()
 {
     const OUString aFileNameBase("StarBasic.ods");
diff --git a/sc/qa/extras/testdocuments/testTypePassword.ods b/sc/qa/extras/testdocuments/testTypePassword.ods
new file mode 100644
index 0000000..80a0006
Binary files /dev/null and b/sc/qa/extras/testdocuments/testTypePassword.ods differ
commit 9a5cbcd33da0c9d7bd86b7c3a49e7c6fc9ddd07f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 7 14:16:42 2015 +0100

    VclPtr: no dialog loaded from a .ui ever actually destructed
    
    Change-Id: I51a0596049a43cbc80f914f3d8491c2125c8109e
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/18158
    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>

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 40d4614..dba80c0 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -543,6 +543,7 @@ void VclBuilder::disposeBuilder()
         delete aI->m_pMenu;
     }
     m_aMenus.clear();
+    m_pParent.clear();
 }
 
 void VclBuilder::handleTranslations(xmlreader::XmlReader &reader)
commit e1cc124f486cba4a381b95d6e339f58491ea53f3
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Aug 31 07:30:00 2015 +0100

    WaE: remove unused parameter.
    
    Change-Id: Idd7ec17eed51f79ead56349bb644945826d0a695

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index aab2f10..f262724 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -119,7 +119,7 @@ char ColorFor(COLORREF aColor)
     return '0' + (10*(GetRValue(aColor) + GetGValue(aColor) + GetBValue(aColor))) / (0xFF*3);
 }
 
-void DumpGlyphBitmap(OpenGLGlyphCacheChunk& rChunk, HDC hDC)
+void DumpGlyphBitmap(OpenGLGlyphCacheChunk&, HDC hDC)
 {
     HBITMAP hBitmap = static_cast<HBITMAP>(GetCurrentObject(hDC, OBJ_BITMAP));
     if (hBitmap == NULL)
commit 887ce997a711628352ea4504183461bb79075718
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 30 20:14:16 2015 +0100

    pClientData can be null
    
    Change-Id: I9375f84affdaef30d9b1ded31525e6b7b8709cbc
    (cherry picked from commit 7d4c77e374310bef538465d11980d1d610cbe0f1)
    Reviewed-on: https://gerrit.libreoffice.org/18149
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 42f8b1b..d952684 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2587,7 +2587,7 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
 bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const
 {
     bool bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId );
-    if ( !bRet )
+    if (!bRet && pClientData)
     {
         ProcessData& rData = *static_cast<ProcessData*>(pClientData);
         PptSlidePersistEntry& rPersistEntry = rData.rPersistEntry;
diff --git a/sd/qa/unit/data/ppt/pass/crash-3.ppt b/sd/qa/unit/data/ppt/pass/crash-3.ppt
new file mode 100644
index 0000000..daa0102
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/crash-3.ppt differ
commit 41a545ec0737cca447f68a4b22ed7abf11d32677
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat Aug 29 23:52:06 2015 +0100

    tdf#93536 - avoid crash when calling ToTop on disposed window.
    
    Change-Id: I677f47f6b60271dc56c9d3d123cf982c00866eb9
    Reviewed-on: https://gerrit.libreoffice.org/18136
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    Tested-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index dc0f78e..52d9685 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -438,6 +438,8 @@ void Window::ImplHideAllOverlaps()
 
 void Window::ToTop( sal_uInt16 nFlags )
 {
+    if (!mpWindowImpl)
+        return;
 
     ImplStartToTop( nFlags );
     ImplFocusToTop( nFlags, IsReallyVisible() );
commit 25d0a907823ccccd283f17d5e962292a9cd4dd44
Author: Tor Lillqvist <tml at collabora.com>
Date:   Sun Aug 30 08:31:27 2015 +0300

    Don't check SAL_DETAIL_ENABLE_LOG_INFO, check SAL_LOG_INFO
    
    SAL_DETAIL_ENABLE_LOG_INFO is always defined, as "true" or "false". It
    is SAL_LOG_INFO that is defined or not, and can be used to avoid
    unnecessary non-trivial code that the compiler might not be able to
    optimise away.
    
    Change-Id: I9903faab64b39fee86bff3b085cdce3614b0d921
    (cherry picked from commit d23a1f4dabda939a216293c150c3679b0979d0bd)

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index f0311a4..aab2f10 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -105,7 +105,7 @@ public:
     const OpenGLGlyphCacheChunk&  GetCachedGlyphChunkFor(int nGlyphIndex) const;
 };
 
-#ifdef SAL_DETAIL_ENABLE_LOG_INFO
+#ifdef SAL_LOG_INFO
 
 namespace {
 
@@ -150,7 +150,7 @@ void DumpGlyphBitmap(OpenGLGlyphCacheChunk& rChunk, HDC hDC)
 
 } // anonymous namespace
 
-#endif // SAL_DETAIL_ENABLE_LOG_INFO
+#endif // SAL_LOG_INFO
 
 template< typename charT, typename traits >
 inline std::basic_ostream<charT, traits> & operator <<(
@@ -428,7 +428,7 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
     if (hNonAntialiasedFont != NULL)
         DeleteObject(hNonAntialiasedFont);
 
-#ifdef SAL_DETAIL_ENABLE_LOG_INFO
+#ifdef SAL_LOG_INFO
     SAL_INFO("vcl.gdi.opengl", "this=" << this << " now: " << maOpenGLGlyphCache);
     DumpGlyphBitmap(aChunk, aDC.getCompatibleHDC());
 #endif
commit 5e463fc3a09ab5103012d5df5011b2a23bf7bed6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Aug 26 19:04:50 2015 +0200

    ODF import: workaround dubious draw:fill="solid" on frame styles
    
    Since the gradient frame backgrounds were added in LO 4.1, we export
    this:
    
     fo:background-color="transparent" draw:fill="solid"
    
    Which doesn't make a whole lot of sense as this is really a "none" fill,
    and now with the backward compatibility stuff in the style import code
    we get the pool default color added when setting the BackTransparent
    property, and with the draw:fill="solid" it becomes visible and the
    background color is now Sky Blue 1.
    
    So try to detect draw:fill="solid" without draw:fill-color attribute
    and contradicting transparent legacy attribute and nerf it.  This way
    we also export draw:fill="none" again, although still with a bogus
    draw:fill-color but that shouldn't cause any harm.
    
    Change-Id: I1c2bea46ba7d9a3f042b875df0ca12c7f6037909
    (cherry picked from commit 68efa6f5128abf4cd097ae81a4cfd7fecbcb2a80)
    Reviewed-on: https://gerrit.libreoffice.org/18040
    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>

diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx
index 2562abb..5fa8e3c 100644
--- a/include/xmloff/txtprmap.hxx
+++ b/include/xmloff/txtprmap.hxx
@@ -198,6 +198,8 @@
 #define CTF_RELHEIGHTREL                    (XML_TEXT_CTF_START + 169)
 #define CTF_CHAR_BACKGROUND                 (XML_TEXT_CTF_START + 170)
 #define CTF_CHAR_HIGHLIGHT                  (XML_TEXT_CTF_START + 171)
+#define CTF_FILLSTYLE                       (XML_TEXT_CTF_START + 172)
+#define CTF_FILLCOLOR                       (XML_TEXT_CTF_START + 173)
 
 
 enum class TextPropMap {
diff --git a/sw/qa/extras/odfexport/data/tdf92379.fodt b/sw/qa/extras/odfexport/data/tdf92379.fodt
index 8aeb9c4..762a04d 100644
--- a/sw/qa/extras/odfexport/data/tdf92379.fodt
+++ b/sw/qa/extras/odfexport/data/tdf92379.fodt
@@ -36,6 +36,11 @@
         <style:columns fo:column-count="1" fo:column-gap="0in"/>
       </style:graphic-properties>
     </style:style>
+    <style:style style:name="Untitled1" style:family="graphic" style:parent-style-name="encarts">
+      <style:graphic-properties fo:background-color="transparent" style:background-transparency="100%" draw:fill="solid">
+        <style:background-image/>
+      </style:graphic-properties>
+    </style:style>
 
     <!-- "Titre Avis expert" and derived styles from bugdoc -->
     <style:style style:name="Titre_20_Avis_20_expert" style:display-name="Titre Avis expert" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="">
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 735cd05..dd19b0c 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -244,6 +244,23 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "FillColor"));
     CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence"));
 
+    uno::Reference<beans::XPropertySet> xFrameStyle2(xStyles->getByName("Untitled1"),
+            uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xFrameStyle2, "BackColorRGB"));
+    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xFrameStyle2, "BackTransparent"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(xFrameStyle2, "BackColorTransparency"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xFrameStyle2, "FillStyle"));
+// unfortunately this is actually the pool default value, which would be hard to fix - but it isn't a problem because style is NONE
+//    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xFrameStyle2, "FillColor"));
+//    CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xFrameStyle2, "FillTransparence"));
+
+    if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+    {
+        // check that fo:background-color attribute is exported properly
+        assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='encarts']/style:graphic-properties[@fo:background-color='#ffcc99']", 1);
+        assertXPath(pXmlDoc, "//style:style[@style:family='graphic' and @style:name='Untitled1']/style:graphic-properties[@fo:background-color='transparent']", 1);
+    }
+
     // paragraph style fo:background-color was wrongly inherited despite being
     // overridden in derived style
     uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles"));
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 009c2ec..d1514d4 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -106,8 +106,8 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
     GMAP( "LineCap",                        XML_NAMESPACE_SVG , XML_STROKE_LINECAP,         XML_SD_TYPE_LINECAP, 0 ),
 
     // fill attributes
-    GMAP( "FillStyle",                      XML_NAMESPACE_DRAW, XML_FILL,                   XML_SD_TYPE_FILLSTYLE, 0 ),
-    GMAP_D("FillColor",                     XML_NAMESPACE_DRAW, XML_FILL_COLOR,             XML_TYPE_COLOR, 0),
+    GMAP( "FillStyle",                      XML_NAMESPACE_DRAW, XML_FILL,                   XML_SD_TYPE_FILLSTYLE, CTF_FILLSTYLE ),
+    GMAP_D("FillColor",                     XML_NAMESPACE_DRAW, XML_FILL_COLOR,             XML_TYPE_COLOR, CTF_FILLCOLOR ),
     GMAP_D("FillColor2",                    XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR,   XML_TYPE_COLOR, 0),
     GMAP( "FillGradientName",               XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME,     XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLGRADIENTNAME ),
     GMAP( "FillGradientStepCount",          XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT,    XML_TYPE_NUMBER16, 0 ),
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index ab11b94..2ee33fc 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -20,6 +20,7 @@
 #include <osl/thread.h>
 #include <com/sun/star/awt/FontFamily.hpp>
 #include <com/sun/star/awt/FontPitch.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/SizeType.hpp>
@@ -408,6 +409,8 @@ void XMLTextImportPropertyMapper::finished(
     XMLPropertyState* pAllMargin = 0;
     XMLPropertyState* pMargins[4] = { 0, 0, 0, 0 };
     ::std::unique_ptr<XMLPropertyState> pNewMargins[4];
+    XMLPropertyState* pFillStyle(nullptr);
+    XMLPropertyState* pFillColor(nullptr);
 
     for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
          aIter != rProperties.end();
@@ -491,6 +494,8 @@ void XMLTextImportPropertyMapper::finished(
                                         bHasAnyWidth = true; break;
         case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break;
         case CTF_BACKGROUND_TRANSPARENT:  pBackTransparent = property; break;
+        case CTF_FILLSTYLE:             pFillStyle = property; break;
+        case CTF_FILLCOLOR:             pFillColor = property; break;
         case CTF_PARAMARGINALL:
         case CTF_PARAMARGINALL_REL:
                 pAllParaMargin = property; break;
@@ -653,6 +658,15 @@ void XMLTextImportPropertyMapper::finished(
                        pFontStyleNameCTL, pFontFamilyCTL, pFontPitchCTL, pFontCharSetCTL,
                        &pNewFontStyleNameCTL, &pNewFontFamilyCTL, &pNewFontPitchCTL, &pNewFontCharSetCTL );
 
+    if (pFillStyle && !pFillColor && pBackTransparent
+        && drawing::FillStyle_SOLID == pFillStyle->maValue.get<drawing::FillStyle>()
+        && pBackTransparent->maValue.get<bool>())
+    {
+        // fo:background="transparent", draw:fill="solid" without draw:fill-color
+        // prevent getSvxBrushItemFromSourceSet from adding bogus default color
+        pFillStyle->mnIndex = -1;
+    }
+
     // #i5775# don't overwrite %transparency with binary transparency
     if( ( pBackTransparency != NULL ) && ( pBackTransparent != NULL ) )
     {
commit 56218a88d684cfb8269be7061ab984d7a9b05a6a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Aug 25 23:29:18 2015 +0200

    related: tdf#92379: sw: backward compatible ODF export of overriding
    
    ... frame/paragraph backgrounds.
    
    If a style is set to have draw:fill="solid" and a derived style to
    draw:fill="none" then the derived one must have
    fo:background-color="transparent" to override the parent for old
    consumers like LO <= 4.3/AOO <= 4.1 that don't understand draw:fill.
    
    Change-Id: I5b56c7ace927338239195c6bfcfef1950544c8d2
    (cherry picked from commit 25c50a71ffdf7c43f8f3dd10736188271cc75ef0)
    Reviewed-on: https://gerrit.libreoffice.org/18039
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 94fbd5b..735cd05 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -284,6 +284,15 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt")
 //    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle32, "FillColor"));
 //    CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle32, "FillTransparence"));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0x461900), getProperty<sal_Int32>(xStyle32, "CharColor"));
+
+    if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+    {
+        // check that fo:background-color attribute is exported properly
+        assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Titre Avis expert']/style:paragraph-properties[@fo:background-color='#661900']", 1);
+        assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert questions']/style:paragraph-properties[@fo:background-color='transparent']", 1);
+        assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='avis expert questions non cadres']/style:paragraph-properties[@fo:background-color='#801900']", 1);
+        assertXPath(pXmlDoc, "//style:style[@style:family='paragraph' and @style:display-name='Avis expert rXponses']/style:paragraph-properties[@fo:background-color='transparent']", 1);
+    }
 }
 
 DECLARE_ODFEXPORT_TEST(testFdo79358, "fdo79358.odt")
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 05dd0da..b4a8a4f 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -286,7 +286,18 @@ bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet,
     switch (eFill)
     {
         case drawing::FillStyle_NONE:
-            return false; // ignoring some extremely limited XFillColorItem eval
+            // claim that BackColor and BackTransparent are available so that
+            // fo:background="transparent" attribute is exported to override
+            // the parent style in case it is != NONE
+            switch (nMID)
+            {
+                case MID_BACK_COLOR:
+                case MID_BACK_COLOR_R_G_B:
+                case MID_GRAPHIC_TRANSPARENT: // this is *BackTransparent
+                    return true;
+                default:
+                    return false;
+            }
             break;
         case drawing::FillStyle_SOLID:
         case drawing::FillStyle_GRADIENT: // gradient and hatch don't exist in
@@ -294,6 +305,7 @@ bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet,
             switch (nMID)
             {
                 case MID_BACK_COLOR:
+                case MID_GRAPHIC_TRANSPARENT: // this is *BackTransparent
                     // Gradient/Hatch always have emulated color
                     return (drawing::FillStyle_SOLID != eFill)
                         || SfxItemState::SET == rSet.GetItemState(XATTR_FILLCOLOR)
commit a19985cb4405891ae8f34dd1cd4f1681af1d71ed
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Aug 25 19:08:00 2015 +0200

    tdf#92379: sw: ODF import: fix fo:background-color="transparent"
    
    The problem is that if the FillStyle is NONE, setting only
    ParaBackTransparent but not ParaBackColor does absolutely nothing.
    
    This means that if a parent style sets a background color, then a
    derived style cannot override it to be transparent.
    
    Cause is that getSvxBrushItemFromSourceSet() defaults to setting a
    0xFF transparency on the SvxBrushItem.
    
    There is still a problem that getSvxBrushItemFromSourceSet() sets the
    pool default item's color and that is also exported to ODF again as
    draw:fill-color, but together with draw:fill="none" it should not cause
    harm, at least for consumers that prefer draw:fill attributes like
    LO >= 4.4.
    
    (regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)
    
    Change-Id: I5312901166a0e6f0cf02369b173dc8498e4113ed
    (cherry picked from commit f38f018053a43d1f7b473103e936abe2d4d8fa05)
    Reviewed-on: https://gerrit.libreoffice.org/18038
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/odfexport/data/tdf92379.fodt b/sw/qa/extras/odfexport/data/tdf92379.fodt
index 280dc5a..8aeb9c4 100644
--- a/sw/qa/extras/odfexport/data/tdf92379.fodt
+++ b/sw/qa/extras/odfexport/data/tdf92379.fodt
@@ -37,6 +37,32 @@
       </style:graphic-properties>
     </style:style>
 
+    <!-- "Titre Avis expert" and derived styles from bugdoc -->
+    <style:style style:name="Titre_20_Avis_20_expert" style:display-name="Titre Avis expert" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="">
+      <style:paragraph-properties fo:text-align="start" style:justify-single-word="false" style:page-number="auto" fo:background-color="#661900">
+        <style:background-image/>
+      </style:paragraph-properties>
+      <style:text-properties fo:color="#ffffff" />
+    </style:style>
+    <style:style style:name="Avis_20_expert_20_questions" style:display-name="Avis expert questions" style:family="paragraph" style:parent-style-name="Titre_20_Avis_20_expert" style:master-page-name="">
+      <style:paragraph-properties fo:line-height="100%" fo:text-align="start" style:justify-single-word="false" style:page-number="auto" fo:background-color="transparent">
+        <style:background-image/>
+      </style:paragraph-properties>
+      <style:text-properties fo:color="#661900" />
+    </style:style>
+    <style:style style:name="avis_20_expert_20_questions_20_non_20_cadres" style:display-name="avis expert questions non cadres" style:family="paragraph" style:parent-style-name="Avis_20_expert_20_questions" style:master-page-name="">
+      <style:paragraph-properties style:page-number="auto" fo:background-color="#801900" style:shadow="none">
+        <style:tab-stops/>
+        <style:background-image/>
+      </style:paragraph-properties>
+    </style:style>
+    <style:style style:name="Avis_20_expert_20_rXponses" style:display-name="Avis expert rXponses" style:family="paragraph" style:parent-style-name="Avis_20_expert_20_questions" style:master-page-name="">
+      <style:paragraph-properties fo:line-height="100%" fo:text-align="justify" style:justify-single-word="false" fo:orphans="0" fo:widows="0" fo:hyphenation-ladder-count="1" style:page-number="auto" fo:background-color="transparent">
+        <style:background-image/>
+      </style:paragraph-properties>
+      <style:text-properties fo:color="#461900" fo:hyphenate="true" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+    </style:style>
+
  </office:styles>
  <office:automatic-styles>
   <style:page-layout style:name="pm1">
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 69f97ee..94fbd5b 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -242,7 +242,48 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xStyle, "BackColorTransparency"));
     CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle, "FillStyle"));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "FillColor"));
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xStyle, "FillTransparence"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence"));
+
+    // paragraph style fo:background-color was wrongly inherited despite being
+    // overridden in derived style
+    uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles"));
+    uno::Reference<beans::XPropertySet> xStyle1(xParaStyles->getByName(
+            "Titre Avis expert"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle1, "ParaBackColor"));
+    CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle1, "ParaBackTransparent"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle1, "FillStyle"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle1, "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle1, "FillTransparence"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle1, "CharColor"));
+
+    uno::Reference<beans::XPropertySet> xStyle2(xParaStyles->getByName(
+            "Avis expert questions"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_TRANSPARENT), getProperty<sal_Int32>(xStyle2, "ParaBackColor"));
+    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle2, "ParaBackTransparent"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xStyle2, "FillStyle"));
+// unfortunately this is actually the pool default value, which would be hard to fix - but it isn't a problem because style is NONE
+//    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle2, "FillColor"));
+//    CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle2, "FillTransparence"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle2, "CharColor"));
+
+    uno::Reference<beans::XPropertySet> xStyle31(xParaStyles->getByName(
+            "avis expert questions non cadres"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x801900), getProperty<sal_Int32>(xStyle31, "ParaBackColor"));
+    CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle31, "ParaBackTransparent"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle31, "FillStyle"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x801900), getProperty<sal_Int32>(xStyle31, "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle31, "FillTransparence"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle31, "CharColor"));
+
+    uno::Reference<beans::XPropertySet> xStyle32(xParaStyles->getByName(
+            "Avis expert rXponses"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_TRANSPARENT), getProperty<sal_Int32>(xStyle32, "ParaBackColor"));
+    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle32, "ParaBackTransparent"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xStyle32, "FillStyle"));
+// unfortunately this is actually the pool default value, which would be hard to fix - but it isn't a problem because style is NONE
+//    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle32, "FillColor"));
+//    CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle32, "FillTransparence"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0x461900), getProperty<sal_Int32>(xStyle32, "CharColor"));
 }
 
 DECLARE_ODFEXPORT_TEST(testFdo79358, "fdo79358.odt")
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index fd3b27b..57688c4 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1766,7 +1766,11 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
 
             aChangedBrushItem.PutValue(aValue, nMemberId);
 
-            if(!(aChangedBrushItem == aOriginalBrushItem))
+            if (!(aChangedBrushItem == aOriginalBrushItem) ||
+                // 0xff is already the default - but if BackTransparent is set
+                // to true, it must be applied in the item set on ODF import
+                // to potentially override parent style, which is unknown yet
+                (MID_GRAPHIC_TRANSPARENT == nMemberId && aValue.has<bool>() && aValue.get<bool>()))
             {
                 setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet);
             }
commit eadf257a60d699aa1b658bef515ac2e1bf8cbc1b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Aug 21 18:28:23 2015 +0200

    tdf#92379: svx: don't overwrite fo:background-color on ODF import
    
    getSvxBrushItemFromSourceSet() is called once for each property of a
    frame style that is set, and the "solid" fill-style is set by first
    applying the BackColorRGB and then BackTransparency property.  So there
    is an intermediate state that has fill-style NONE but a XFillColorItem
    set - don't reset the color to white in that case!
    
    Apparently writerfilter generally relies on the current reset-to-AUTO
    implementation (loads of test failures), so for now limit the fix for
    when we know that a frame style is imported from ODF.
    
    (regression from 3d399b0e45720354fc64dc3d121ee486e01eff89)
    
    (cherry picked from commit 79fb61efb847405fa47235002b52ee8efad5e339)
    
    tdf#92379: sw: unit test for frame style background color
    
    (cherry picked from commit 982537d77c2db463cc053cfdcd522530a3834c9e)
    
    Change-Id: Ia987fe586ec819a1f3cd85acdbfb03c74ca0ec2c
    Reviewed-on: https://gerrit.libreoffice.org/18037
    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>

diff --git a/include/svx/unobrushitemhelper.hxx b/include/svx/unobrushitemhelper.hxx
index eea95b6..4055c45 100644
--- a/include/svx/unobrushitemhelper.hxx
+++ b/include/svx/unobrushitemhelper.hxx
@@ -46,7 +46,8 @@ SVX_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet(
 SVX_DLLPUBLIC SvxBrushItem getSvxBrushItemFromSourceSet(
     const SfxItemSet& rSourceSet,
     sal_uInt16 nBackgroundID,
-    bool bSearchInParents = true);
+    bool bSearchInParents = true,
+    bool bXMLImportHack = false);
 
 #endif // _UNOBRUSHITEMHELPER_HXX
 
diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx
index 42b3d5f..1ae4c14 100644
--- a/svx/source/unodraw/unobrushitemhelper.cxx
+++ b/svx/source/unodraw/unobrushitemhelper.cxx
@@ -192,7 +192,7 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchI
 }
 
 //UUUU
-SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents)
+SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
 {
     const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem*  >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents)));
 
@@ -201,8 +201,8 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
         // no fill, still need to rescue the evtl. set RGB color, but use as transparent color (we have drawing::FillStyle_NONE)
         Color aFillColor(static_cast< const XFillColorItem& >(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents)).GetColorValue());
 
-        // when fill style is none, then don't allow anything other than 0 or auto.
-        if (aFillColor.GetColor() != 0)
+        // for writerfilter: when fill style is none, then don't allow anything other than 0 or auto.
+        if (!bXMLImportHack && aFillColor.GetColor() != 0)
             aFillColor.SetColor(COL_AUTO);
 
         aFillColor.SetTransparency(0xff);
diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk
index 7bc7ed8..c6ec626 100644
--- a/sw/CppunitTest_sw_odfexport.mk
+++ b/sw/CppunitTest_sw_odfexport.mk
@@ -56,6 +56,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfexport,\
     embeddedobj/util/embobj \
     filter/source/config/cache/filterconfig1 \
     filter/source/storagefilterdetect/storagefd \
+	filter/source/odfflatxml/odfflatxml \
+	filter/source/xmlfilterdetect/xmlfd \
+	filter/source/xmlfilteradaptor/xmlfa \
     framework/util/fwk \
     i18npool/util/i18npool \
     linguistic/source/lng \
diff --git a/sw/qa/extras/odfexport/data/tdf92379.fodt b/sw/qa/extras/odfexport/data/tdf92379.fodt
new file mode 100644
index 0000000..280dc5a
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf92379.fodt
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:meta><meta:initial-creator>ms </meta:initial-creator><meta:creation-date>2015-08-24T21:49:45.305718699</meta:creation-date><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/><meta:generator>LibreOfficeDev/4.3.7.2$Linux_X86_64 LibreOffice_project/8a35821d8636a03b8bf4e15b48f59794652c68ba</meta:generator></office:meta>
+ <office:font-face-decls>
+  <style:font-face style:name="Lohit Devanagari1" svg:font-family="'Lohit Devanagari'"/>
+  <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+  <style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/>
+  <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="Source Han Sans CN Regular" svg:font-family="'Source Han Sans CN Regular'" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Regular" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Sans CN Regular" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+
+    <!-- "encarts" from bugdoc -->
+    <style:style style:name="encarts" style:family="graphic">
+      <style:graphic-properties svg:width="3.9701in" svg:height="0.1402in" text:anchor-type="paragraph" fo:background-color="#ffcc99" style:background-transparency="0%" draw:fill="solid" fo:padding="0.0193in" fo:border="0.79pt solid #661900" style:shadow="none" draw:shadow-opacity="100%">
+        <style:background-image/>
+        <style:columns fo:column-count="1" fo:column-gap="0in"/>
+      </style:graphic-properties>
+    </style:style>
+
+ </office:styles>
+ <office:automatic-styles>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+    <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style/>
+   <style:footer-style/>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:p text:style-name="Standard"/>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 6cfd040..69f97ee 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -232,6 +232,19 @@ DECLARE_ODFEXPORT_TEST(testFdo38244, "fdo38244.odt")
     CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt")
+{
+    // frame style fo:background-color was not imported
+    uno::Reference<container::XNameAccess> xStyles(getStyles("FrameStyles"));
+    uno::Reference<beans::XPropertySet> xStyle(xStyles->getByName("encarts"),
+            uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "BackColorRGB"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xStyle, "BackColorTransparency"));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle, "FillStyle"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xStyle, "FillTransparence"));
+}
+
 DECLARE_ODFEXPORT_TEST(testFdo79358, "fdo79358.odt")
 {
     // the boolean properties of the index were not exported properly
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 5a25218..fd3b27b 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1761,7 +1761,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
         {
             //UUUU
             SfxItemSet& rStyleSet = rBase.GetItemSet();
-            const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet, RES_BACKGROUND));
+            const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet, RES_BACKGROUND, true, pDoc->IsInXMLImport()));
             SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
 
             aChangedBrushItem.PutValue(aValue, nMemberId);
@@ -4296,7 +4296,7 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
                 case RES_BACKGROUND:
                 {
                     //UUUU
-                    const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND));
+                    const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(aSet, RES_BACKGROUND, true, pDocShell->GetDoc()->IsInXMLImport()));
                     SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
 
                     aChangedBrushItem.PutValue(aValue, nMemberId);
commit 99c3ac7a2c7edab9e239a8a033962162fa5cc822
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Aug 24 22:56:17 2015 +0200

    sw: Flat ODF import: set the InReading and InXMLImport flags
    
    Flat ODF Import does not use SwReader but uses
    SwXMLImport::startDocument() and SwXMLImport::endDocument() to set up
    the document, so make sure those set the import relevant SwDoc flags.
    
    Change-Id: Ife3e58eeebd73ad895fe328662822b847cf9bfec
    (cherry picked from commit 27a02d1708be7812668a84ea956edc8ecb312246)
    Reviewed-on: https://gerrit.libreoffice.org/18036
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index be9ad11..38120ed 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -652,6 +652,13 @@ void SwXMLImport::startDocument()
     if( !pDoc )
         return;
 
+    if (SvXMLImportFlags::ALL == getImportFlags())
+    {
+        // for flat ODF - this is done in SwReader::Read() for package ODF
+        pDoc->SetInReading(true);
+        pDoc->SetInXMLImport(true);
+    }
+
     if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() )
     {
         pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() );
@@ -876,6 +883,11 @@ void SwXMLImport::endDocument()
                 pDoc->PrtOLENotify( false );
             else if ( pDoc->IsOLEPrtNotifyPending() )
                 pDoc->PrtOLENotify( true );
+
+            assert(pDoc->IsInReading());
+            assert(pDoc->IsInXMLImport());
+            pDoc->SetInReading(false);
+            pDoc->SetInXMLImport(false);
         }
 
         SwDrawModel* pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
commit ba24290d41808660b0c9fa9fcdd83bb28fb2b1d6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Aug 28 18:37:37 2015 +0200

    vcl: fix resource management issue in WinSalLayout
    
    Since commit 65a66d41fd0e13d0aad9df935091b731b4af650a the
    sd_exports_test crashes on Windows in UniscribeLayout because
    it uses a ImplFontEntry that has been removed from the font cache.
    
    Tweak the refcount in WinLayout so it will be valid.
    
    Change-Id: Ic4bf984ea9fd70de9fa95ca964ae12d95d47d5bf
    (cherry picked from commit 34700400247e378e074ce4164ab2809edb092201)
    Reviewed-on: https://gerrit.libreoffice.org/18121
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 6e03bf80..78e1a8f 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -36,6 +36,7 @@ class PhysicalFontFamily;
 class ImplGetDevFontList;
 class ImplGetDevSizeList;
 class ImplFontEntry;
+class ImplFontCache;
 class ImplPreMatchFontSubstitution;
 class ImplGlyphFallbackFontSubstitution;
 class FontSelectPattern;
@@ -227,6 +228,7 @@ public:
     virtual             ~ImplFontEntry();
 
 public: // TODO: make data members private
+    ImplFontCache * m_pFontCache;
     FontSelectPattern  maFontSelData;      // FontSelectionData
     ImplFontMetricData  maMetric;           // Font Metric
     const ConvertChar*  mpConversion;       // used e.g. for StarBats->StarSymbol
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 216c8a6..355e8af 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -970,7 +970,8 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
 }
 
 ImplFontEntry::ImplFontEntry( const FontSelectPattern& rFontSelData )
-    : maFontSelData( rFontSelData )
+    : m_pFontCache(nullptr)
+    , maFontSelData( rFontSelData )
     , maMetric( rFontSelData )
     , mpConversion( NULL )
     , mnLineHeight( 0 )
@@ -987,6 +988,7 @@ ImplFontEntry::ImplFontEntry( const FontSelectPattern& rFontSelData )
 ImplFontEntry::~ImplFontEntry()
 {
     delete mpUnicodeFallbackList;
+    m_pFontCache = nullptr;
 }
 
 size_t ImplFontEntry::GFBCacheKey_Hash::operator()( const GFBCacheKey& rData ) const
@@ -1322,6 +1324,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
     {
         // create a new logical font instance from this physical font face
         pEntry = pFontData->CreateFontInstance( aFontSelData );
+        pEntry->m_pFontCache = this;
 
         // if we're subtituting from or to a symbol font we may need a symbol
         // conversion table
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 22b6881..f0311a4 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -29,6 +29,7 @@
 #include <vcl/opengl/OpenGLHelper.hxx>
 #include <win/salgdi.h>
 #include <win/saldata.hxx>
+#include <outdev.h>
 
 #include "sft.hxx"
 #include "sallayout.hxx"
@@ -453,7 +454,14 @@ WinLayout::WinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWF
     mrWinFontData( rWFD ),
     mrWinFontEntry(rWFE),
     mbUseOpenGL(bUseOpenGL)
-{}
+{
+    ++mrWinFontEntry.mnRefCount; // keep it alive
+}
+
+WinLayout::~WinLayout()
+{
+    mrWinFontEntry.m_pFontCache->Release(&mrWinFontEntry);
+}
 
 void WinLayout::InitFont() const
 {
diff --git a/vcl/win/source/gdi/winlayout.hxx b/vcl/win/source/gdi/winlayout.hxx
index 8855e37..d558d4cc 100644
--- a/vcl/win/source/gdi/winlayout.hxx
+++ b/vcl/win/source/gdi/winlayout.hxx
@@ -41,6 +41,7 @@ class WinLayout : public SalLayout
 {
 public:
                         WinLayout(HDC, const ImplWinFontData&, ImplWinFontEntry&, bool bUseOpenGL);
+    virtual             ~WinLayout();
     virtual void        InitFont() const SAL_OVERRIDE;
     void                SetFontScale( float f ) { mfFontScale = f; }
     HFONT               DisableFontScaling() const;
commit cd491e8c72f64c89dd5e57d761e33b90267f1d40
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Aug 28 13:12:25 2015 +0200

    vcl: fix drmemory warning in UniscribeLayout::DropGlyph()
    
    It says there's access to uninitialized variable on that line,
    so propbably the loop is running over.
    
    Change-Id: I0226f82b20a6fbbc79af5bbb46af09830c3bc25a
    (cherry picked from commit eba9a6c4b32220dcc729c71e440234f90af5bdcc)
    Reviewed-on: https://gerrit.libreoffice.org/18107
    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>

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 51c77c0..22b6881 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -1495,7 +1495,7 @@ void UniscribeLayout::DropGlyph( int nStartx8 )
         DBG_ASSERT( nStart <= mnGlyphCount, "USPLayout::DropG overflow" );
 
         int j = pVI->mnMinGlyphPos;
-        while (mpOutGlyphs[j] == DROPPED_OUTGLYPH) j++;
+        while (j < mnGlyphCount && mpOutGlyphs[j] == DROPPED_OUTGLYPH) j++;
         if (j == nStart)
         {
             pVI->mnXOffset += ((mpJustifications)? mpJustifications[nStart] : mpGlyphAdvances[nStart]);
commit 52e13e72edee91889b09ad28a76a88b92151e73c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 28 16:14:07 2015 +0100

    check stream status
    
    Change-Id: I609c8c4f4e843601361b61f55e0325ad99db3c23
    (cherry picked from commit dc1be62d75e654e17c2f4c02804b7fd48d5a2515)
    Reviewed-on: https://gerrit.libreoffice.org/18115
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sd/qa/unit/data/ppt/pass/hang-20.ppt b/sd/qa/unit/data/ppt/pass/hang-20.ppt
new file mode 100644
index 0000000..7bfe75d
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-20.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 3cb8d80..dc4cadd 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -279,7 +279,6 @@ bool ImplSdPPTImport::Import()
                     if ( nSlideCount && pSection->GetProperty( PID_HEADINGPAIR, aPropItem ) )
                     {
                         sal_uInt32  nSlideTitleIndex = 0, nSlideTitleCount = 0;
-                        sal_uInt32  i, nTemp;
 
                         OUString aUString;
 
@@ -290,13 +289,14 @@ bool ImplSdPPTImport::Import()
                         {
                             nVecCount >>= 1;
                             sal_uInt32 nEntryCount = 0;
-                            for ( i = 0; i < nVecCount; i++ )
+                            for (sal_uInt32 i = 0; i < nVecCount; ++i)
                             {
                                 if ( !aPropItem.Read( aUString, VT_EMPTY, false ) )
                                     break;
                                 aPropItem.ReadUInt32( nType );
                                 if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) )
                                     break;
+                                sal_uInt32 nTemp(0);
                                 aPropItem.ReadUInt32( nTemp );
                                 if ( aUString == "Slide Titles" || aUString == "Folientitel" )
                                 {
@@ -311,17 +311,33 @@ bool ImplSdPPTImport::Import()
                             aPropItem.ReadUInt32( nType )
                                      .ReadUInt32( nVecCount );
 
-                            if ( ( nVecCount >= ( nSlideTitleIndex + nSlideTitleCount ) )
-                                    && ( nType == ( VT_LPSTR | VT_VECTOR ) ) )
+                            bool bVecOk = ( ( nVecCount >= (nSlideTitleIndex + nSlideTitleCount) )
+                                    && ( nType == ( VT_LPSTR | VT_VECTOR ) ) );
+
+                            if (bVecOk)
                             {
-                                for ( i = 0; i != nSlideTitleIndex; i++ )
+                                for (sal_uInt32 i = 0; i != nSlideTitleIndex; ++i)
                                 {
-                                    aPropItem.ReadUInt32( nTemp );
-                                    aPropItem.SeekRel( nTemp );
+                                    sal_uInt32 nTemp(0);
+                                    aPropItem.ReadUInt32(nTemp);
+                                    if (!aPropItem.good())
+                                    {
+                                        bVecOk = false;
+                                        break;
+                                    }
+                                    auto nPos = aPropItem.Tell() + nTemp;
+                                    if (nPos != aPropItem.Seek(nPos))
+                                    {
+                                        bVecOk = false;
+                                        break;
+                                    }
                                 }
-                                for ( i = 0; i < nSlideTitleCount; i++ )
+                            }
+                            if (bVecOk)
+                            {
+                                for (sal_uInt32 i = 0; i < nSlideTitleCount; ++i)
                                 {
-                                    if ( !aPropItem.Read( aUString, nType, false ) )
+                                    if (!aPropItem.Read(aUString, nType, false))
                                         break;
 
                                     OUString aString( aUString );
commit 35d3c3ec41a1e5952aa1ddb59f001ad8a260fc27
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 28 15:33:44 2015 +0100

    eof isn't a Error, so use good not GetError
    
    Change-Id: Ie1df87c7eb9d391d0fa4a579f744051a1f1b2ae1
    (cherry picked from commit 078235028a8c4ea36b6b366348016e19759c456a)
    Reviewed-on: https://gerrit.libreoffice.org/18114
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 5e9a34c..b68b9af 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4159,17 +4159,17 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
         SEEK_FROM_BEGINNING ) )
     {
         sal_uInt32  nBytesLeft = maShapeRecords.Current()->nRecLen;
-        sal_uInt32  nUDData;
-        sal_uInt16  nPID;
         while( 5 < nBytesLeft )
         {
-            rSt.ReadUInt16( nPID );
-            if ( rSt.GetError() != 0 )
+            sal_uInt16 nPID(0);
+            rSt.ReadUInt16(nPID);
+            if (!rSt.good())
                 break;
-            rSt.ReadUInt32( nUDData );
-            if ( rSt.GetError() != 0 )
+            sal_uInt32 nUDData(0);
+            rSt.ReadUInt32(nUDData);
+            if (!rSt.good())
                 break;
-            if ( nPID == 447 )
+            if (nPID == 447)
             {
                 mbRotateGranientFillWithAngle = nUDData & 0x20;
                 break;
@@ -4993,15 +4993,15 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
             && maShapeRecords.Current()->nRecLen )
         {
             sal_uInt32  nBytesLeft = maShapeRecords.Current()->nRecLen;
-            sal_uInt32  nUDData;
-            sal_uInt16  nPID;
             while( 5 < nBytesLeft )
             {
-                rSt.ReadUInt16( nPID );
-                if ( rSt.GetError() != 0 )
+                sal_uInt16 nPID(0);
+                rSt.ReadUInt16(nPID);
+                if (!rSt.good())
                     break;
-                rSt.ReadUInt32( nUDData );
-                switch( nPID )
+                sal_uInt32 nUDData(0);
+                rSt.ReadUInt32(nUDData);
+                switch (nPID)
                 {
                     case 0x038F: pImpRec->nXAlign = nUDData; break;
                     case 0x0390:
@@ -5031,7 +5031,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
                         pImpRec->isHorizontalRule = true;
                         break;
                 }
-                if ( rSt.GetError() != 0 )
+                if (!rSt.good())
                     break;
                 nBytesLeft  -= 6;
             }
diff --git a/sd/qa/unit/data/ppt/pass/hang-19.ppt b/sd/qa/unit/data/ppt/pass/hang-19.ppt
new file mode 100644
index 0000000..942a58a
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-19.ppt differ
commit 53e6788f1ca9bf61715b40f1313d949a3d3151a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 28 14:33:05 2015 +0100

    guard against 0 item size
    
    Change-Id: I9c4c2f0fe2d892615b3c70e08da0cab6da13338a
    (cherry picked from commit 2aadad1e89e96cb80c15fe1069cb6365f0cade1d)
    Reviewed-on: https://gerrit.libreoffice.org/18113
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sd/qa/unit/data/ppt/pass/crash-2.ppt b/sd/qa/unit/data/ppt/pass/crash-2.ppt
new file mode 100644
index 0000000..78a4da4
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/crash-2.ppt differ
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 4f2e37b..be288c8 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -93,7 +93,7 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
     {
         case VT_LPSTR :
         {
-            if ( nItemSize )
+            if (nItemSize)
             {
                 auto nMaxSizePossible = remainingSize();
                 if (nItemSize > nMaxSizePossible)
@@ -101,6 +101,10 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
                     SAL_WARN("sd.filter", "String of Len " << nItemSize << " claimed, only " << nMaxSizePossible << " possible");
                     nItemSize = nMaxSizePossible;
                 }
+            }
+
+            if (nItemSize)
+            {
                 try
                 {
                     sal_Char* pString = new sal_Char[ nItemSize ];
@@ -144,7 +148,7 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
 
         case VT_LPWSTR :
         {
-            if ( nItemSize )
+            if (nItemSize)
             {
                 auto nMaxSizePossible = remainingSize() / sizeof(sal_Unicode);
                 if (nItemSize > nMaxSizePossible)
@@ -152,7 +156,10 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
                     SAL_WARN("sd.filter", "String of Len " << nItemSize << " claimed, only " << nMaxSizePossible << " possible");
                     nItemSize = nMaxSizePossible;
                 }
+            }
 
+            if (nItemSize)
+            {
                 try
                 {
                     sal_Unicode* pString = new sal_Unicode[ nItemSize ];
commit c31be2d0d4deed0e1a060954bb0ff9627fd1716d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 28 08:28:51 2015 +0100

    check seeks and reads
    
    Change-Id: I0c5c4784713376e0762bfbd197640f8d31b65562
    (cherry picked from commit 1847753ab135f522df6a293a8539155437f0129f)
    Reviewed-on: https://gerrit.libreoffice.org/18112
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 0ac8030..42f8b1b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -785,7 +785,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                     }
                     break;
                 }
-                aClientDataHd.SeekToEndOfRecord( rSt );
+                if (!aClientDataHd.SeekToEndOfRecord(rSt))
+                    break;
             }
         }
         if ( ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::NOTESSLIDEIMAGE ) && !rPersistEntry.bNotesMaster )
@@ -1809,7 +1810,10 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
                 break;
             }
             else
-                aPlaceHd.SeekToEndOfRecord( rStCtrl );
+            {
+                if (!aPlaceHd.SeekToEndOfRecord(rStCtrl))
+                    break;
+            }
         }
     }
 
@@ -2401,7 +2405,8 @@ bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream&
                     }
                 }
             }
-            aProgTagBinaryDataHd.SeekToEndOfRecord( rSt );
+            if (!aProgTagBinaryDataHd.SeekToEndOfRecord(rSt))
+                break;
         }
     }
     if ( !bRetValue )
@@ -2702,7 +2707,8 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
             }
             break;
         }
-        aCommentHd.SeekToEndOfRecord( rStCtrl );
+        if (!aCommentHd.SeekToEndOfRecord(rStCtrl))
+            break;
     }
     Point aPosition( nPosX, nPosY );
     rMan.Scale( aPosition );
@@ -2762,7 +2768,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                         while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
                         {
                             ImportComment10( *this, rStCtrl, pRet, aComment10Hd );
-                            aComment10Hd.SeekToEndOfRecord( rStCtrl );
+                            if (!aComment10Hd.SeekToEndOfRecord(rStCtrl))
+                                break;
                         }
                     }
                 }
@@ -2840,7 +2847,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                             }
                             if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
                                 break;
-                            aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
+                            if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
+                                break;
                         }
 
                         // now importing page
@@ -2890,7 +2898,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                             }
                             if ( aEscherObjListHd.nRecType == DFF_msofbtSpgrContainer )
                                 break;
-                            aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
+                            if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
+                                break;
                         }
 
                         if ( rSlidePersist.pBObj )
@@ -2906,7 +2915,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
                 }
                 break;
             }
-            aHd.SeekToEndOfRecord( rStCtrl );
+            if (!aHd.SeekToEndOfRecord(rStCtrl))
+                break;
         }
         if ( rSlidePersist.pSolverContainer )
             SolveSolver( *rSlidePersist.pSolverContainer );
@@ -3126,7 +3136,8 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
             }
             break;
         }
-        aHd.SeekToEndOfRecord( rStCtrl );
+        if (!aHd.SeekToEndOfRecord(rStCtrl))
+            break;
     }
 }
 
@@ -3256,7 +3267,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
 #ifdef DBG_UTIL
                         else OSL_FAIL( "PPTExParaProv::PPTExParaProv - unknown atom interpreting the PPT_PST_ExtendedBuGraContainer (SJ)" );
 #endif
-                        aBuGraAtomHd.SeekToEndOfRecord( rSt );
+                        if (!aBuGraAtomHd.SeekToEndOfRecord(rSt))
+                            break;
                     }
                     if ( !aBuGraList.empty() )
                         bGraphics = true;
@@ -3280,7 +3292,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
                 break;
 #endif
             }
-            aHd.SeekToEndOfRecord( rSt );
+            if (!aHd.SeekToEndOfRecord(rSt))
+                break;
         }
     }
 
@@ -3329,7 +3342,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list