[Libreoffice-commits] core.git: Branch 'private/tbsdy/outdev' - 40 commits - bin/ios-mapfile-statistics chart2/Library_chartcontroller.mk chart2/source configure.ac connectivity/source cppuhelper/source cui/source external/hunspell formula/source i18npool/CustomTarget_breakiterator.mk include/formula include/osl include/vcl include/xmloff lingucomponent/source officecfg/registry registry/test sc/inc sc/Module_sc.mk sc/qa sc/source solenv/bin sw/sdi sw/source sw/uiconfig vcl/CustomTarget_kde4_moc.mk vcl/Library_vcl.mk vcl/source vcl/unx xmloff/source

Chris Sherlock chris.sherlock79 at gmail.com
Fri Apr 25 05:38:00 PDT 2014


 bin/ios-mapfile-statistics                                        |   61 +
 chart2/Library_chartcontroller.mk                                 |    1 
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |    7 
 chart2/source/controller/chartcontroller.component                |   20 
 chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx            |    7 
 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx       |    7 
 chart2/source/controller/main/ChartController.cxx                 |    8 
 chart2/source/controller/main/ChartFrameloader.cxx                |    7 
 chart2/source/controller/main/ShapeToolbarController.cxx          |    7 
 chart2/source/controller/main/_serviceregistration_controller.cxx |   94 --
 configure.ac                                                      |   66 +
 connectivity/source/drivers/mork/MConnection.cxx                  |    1 
 cppuhelper/source/shlib.cxx                                       |    8 
 cui/source/tabpages/border.cxx                                    |    2 
 external/hunspell/UnpackedTarball_hunspell.mk                     |    1 
 external/hunspell/hunspell-fdo48017-wfopen.patch                  |  109 ++
 formula/source/core/resource/core_resource.src                    |    7 
 i18npool/CustomTarget_breakiterator.mk                            |   21 
 include/formula/compiler.hrc                                      |    3 
 include/formula/opcode.hxx                                        |    1 
 include/osl/diagnose.h                                            |    2 
 include/vcl/outdev.hxx                                            |   26 
 include/vcl/outdevstate.hxx                                       |   78 +
 include/xmloff/XMLShapeStyleContext.hxx                           |    2 
 lingucomponent/source/spellcheck/spell/sspellimp.cxx              |   13 
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu      |    3 
 registry/test/regdiagnose.h                                       |    2 
 sc/Module_sc.mk                                                   |    7 
 sc/inc/column.hxx                                                 |    3 
 sc/inc/global.hxx                                                 |   16 
 sc/inc/helpids.h                                                  |    1 
 sc/inc/table.hxx                                                  |    3 
 sc/qa/unit/ucalc.cxx                                              |    1 
 sc/qa/unit/ucalc_formula.cxx                                      |   49 +
 sc/qa/unit/ucalc_sharedformula.cxx                                |    6 
 sc/source/core/data/column.cxx                                    |   24 
 sc/source/core/data/column4.cxx                                   |   11 
 sc/source/core/data/document10.cxx                                |    3 
 sc/source/core/data/table7.cxx                                    |    5 
 sc/source/core/inc/interpre.hxx                                   |    1 
 sc/source/core/tool/formulagroup.cxx                              |    2 
 sc/source/core/tool/interpr1.cxx                                  |   90 +
 sc/source/core/tool/interpr4.cxx                                  |    1 
 sc/source/core/tool/parclass.cxx                                  |    1 
 sc/source/filter/excel/xlformula.cxx                              |    1 
 sc/source/filter/inc/htmlexp.hxx                                  |    4 
 sc/source/filter/inc/orcusinterface.hxx                           |   12 
 sc/source/filter/oox/formulabase.cxx                              |    1 
 sc/source/ui/src/scfuncs.src                                      |   48 +
 solenv/bin/native-code.py                                         |    3 
 sw/sdi/_frmsh.sdi                                                 |   12 
 sw/source/core/attr/format.cxx                                    |   19 
 sw/source/core/layout/paintfrm.cxx                                |    5 
 sw/source/core/uibase/shells/frmsh.cxx                            |    6 
 sw/source/core/uibase/shells/grfsh.cxx                            |   57 -
 sw/source/core/uibase/utlui/uitool.cxx                            |    6 
 sw/source/core/unocore/unobrushitemhelper.cxx                     |   26 
 sw/source/core/unocore/unoframe.cxx                               |   60 +
 sw/source/core/unocore/unomap.cxx                                 |   36 
 sw/source/core/unocore/unostyle.cxx                               |   48 -
 sw/uiconfig/swriter/ui/objectdialog.ui                            |   20 
 sw/uiconfig/swriter/ui/picturedialog.ui                           |   20 
 vcl/CustomTarget_kde4_moc.mk                                      |    3 
 vcl/Library_vcl.mk                                                |    1 
 vcl/source/app/settings.cxx                                       |   14 
 vcl/source/outdev/outdev.cxx                                      |  458 ++++------
 vcl/source/outdev/outdevstate.cxx                                 |   82 +
 vcl/unx/kde4/KDE4FilePicker.cxx                                   |   22 
 vcl/unx/kde4/KDESalInstance.cxx                                   |    2 
 vcl/unx/kde4/KDEXLib.cxx                                          |   23 
 vcl/unx/kde4/KDEXLib.hxx                                          |    4 
 vcl/unx/kde4/tst_exclude_posted_events.hxx                        |   70 +
 vcl/unx/kde4/tst_exclude_socket_notifiers.hxx                     |    5 
 xmloff/source/draw/XMLShapeStyleContext.cxx                       |   81 +
 74 files changed, 1398 insertions(+), 539 deletions(-)

New commits:
commit 233f5800717aeb34ca4d4a40d6ade3355d40b356
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Apr 25 20:56:35 2014 +1000

    VCL: ImpObjStack replaced with std::stack
    
    ImpObjStack uses it's own home-grown stack and stack functions. There
    is a function that unwinds the stack, but really it would be better if
    we used std::set. In fact, this is better, because the name ImpObjStack
    is really not terribly descriptive. I've replaced it with a stack of
    OutDevState objects.
    
    Change-Id: I87bdd4340ad77b7ffd9ff176fa5a9ffeac8b8666

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index da3b4b3..c0a2306 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -34,6 +34,8 @@
 #include <vcl/metaact.hxx>
 #include <vcl/salnativewidgets.hxx>
 
+#include <vcl/outdevstate.hxx>
+
 #include <basegfx/vector/b2enums.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 
@@ -45,6 +47,7 @@
 #include <com/sun/star/uno/Reference.h>
 
 #include <vector>
+#include <stack>
 
 #if defined UNX
 #define GLYPH_FONT_HEIGHT   128
@@ -57,7 +60,7 @@
 
 struct ImplOutDevData;
 class ImplFontEntry;
-struct ImplObjStack;
+class OutDevState;
 struct SystemGraphicsData;
 struct SystemFontData;
 struct SystemTextLayoutData;
@@ -141,25 +144,6 @@ struct ImplThresholdRes
 
 // OutputDevice-Types
 
-// Flags for Push()
-#define PUSH_LINECOLOR                  ((sal_uInt16)0x0001)
-#define PUSH_FILLCOLOR                  ((sal_uInt16)0x0002)
-#define PUSH_FONT                       ((sal_uInt16)0x0004)
-#define PUSH_TEXTCOLOR                  ((sal_uInt16)0x0008)
-#define PUSH_MAPMODE                    ((sal_uInt16)0x0010)
-#define PUSH_CLIPREGION                 ((sal_uInt16)0x0020)
-#define PUSH_RASTEROP                   ((sal_uInt16)0x0040)
-#define PUSH_TEXTFILLCOLOR              ((sal_uInt16)0x0080)
-#define PUSH_TEXTALIGN                  ((sal_uInt16)0x0100)
-#define PUSH_REFPOINT                   ((sal_uInt16)0x0200)
-#define PUSH_TEXTLINECOLOR              ((sal_uInt16)0x0400)
-#define PUSH_TEXTLAYOUTMODE             ((sal_uInt16)0x0800)
-#define PUSH_TEXTLANGUAGE               ((sal_uInt16)0x1000)
-#define PUSH_OVERLINECOLOR              ((sal_uInt16)0x2000)
-#define PUSH_ALLTEXT                    (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
-#define PUSH_ALLFONT                    (PUSH_ALLTEXT | PUSH_FONT)
-#define PUSH_ALL                        ((sal_uInt16)0xFFFF)
-
 // Flags for DrawText()
 #define TEXT_DRAW_DISABLE               ((sal_uInt16)0x0001)
 #define TEXT_DRAW_MNEMONIC              ((sal_uInt16)0x0002)
@@ -300,7 +284,7 @@ private:
     mutable PhysicalFontCollection* mpFontCollection;
     mutable ImplGetDevFontList*     mpGetDevFontList;
     mutable ImplGetDevSizeList*     mpGetDevSizeList;
-    ImplObjStack*                   mpObjStack;
+    std::stack < OutDevState* >*     mpOutDevStateStack;
     ImplOutDevData*                 mpOutDevData;
     VCLXGraphicsList_impl*          mpUnoGraphicsList;
     vcl::PDFWriterImpl*             mpPDFWriter;
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx
new file mode 100644
index 0000000..1a08845
--- /dev/null
+++ b/include/vcl/outdevstate.hxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_INC_OUTDEVSTATE_HXX
+#define INCLUDED_VCL_INC_OUTDEVSTATE_HXX
+
+#include <sal/types.h>
+
+#include <vcl/mapmod.hxx>
+#include <vcl/region.hxx>
+#include <vcl/font.hxx>
+#include <vcl/vclenum.hxx>
+
+#include <tools/gen.hxx>
+#include <tools/color.hxx>
+#include <tools/fontenum.hxx>
+
+// Flags for OutputDevice::Push() and OutDevState
+#define PUSH_LINECOLOR                  ((sal_uInt16)0x0001)
+#define PUSH_FILLCOLOR                  ((sal_uInt16)0x0002)
+#define PUSH_FONT                       ((sal_uInt16)0x0004)
+#define PUSH_TEXTCOLOR                  ((sal_uInt16)0x0008)
+#define PUSH_MAPMODE                    ((sal_uInt16)0x0010)
+#define PUSH_CLIPREGION                 ((sal_uInt16)0x0020)
+#define PUSH_RASTEROP                   ((sal_uInt16)0x0040)
+#define PUSH_TEXTFILLCOLOR              ((sal_uInt16)0x0080)
+#define PUSH_TEXTALIGN                  ((sal_uInt16)0x0100)
+#define PUSH_REFPOINT                   ((sal_uInt16)0x0200)
+#define PUSH_TEXTLINECOLOR              ((sal_uInt16)0x0400)
+#define PUSH_TEXTLAYOUTMODE             ((sal_uInt16)0x0800)
+#define PUSH_TEXTLANGUAGE               ((sal_uInt16)0x1000)
+#define PUSH_OVERLINECOLOR              ((sal_uInt16)0x2000)
+#define PUSH_ALLTEXT                    (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
+#define PUSH_ALLFONT                    (PUSH_ALLTEXT | PUSH_FONT)
+#define PUSH_ALL                        ((sal_uInt16)0xFFFF)
+
+class OutDevState
+{
+public:
+    ~OutDevState();
+
+    MapMode*        mpMapMode;
+    bool            mbMapActive;
+    Region*         mpClipRegion;
+    Color*          mpLineColor;
+    Color*          mpFillColor;
+    Font*           mpFont;
+    Color*          mpTextColor;
+    Color*          mpTextFillColor;
+    Color*          mpTextLineColor;
+    Color*          mpOverlineColor;
+    Point*          mpRefPoint;
+    TextAlign       meTextAlign;
+    RasterOp        meRasterOp;
+    sal_uLong       mnTextLayoutMode;
+    LanguageType    meTextLanguage;
+    sal_uInt16      mnFlags;
+};
+
+#endif // INCLUDED_VCL_INC_OUTDEVSTATE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 4d40694..1d22db8 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -235,6 +235,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/gdi/octree \
     vcl/source/gdi/oldprintadaptor \
     vcl/source/outdev/outdev \
+    vcl/source/outdev/outdevstate \
     vcl/source/outdev/clipping \
     vcl/source/outdev/polygon \
     vcl/source/outdev/transparent \
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index ad9bfa1..ff37b98 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -33,13 +33,13 @@
 #include <vcl/IconThemeScanner.hxx>
 #include <vcl/IconThemeSelector.hxx>
 #include <vcl/IconThemeInfo.hxx>
-#include "vcl/svapp.hxx"
-#include "vcl/event.hxx"
-#include "vcl/settings.hxx"
-#include "vcl/i18nhelp.hxx"
-#include "vcl/configsettings.hxx"
-#include "vcl/gradient.hxx"
-#include "vcl/outdev.hxx"
+#include <vcl/svapp.hxx>
+#include <vcl/event.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/i18nhelp.hxx>
+#include <vcl/configsettings.hxx>
+#include <vcl/gradient.hxx>
+#include <vcl/outdev.hxx>
 
 #include "unotools/fontcfg.hxx"
 #include "unotools/localedatawrapper.hxx"
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index b141ea5..270f4b3 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -31,9 +31,11 @@
 #include <vcl/outdev.hxx>
 #include <vcl/unowrap.hxx>
 #include <vcl/settings.hxx>
-#include <svsys.h>
 #include <vcl/sysdata.hxx>
 
+#include <vcl/outdevstate.hxx>
+
+#include <svsys.h>
 #include <salgdi.hxx>
 #include <sallayout.hxx>
 #include <salframe.hxx>
@@ -43,6 +45,7 @@
 #include <window.h>
 #include <outdev.h>
 #include <outdata.hxx>
+
 #include "PhysicalFontCollection.hxx"
 
 #include <basegfx/point/b2dpoint.hxx>
@@ -62,6 +65,7 @@
 #include <comphelper/processfactory.hxx>
 
 #include <numeric>
+#include <stack>
 
 #ifdef DISABLE_DYNLOADING
 // Linking all needed LO code into one .so/executable, these already
@@ -73,76 +77,6 @@ namespace {
 }
 #endif
 
-struct ImplObjStack
-{
-    ImplObjStack*   mpPrev;
-    MapMode*        mpMapMode;
-    bool            mbMapActive;
-    Region*         mpClipRegion;
-    Color*          mpLineColor;
-    Color*          mpFillColor;
-    Font*           mpFont;
-    Color*          mpTextColor;
-    Color*          mpTextFillColor;
-    Color*          mpTextLineColor;
-    Color*          mpOverlineColor;
-    Point*          mpRefPoint;
-    TextAlign       meTextAlign;
-    RasterOp        meRasterOp;
-    sal_uLong           mnTextLayoutMode;
-    LanguageType    meTextLanguage;
-    sal_uInt16          mnFlags;
-};
-
-static void ImplDeleteObjStack( ImplObjStack* pObjStack )
-{
-    if ( pObjStack->mnFlags & PUSH_LINECOLOR )
-    {
-        if ( pObjStack->mpLineColor )
-            delete pObjStack->mpLineColor;
-    }
-    if ( pObjStack->mnFlags & PUSH_FILLCOLOR )
-    {
-        if ( pObjStack->mpFillColor )
-            delete pObjStack->mpFillColor;
-    }
-    if ( pObjStack->mnFlags & PUSH_FONT )
-        delete pObjStack->mpFont;
-    if ( pObjStack->mnFlags & PUSH_TEXTCOLOR )
-        delete pObjStack->mpTextColor;
-    if ( pObjStack->mnFlags & PUSH_TEXTFILLCOLOR )
-    {
-        if ( pObjStack->mpTextFillColor )
-            delete pObjStack->mpTextFillColor;
-    }
-    if ( pObjStack->mnFlags & PUSH_TEXTLINECOLOR )
-    {
-        if ( pObjStack->mpTextLineColor )
-            delete pObjStack->mpTextLineColor;
-    }
-    if ( pObjStack->mnFlags & PUSH_OVERLINECOLOR )
-    {
-        if ( pObjStack->mpOverlineColor )
-            delete pObjStack->mpOverlineColor;
-    }
-    if ( pObjStack->mnFlags & PUSH_MAPMODE )
-    {
-        if ( pObjStack->mpMapMode )
-            delete pObjStack->mpMapMode;
-    }
-    if ( pObjStack->mnFlags & PUSH_CLIPREGION )
-    {
-        if ( pObjStack->mpClipRegion )
-            delete pObjStack->mpClipRegion;
-    }
-    if ( pObjStack->mnFlags & PUSH_REFPOINT )
-    {
-        if ( pObjStack->mpRefPoint )
-            delete pObjStack->mpRefPoint;
-    }
-
-    delete pObjStack;
-}
 
 bool OutputDevice::ImplIsAntiparallel() const
 {
@@ -175,7 +109,7 @@ OutputDevice::OutputDevice() :
     mpFontCollection                = NULL;
     mpGetDevFontList                = NULL;
     mpGetDevSizeList                = NULL;
-    mpObjStack                      = NULL;
+    mpOutDevStateStack              = new std::stack< OutDevState* >();
     mpOutDevData                    = NULL;
     mpPDFWriter                     = NULL;
     mpAlphaVDev                     = NULL;
@@ -277,25 +211,25 @@ OutputDevice::~OutputDevice()
         delete mpOutDevData;
     }
 
-    ImplObjStack* pData = mpObjStack;
-    if ( pData )
+    // for some reason, we haven't removed state from the stack properly
+    if ( !mpOutDevStateStack->empty() )
     {
         SAL_WARN( "vcl.gdi", "OutputDevice::~OutputDevice(): OutputDevice::Push() calls != OutputDevice::Pop() calls" );
-        while ( pData )
+        while ( !mpOutDevStateStack->empty() )
         {
-            ImplObjStack* pTemp = pData;
-            pData = pData->mpPrev;
-            ImplDeleteObjStack( pTemp );
+            mpOutDevStateStack->pop();
         }
     }
 
     // release the active font instance
     if( mpFontEntry )
         mpFontCache->Release( mpFontEntry );
+
     // remove cached results of GetDevFontList/GetDevSizeList
     // TODO: use smart pointers for them
     if( mpGetDevFontList )
         delete mpGetDevFontList;
+
     if( mpGetDevSizeList )
         delete mpGetDevSizeList;
 
@@ -323,6 +257,191 @@ OutputDevice::~OutputDevice()
     delete mpAlphaVDev;
 }
 
+void OutputDevice::Push( sal_uInt16 nFlags )
+{
+
+    if ( mpMetaFile )
+        mpMetaFile->AddAction( new MetaPushAction( nFlags ) );
+
+    OutDevState* pState = new OutDevState;
+
+    pState->mnFlags = nFlags;
+
+    if ( nFlags & PUSH_LINECOLOR )
+    {
+        if ( mbLineColor )
+            pState->mpLineColor = new Color( maLineColor );
+        else
+            pState->mpLineColor = NULL;
+    }
+    if ( nFlags & PUSH_FILLCOLOR )
+    {
+        if ( mbFillColor )
+            pState->mpFillColor = new Color( maFillColor );
+        else
+            pState->mpFillColor = NULL;
+    }
+    if ( nFlags & PUSH_FONT )
+        pState->mpFont = new Font( maFont );
+    if ( nFlags & PUSH_TEXTCOLOR )
+        pState->mpTextColor = new Color( GetTextColor() );
+    if ( nFlags & PUSH_TEXTFILLCOLOR )
+    {
+        if ( IsTextFillColor() )
+            pState->mpTextFillColor = new Color( GetTextFillColor() );
+        else
+            pState->mpTextFillColor = NULL;
+    }
+    if ( nFlags & PUSH_TEXTLINECOLOR )
+    {
+        if ( IsTextLineColor() )
+            pState->mpTextLineColor = new Color( GetTextLineColor() );
+        else
+            pState->mpTextLineColor = NULL;
+    }
+    if ( nFlags & PUSH_OVERLINECOLOR )
+    {
+        if ( IsOverlineColor() )
+            pState->mpOverlineColor = new Color( GetOverlineColor() );
+        else
+            pState->mpOverlineColor = NULL;
+    }
+    if ( nFlags & PUSH_TEXTALIGN )
+        pState->meTextAlign = GetTextAlign();
+    if( nFlags & PUSH_TEXTLAYOUTMODE )
+        pState->mnTextLayoutMode = GetLayoutMode();
+    if( nFlags & PUSH_TEXTLANGUAGE )
+        pState->meTextLanguage = GetDigitLanguage();
+    if ( nFlags & PUSH_RASTEROP )
+        pState->meRasterOp = GetRasterOp();
+    if ( nFlags & PUSH_MAPMODE )
+    {
+        pState->mpMapMode = new MapMode( maMapMode );
+        pState->mbMapActive = mbMap;
+    }
+    if ( nFlags & PUSH_CLIPREGION )
+    {
+        if ( mbClipRegion )
+            pState->mpClipRegion = new Region( maRegion );
+        else
+            pState->mpClipRegion = NULL;
+    }
+    if ( nFlags & PUSH_REFPOINT )
+    {
+        if ( mbRefPoint )
+            pState->mpRefPoint = new Point( maRefPoint );
+        else
+            pState->mpRefPoint = NULL;
+    }
+
+    mpOutDevStateStack->push( pState );
+
+    if( mpAlphaVDev )
+        mpAlphaVDev->Push();
+}
+
+void OutputDevice::Pop()
+{
+
+    if( mpMetaFile )
+        mpMetaFile->AddAction( new MetaPopAction() );
+
+    GDIMetaFile* pOldMetaFile = mpMetaFile;
+    OutDevState* pState = new OutDevState;
+    mpMetaFile = NULL;
+
+    if ( mpOutDevStateStack->empty() )
+    {
+        SAL_WARN( "vcl.gdi", "OutputDevice::Pop() without OutputDevice::Push()" );
+        return;
+    }
+
+    if( mpAlphaVDev )
+        mpAlphaVDev->Pop();
+
+    if ( pState->mnFlags & PUSH_LINECOLOR )
+    {
+        if ( pState->mpLineColor )
+            SetLineColor( *pState->mpLineColor );
+        else
+            SetLineColor();
+    }
+
+    if ( pState->mnFlags & PUSH_FILLCOLOR )
+    {
+        if ( pState->mpFillColor )
+            SetFillColor( *pState->mpFillColor );
+        else
+            SetFillColor();
+    }
+
+    if ( pState->mnFlags & PUSH_FONT )
+        SetFont( *pState->mpFont );
+
+    if ( pState->mnFlags & PUSH_TEXTCOLOR )
+        SetTextColor( *pState->mpTextColor );
+
+    if ( pState->mnFlags & PUSH_TEXTFILLCOLOR )
+    {
+        if ( pState->mpTextFillColor )
+            SetTextFillColor( *pState->mpTextFillColor );
+        else
+            SetTextFillColor();
+    }
+
+    if ( pState->mnFlags & PUSH_TEXTLINECOLOR )
+    {
+        if ( pState->mpTextLineColor )
+            SetTextLineColor( *pState->mpTextLineColor );
+        else
+            SetTextLineColor();
+    }
+
+    if ( pState->mnFlags & PUSH_OVERLINECOLOR )
+    {
+        if ( pState->mpOverlineColor )
+            SetOverlineColor( *pState->mpOverlineColor );
+        else
+            SetOverlineColor();
+    }
+
+    if ( pState->mnFlags & PUSH_TEXTALIGN )
+        SetTextAlign( pState->meTextAlign );
+
+    if( pState->mnFlags & PUSH_TEXTLAYOUTMODE )
+        SetLayoutMode( pState->mnTextLayoutMode );
+
+    if( pState->mnFlags & PUSH_TEXTLANGUAGE )
+        SetDigitLanguage( pState->meTextLanguage );
+
+    if ( pState->mnFlags & PUSH_RASTEROP )
+        SetRasterOp( pState->meRasterOp );
+
+    if ( pState->mnFlags & PUSH_MAPMODE )
+    {
+        if ( pState->mpMapMode )
+            SetMapMode( *pState->mpMapMode );
+        else
+            SetMapMode();
+        mbMap = pState->mbMapActive;
+    }
+
+    if ( pState->mnFlags & PUSH_CLIPREGION )
+        SetDeviceClipRegion( pState->mpClipRegion );
+
+    if ( pState->mnFlags & PUSH_REFPOINT )
+    {
+        if ( pState->mpRefPoint )
+            SetRefPoint( *pState->mpRefPoint );
+        else
+            SetRefPoint();
+    }
+
+    mpOutDevStateStack->pop();
+
+    mpMetaFile = pOldMetaFile;
+}
+
 bool OutputDevice::supportsOperation( OutDevSupportType eType ) const
 {
     if( !mpGraphics )
@@ -993,188 +1112,7 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint )
 
 sal_uInt32 OutputDevice::GetGCStackDepth() const
 {
-    const ImplObjStack* pData = mpObjStack;
-    sal_uInt32 nDepth = 0;
-    while( pData )
-    {
-        nDepth++;
-        pData = pData->mpPrev;
-    }
-    return nDepth;
-}
-
-void OutputDevice::Push( sal_uInt16 nFlags )
-{
-
-    if ( mpMetaFile )
-        mpMetaFile->AddAction( new MetaPushAction( nFlags ) );
-
-    ImplObjStack* pData = new ImplObjStack;
-    pData->mpPrev = mpObjStack;
-    mpObjStack = pData;
-
-    pData->mnFlags = nFlags;
-
-    if ( nFlags & PUSH_LINECOLOR )
-    {
-        if ( mbLineColor )
-            pData->mpLineColor = new Color( maLineColor );
-        else
-            pData->mpLineColor = NULL;
-    }
-    if ( nFlags & PUSH_FILLCOLOR )
-    {
-        if ( mbFillColor )
-            pData->mpFillColor = new Color( maFillColor );
-        else
-            pData->mpFillColor = NULL;
-    }
-    if ( nFlags & PUSH_FONT )
-        pData->mpFont = new Font( maFont );
-    if ( nFlags & PUSH_TEXTCOLOR )
-        pData->mpTextColor = new Color( GetTextColor() );
-    if ( nFlags & PUSH_TEXTFILLCOLOR )
-    {
-        if ( IsTextFillColor() )
-            pData->mpTextFillColor = new Color( GetTextFillColor() );
-        else
-            pData->mpTextFillColor = NULL;
-    }
-    if ( nFlags & PUSH_TEXTLINECOLOR )
-    {
-        if ( IsTextLineColor() )
-            pData->mpTextLineColor = new Color( GetTextLineColor() );
-        else
-            pData->mpTextLineColor = NULL;
-    }
-    if ( nFlags & PUSH_OVERLINECOLOR )
-    {
-        if ( IsOverlineColor() )
-            pData->mpOverlineColor = new Color( GetOverlineColor() );
-        else
-            pData->mpOverlineColor = NULL;
-    }
-    if ( nFlags & PUSH_TEXTALIGN )
-        pData->meTextAlign = GetTextAlign();
-    if( nFlags & PUSH_TEXTLAYOUTMODE )
-        pData->mnTextLayoutMode = GetLayoutMode();
-    if( nFlags & PUSH_TEXTLANGUAGE )
-        pData->meTextLanguage = GetDigitLanguage();
-    if ( nFlags & PUSH_RASTEROP )
-        pData->meRasterOp = GetRasterOp();
-    if ( nFlags & PUSH_MAPMODE )
-    {
-        pData->mpMapMode = new MapMode( maMapMode );
-        pData->mbMapActive = mbMap;
-    }
-    if ( nFlags & PUSH_CLIPREGION )
-    {
-        if ( mbClipRegion )
-            pData->mpClipRegion = new Region( maRegion );
-        else
-            pData->mpClipRegion = NULL;
-    }
-    if ( nFlags & PUSH_REFPOINT )
-    {
-        if ( mbRefPoint )
-            pData->mpRefPoint = new Point( maRefPoint );
-        else
-            pData->mpRefPoint = NULL;
-    }
-
-    if( mpAlphaVDev )
-        mpAlphaVDev->Push();
-}
-
-void OutputDevice::Pop()
-{
-
-    if( mpMetaFile )
-        mpMetaFile->AddAction( new MetaPopAction() );
-
-    GDIMetaFile*    pOldMetaFile = mpMetaFile;
-    ImplObjStack*   pData = mpObjStack;
-    mpMetaFile = NULL;
-
-    if ( !pData )
-    {
-        SAL_WARN( "vcl.gdi", "OutputDevice::Pop() without OutputDevice::Push()" );
-        return;
-    }
-
-    if( mpAlphaVDev )
-        mpAlphaVDev->Pop();
-
-    mpObjStack = pData->mpPrev;
-
-    if ( pData->mnFlags & PUSH_LINECOLOR )
-    {
-        if ( pData->mpLineColor )
-            SetLineColor( *pData->mpLineColor );
-        else
-            SetLineColor();
-    }
-    if ( pData->mnFlags & PUSH_FILLCOLOR )
-    {
-        if ( pData->mpFillColor )
-            SetFillColor( *pData->mpFillColor );
-        else
-            SetFillColor();
-    }
-    if ( pData->mnFlags & PUSH_FONT )
-        SetFont( *pData->mpFont );
-    if ( pData->mnFlags & PUSH_TEXTCOLOR )
-        SetTextColor( *pData->mpTextColor );
-    if ( pData->mnFlags & PUSH_TEXTFILLCOLOR )
-    {
-        if ( pData->mpTextFillColor )
-            SetTextFillColor( *pData->mpTextFillColor );
-        else
-            SetTextFillColor();
-    }
-    if ( pData->mnFlags & PUSH_TEXTLINECOLOR )
-    {
-        if ( pData->mpTextLineColor )
-            SetTextLineColor( *pData->mpTextLineColor );
-        else
-            SetTextLineColor();
-    }
-    if ( pData->mnFlags & PUSH_OVERLINECOLOR )
-    {
-        if ( pData->mpOverlineColor )
-            SetOverlineColor( *pData->mpOverlineColor );
-        else
-            SetOverlineColor();
-    }
-    if ( pData->mnFlags & PUSH_TEXTALIGN )
-        SetTextAlign( pData->meTextAlign );
-    if( pData->mnFlags & PUSH_TEXTLAYOUTMODE )
-        SetLayoutMode( pData->mnTextLayoutMode );
-    if( pData->mnFlags & PUSH_TEXTLANGUAGE )
-        SetDigitLanguage( pData->meTextLanguage );
-    if ( pData->mnFlags & PUSH_RASTEROP )
-        SetRasterOp( pData->meRasterOp );
-    if ( pData->mnFlags & PUSH_MAPMODE )
-    {
-        if ( pData->mpMapMode )
-            SetMapMode( *pData->mpMapMode );
-        else
-            SetMapMode();
-        mbMap = pData->mbMapActive;
-    }
-    if ( pData->mnFlags & PUSH_CLIPREGION )
-        SetDeviceClipRegion( pData->mpClipRegion );
-    if ( pData->mnFlags & PUSH_REFPOINT )
-    {
-        if ( pData->mpRefPoint )
-            SetRefPoint( *pData->mpRefPoint );
-        else
-            SetRefPoint();
-    }
-
-    ImplDeleteObjStack( pData );
-
-    mpMetaFile = pOldMetaFile;
+    return mpOutDevStateStack->size();
 }
 
 void OutputDevice::SetConnectMetaFile( GDIMetaFile* pMtf )
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
new file mode 100644
index 0000000..da4b004
--- /dev/null
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <sal/types.h>
+
+#include <vcl/mapmod.hxx>
+#include <vcl/region.hxx>
+#include <vcl/font.hxx>
+#include <vcl/vclenum.hxx>
+
+#include <tools/gen.hxx>
+#include <tools/color.hxx>
+#include <tools/fontenum.hxx>
+
+#include <vcl/outdevstate.hxx>
+#include "sallayout.hxx"
+
+OutDevState::~OutDevState()
+{
+    if ( mnFlags & PUSH_LINECOLOR )
+    {
+        if ( mpLineColor )
+            delete mpLineColor;
+    }
+    if ( mnFlags & PUSH_FILLCOLOR )
+    {
+        if ( mpFillColor )
+            delete mpFillColor;
+    }
+    if ( mnFlags & PUSH_FONT )
+        delete mpFont;
+    if ( mnFlags & PUSH_TEXTCOLOR )
+        delete mpTextColor;
+    if ( mnFlags & PUSH_TEXTFILLCOLOR )
+    {
+        if ( mpTextFillColor )
+            delete mpTextFillColor;
+    }
+    if ( mnFlags & PUSH_TEXTLINECOLOR )
+    {
+        if ( mpTextLineColor )
+            delete mpTextLineColor;
+    }
+    if ( mnFlags & PUSH_OVERLINECOLOR )
+    {
+        if ( mpOverlineColor )
+            delete mpOverlineColor;
+    }
+    if ( mnFlags & PUSH_MAPMODE )
+    {
+        if ( mpMapMode )
+            delete mpMapMode;
+    }
+    if ( mnFlags & PUSH_CLIPREGION )
+    {
+        if ( mpClipRegion )
+            delete mpClipRegion;
+    }
+    if ( mnFlags & PUSH_REFPOINT )
+    {
+        if ( mpRefPoint )
+            delete mpRefPoint;
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8fd08d76374c348bc1b46f6387d00a755a619290
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Fri Apr 25 14:06:57 2014 +0200

    add better info on the Qt patches needed for KFileDialog
    
    Change-Id: I1902f962ac03b171c5e7a45d9c8e59450b04418f

diff --git a/configure.ac b/configure.ac
index 507678a..d377325 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11243,6 +11243,8 @@ int main(int argc, char **argv) {
             AC_DEFINE(KDE_HAVE_GLIB,1)
             KDE_GLIB_CFLAGS=$(printf '%s' "$KDE_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 
+            qt4_fix_warning=
+
             AC_LANG_PUSH([C++])
             save_CXXFLAGS=$CXXFLAGS
             CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
@@ -11269,7 +11271,12 @@ int main(int argc, char *argv[])
                 AC_MSG_RESULT([yes])
             ],[
                 AC_MSG_RESULT([no])
-                AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime - fix your Qt4 library!])
+                AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
+                if test -z "$qt4_fix_warning"; then
+                    add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
+                fi
+                qt4_fix_warning=1
+                add_warning "  https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
             ])
 
             # Remove meta object data
@@ -11296,12 +11303,21 @@ int main(int argc, char *argv[])
                 AC_MSG_RESULT([yes])
             ],[
                 AC_MSG_RESULT([no])
-                AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime - fix your Qt4 library!])
+                AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
+                if test -z "$qt4_fix_warning"; then
+                    add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
+                fi
+                qt4_fix_warning=1
+                add_warning "  https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
             ])
 
             # Remove meta object data
             rm -f "${TSTBASE}."*
 
+            if test -n "$qt4_fix_warning"; then
+                add_warning "  https://bugreports.qt-project.org/browse/QTBUG-38585 (recommended)"
+            fi
+
             LIBS=$save_LIBS
             CXXFLAGS=$save_CXXFLAGS
             AC_LANG_POP([C++])
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index f6c15b0..faa1ff1 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -192,9 +192,9 @@ void KDEXLib::Init()
     // that will release SolarMutex when waiting for more events.
     // Moreover there are bugs in Qt event loop code that allow QClipboard recursing because the event
     // loop processes also events that it should not at that point, so no dialogs in that case either.
+    // https://bugreports.qt-project.org/browse/QTBUG-37380
+    // https://bugreports.qt-project.org/browse/QTBUG-34614
     if (m_isGlibEventLoopType && (0 == tst_processEventsExcludeSocket()) && tst_excludePostedEvents() == 0 )
-        // See http://bugreports.qt.nokia.com/browse/QTBUG-37380
-        // https://bugreports.qt-project.org/browse/QTBUG-34614
         m_allowKdeDialogs = true;
 #endif
 
commit 487b61a1d6d30e0d703494d1de975580525f5d91
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Fri Apr 25 13:08:23 2014 +0200

    disable KFileDialog usage if QClipboard can recurse
    
    Change-Id: If23a365b96c1634c2f8940f6ece973089dc3151f

diff --git a/configure.ac b/configure.ac
index d77291e..507678a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11275,6 +11275,33 @@ int main(int argc, char *argv[])
             # Remove meta object data
             rm -f "${TSTBASE}."*
 
+            AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
+
+            # Prepare meta object data
+            TSTBASE="tst_exclude_posted_events"
+            TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
+            ln -fs "${TSTMOC}.hxx"
+            $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
+
+            AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include "tst_exclude_posted_events.moc"
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+    exit(tst_excludePostedEvents());
+    return 0;
+}
+            ]])],[
+                AC_MSG_RESULT([yes])
+            ],[
+                AC_MSG_RESULT([no])
+                AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime - fix your Qt4 library!])
+            ])
+
+            # Remove meta object data
+            rm -f "${TSTBASE}."*
+
             LIBS=$save_LIBS
             CXXFLAGS=$save_CXXFLAGS
             AC_LANG_POP([C++])
diff --git a/vcl/CustomTarget_kde4_moc.mk b/vcl/CustomTarget_kde4_moc.mk
index 9e41754..16d1561 100644
--- a/vcl/CustomTarget_kde4_moc.mk
+++ b/vcl/CustomTarget_kde4_moc.mk
@@ -12,7 +12,8 @@ $(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde4))
 $(call gb_CustomTarget_get_target,vcl/unx/kde4) : \
 	$(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/KDEXLib.moc \
 	$(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/KDE4FilePicker.moc \
-	$(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/tst_exclude_socket_notifiers.moc
+	$(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/tst_exclude_socket_notifiers.moc \
+	$(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/tst_exclude_posted_events.moc
 
 $(call gb_CustomTarget_get_workdir,vcl/unx/kde4)/%.moc : \
 		$(SRCDIR)/vcl/unx/kde4/%.hxx \
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index 023d790..094cd20 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -35,7 +35,7 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDESalInstance::createFilePicker(
     const uno::Reference< uno::XComponentContext >& xMSF )
 {
     KDEXLib* kdeXLib = static_cast<KDEXLib*>( mpXLib );
-    if (kdeXLib->haveQt4SocketExcludeFix())
+    if (kdeXLib->allowKdeDialogs())
         return uno::Reference< ui::dialogs::XFilePicker2 >(
             kdeXLib->createFilePicker(xMSF) );
     else
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 24557bc..f6c15b0 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -47,13 +47,14 @@
 #if KDE_HAVE_GLIB
 #include "KDE4FilePicker.hxx"
 #include "tst_exclude_socket_notifiers.moc"
+#include "tst_exclude_posted_events.moc"
 #endif
 
 KDEXLib::KDEXLib() :
     SalXLib(),  m_bStartupDone(false), m_pApplication(0),
     m_pFreeCmdLineArgs(0), m_pAppCmdLineArgs(0), m_nFakeCmdLineArgs( 0 ),
     m_frameWidth( -1 ), m_isGlibEventLoopType(false),
-    m_haveQt4SocketExcludeFix(false)
+    m_allowKdeDialogs(false)
 {
     // the timers created here means they belong to the main thread.
     // As the timeoutTimer runs the LO event queue, which may block on a dialog,
@@ -187,9 +188,14 @@ void KDEXLib::Init()
 
 #if KDE_HAVE_GLIB
     m_isGlibEventLoopType = QAbstractEventDispatcher::instance()->inherits( "QEventDispatcherGlib" );
-    if (m_isGlibEventLoopType && (0 == tst_processEventsExcludeSocket()))
+    // Using KDE dialogs (and their nested event loops) works only with a proper event loop integration
+    // that will release SolarMutex when waiting for more events.
+    // Moreover there are bugs in Qt event loop code that allow QClipboard recursing because the event
+    // loop processes also events that it should not at that point, so no dialogs in that case either.
+    if (m_isGlibEventLoopType && (0 == tst_processEventsExcludeSocket()) && tst_excludePostedEvents() == 0 )
         // See http://bugreports.qt.nokia.com/browse/QTBUG-37380
-        m_haveQt4SocketExcludeFix = true;
+        // https://bugreports.qt-project.org/browse/QTBUG-34614
+        m_allowKdeDialogs = true;
 #endif
 
     setupEventLoop();
@@ -238,7 +244,7 @@ void KDEXLib::setupEventLoop()
     {
         old_gpoll = g_main_context_get_poll_func( NULL );
         g_main_context_set_poll_func( NULL, gpoll_wrapper );
-        if( m_haveQt4SocketExcludeFix )
+        if( m_allowKdeDialogs )
             m_pApplication->clipboard()->setProperty( "useEventLoopWhenWaiting", true );
         return;
     }
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index e45543d..1f2a2dd 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -53,7 +53,7 @@ class KDEXLib : public QObject, public SalXLib
         QTimer userEventTimer;
         int m_frameWidth;
         bool m_isGlibEventLoopType;
-        bool m_haveQt4SocketExcludeFix;
+        bool m_allowKdeDialogs;
 
     private:
         void setupEventLoop();
@@ -88,7 +88,7 @@ class KDEXLib : public QObject, public SalXLib
         virtual void PostUserEvent() SAL_OVERRIDE;
 
         void doStartup();
-        bool haveQt4SocketExcludeFix() { return m_haveQt4SocketExcludeFix; }
+        bool allowKdeDialogs() { return m_allowKdeDialogs; }
 
     public Q_SLOTS:
         com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
diff --git a/vcl/unx/kde4/tst_exclude_posted_events.hxx b/vcl/unx/kde4/tst_exclude_posted_events.hxx
new file mode 100644
index 0000000..777907c
--- /dev/null
+++ b/vcl/unx/kde4/tst_exclude_posted_events.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ *
+ * This code is based on the SocketEventsTester from the Qt4 test suite.
+ */
+
+#pragma once
+
+#include <qcoreapplication.h>
+#include <qeventloop.h>
+#include <qtimer.h>
+
+const QEvent::Type eventType = QEvent::User;
+
+class Test
+    : public QObject
+{
+    Q_OBJECT
+    public:
+        Test();
+        virtual bool event( QEvent* e );
+        bool processed;
+};
+
+Test::Test()
+    : processed( false )
+{
+}
+
+bool Test::event( QEvent* e )
+{
+    if( e->type() == eventType )
+        processed = true;
+    return QObject::event( e );
+}
+
+#define QVERIFY(a) \
+    if (!a) return 1;
+
+static int tst_excludePostedEvents()
+{
+    Test test;
+    QCoreApplication::postEvent( &test, new QEvent( eventType ));
+    QEventLoop loop;
+    QTimer::singleShot(200, &loop, SLOT(quit()));
+    loop.processEvents(QEventLoop::ExcludeUserInputEvents
+        | QEventLoop::ExcludeSocketNotifiers
+//        | QEventLoop::WaitForMoreEvents
+        | QEventLoop::X11ExcludeTimers);
+    QVERIFY( !test.processed );
+    QTimer::singleShot(200, &loop, SLOT(quit()));
+        loop.exec();
+    QVERIFY( test.processed );
+    return 0;
+}
commit 05c6a77b601b4adb24a4636d2d3e77e78cfe9fca
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Fri Apr 25 13:05:43 2014 +0200

    fix Qt4 QSocketNotifier configure check
    
    When built as a part of the configure check, this doesn't know SAL_OVERRIDE.
    
    Change-Id: I1420dd50efdd6666f246884f286a3f29e0b56a2c

diff --git a/vcl/unx/kde4/tst_exclude_socket_notifiers.hxx b/vcl/unx/kde4/tst_exclude_socket_notifiers.hxx
index 01f01b9..297cdf2 100644
--- a/vcl/unx/kde4/tst_exclude_socket_notifiers.hxx
+++ b/vcl/unx/kde4/tst_exclude_socket_notifiers.hxx
@@ -28,6 +28,11 @@
 #include <QtNetwork/qtcpserver.h>
 #include <QtNetwork/qtcpsocket.h>
 
+// This is also used by a configure check.
+#ifndef SAL_OVERRIDE
+#define SAL_OVERRIDE
+#endif
+
 class SocketEventsTester: public QObject
 {
     Q_OBJECT
commit da7167a0e828f1c1079a99c98aa2831327f92674
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Fri Apr 25 08:57:42 2014 +0200

    make sure KFileDialog does not leave the SolarMutex released
    
    Change-Id: I806bf5fe1cd1871de499ceeeadf36de539e9d637

diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index b92d86f..5f121cc 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -256,19 +256,17 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
     _dialog->setFilter(_filter);
     _dialog->filterWidget()->setEditable(false);
 
-    // At this point, SolarMutex is held. Opening the KDE file dialog here
-    // can lead to QClipboard asking for clipboard contents. If LO core
-    // is the owner of the clipboard content, this will block for 5 seconds
-    // and timeout, since the clipboard thread will not be able to acquire
-    // SolarMutex and thus won't be able to respond. If the event loops
+    // KFileDialog intergration requires using event loop with QClipboard.
+    // Opening the KDE file dialog here can lead to QClipboard
+    // asking for clipboard contents. If LO core is the owner of the clipboard
+    // content, without event loop use this will block for 5 seconds and timeout,
+    // since the clipboard thread will not be able to acquire SolarMutex
+    // and thus won't be able to respond. If the event loops
     // are properly integrated and QClipboard can use a nested event loop
-    // (see the KDE VCL plug), then this won't happen, but otherwise
-    // simply release the SolarMutex here. The KDE file dialog does not
-    // call back to the core, so this should be safe (and if it does,
-    // SolarMutex will need to be re-acquired).
-    long mutexrelease = 0;
-    if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool())
-        mutexrelease = Application::ReleaseSolarMutex();
+    // (see the KDE VCL plug), then this won't happen.
+    // We cannot simply release SolarMutex here, because the event loop started
+    // by the file dialog would also call back to LO code.
+    assert( qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool() == true );
     //block and wait for user input
     int result = _dialog->exec();
     // HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings
@@ -276,8 +274,6 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
     // (which is probably a KDE bug), so force reading the new configuration,
     // otherwise the next opening of the dialog would use the old settings.
     KGlobal::config()->reparseConfiguration();
-    if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool())
-        Application::AcquireSolarMutex( mutexrelease );
     if( result == KFileDialog::Accepted)
         return ExecutableDialogResults::OK;
 
commit 9eab3e78b1f1927ee1ac2158a39ab22802779f92
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Fri Mar 28 15:09:13 2014 +0100

    Revert "Rewrite Qt4 based nested yield mutex locking."
    
    In a dbgutil build LO aborts on an assertion failure the moment
    KFileDialog is open. It's definitely on okay to release SolarMutex just
    like that, since the Qt event loop is integrated with LO's, it'll call
    back to LO code without the mutex held.
    
    This reverts commit 13a34f4c6307d1bd2443cbf3fbd83bfdd8cdbafb.
    
    Conflicts:
    	vcl/unx/kde4/KDE4FilePicker.cxx
    	vcl/unx/kde4/KDEXLib.cxx
    
    Change-Id: Idfa27fbb4728b529c37c25f710ea208fdaa4455c

diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index 969fd2c..b92d86f 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -256,20 +256,28 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
     _dialog->setFilter(_filter);
     _dialog->filterWidget()->setEditable(false);
 
-    // We're entering a nested loop.
-    int result;
-    {
-        // Release the yield mutex to prevent deadlocks.
-        SalYieldMutexReleaser aReleaser;
-        result = _dialog->exec();
-    }
-
+    // At this point, SolarMutex is held. Opening the KDE file dialog here
+    // can lead to QClipboard asking for clipboard contents. If LO core
+    // is the owner of the clipboard content, this will block for 5 seconds
+    // and timeout, since the clipboard thread will not be able to acquire
+    // SolarMutex and thus won't be able to respond. If the event loops
+    // are properly integrated and QClipboard can use a nested event loop
+    // (see the KDE VCL plug), then this won't happen, but otherwise
+    // simply release the SolarMutex here. The KDE file dialog does not
+    // call back to the core, so this should be safe (and if it does,
+    // SolarMutex will need to be re-acquired).
+    long mutexrelease = 0;
+    if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool())
+        mutexrelease = Application::ReleaseSolarMutex();
+    //block and wait for user input
+    int result = _dialog->exec();
     // HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings
     // (such as the auto-extension flag), but that doesn't update KGlobal::config()
     // (which is probably a KDE bug), so force reading the new configuration,
     // otherwise the next opening of the dialog would use the old settings.
     KGlobal::config()->reparseConfiguration();
-
+    if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool())
+        Application::AcquireSolarMutex( mutexrelease );
     if( result == KFileDialog::Accepted)
         return ExecutableDialogResults::OK;
 
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index e4900a7..24557bc 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -286,16 +286,13 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
         }
         return SalXLib::Yield( bWait, bHandleAllCurrentEvents );
     }
-
     // if we are the main thread (which is where the event processing is done),
     // good, just do it
     if( qApp->thread() == QThread::currentThread())
         processYield( bWait, bHandleAllCurrentEvents );
     else
-    {
-        // we were called from another thread;
-        // release the yield lock to prevent deadlock.
-        SalYieldMutexReleaser aReleaser;
+    { // if this deadlocks, event processing needs to go into a separate thread
+      // or some other solution needs to be found
         Q_EMIT processYieldSignal( bWait, bHandleAllCurrentEvents );
     }
 }
commit cb5308020a2b6e43c95ffc651522b6f20a8c8177
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 25 14:14:50 2014 +0200

    That lone acquire() was hopefully just a needless copy/paste
    
    ...from ab9d657e0060473a25abd6f36bd30aad0574a4db "INTEGRATION: CWS dba22ui:
    acquire in dtor, to prevent reentrance."  Yuck.
    
    Change-Id: Iec5e1fa9d04199a4a1e83c67ed2014299317c5d8

diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx
index e914f30..776249c 100644
--- a/connectivity/source/drivers/mork/MConnection.cxx
+++ b/connectivity/source/drivers/mork/MConnection.cxx
@@ -59,7 +59,6 @@ OConnection::OConnection(MorkDriver* _pDriver)
 
 OConnection::~OConnection()
 {
-    acquire();
     if(!isClosed())
         close();
     m_pDriver->release();
commit b45c789905d4c9af7c5de38091fb4139be425081
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 14:35:54 2014 +0300

    WaE: implicit conversion of literal of type 'sal_Bool' to 'bool'
    
    Change-Id: Icb96b36aca144262f44fe496b4a44605b8f8a85c

diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index e37f384..d366b96 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -259,7 +259,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
             }
         }
 
-        m_bIsFillStyleAlreadyConverted = sal_True;
+        m_bIsFillStyleAlreadyConverted = true;
     }
 
     struct _ContextID_Index_Pair aContextIDs[] =
commit 8258dcc74a1cece05f86c96efc7e8588d986b622
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 14:33:49 2014 +0300

    Improve help message for --with-locales
    
    Change-Id: I54109240f55a6e0d13dee16882a8175140b77867

diff --git a/configure.ac b/configure.ac
index 6621afb..d77291e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1960,13 +1960,24 @@ AC_ARG_WITH(lang,
 AC_ARG_WITH(locales,
     AS_HELP_STRING([--with-locales],
         [Use this option to limit the locale information built in.
-         By default all the locales available is included.
-         This option is completely unrelated to --with-lang.
          Separate multiple locales with space.
-         For the default, all locales, don't use this switch at all.
-         Specifying just the language part of a locale means all matching
-         locales will be included.])
+         Very experimental and might well break stuff.
+         Just a desperate measure to shrink code and data size.
+         By default all the locales available is included.
+         This option is completely unrelated to --with-lang.])
     [
+                          Affects also our character encoding conversion
+                          tables for encodings mainly targeted for a
+                          particular locale, like EUC-CN and EUC-TW for
+                          zh, ISO-2022-JP for ja.
+
+                          Affects also our add-on break iterator data for
+                          some languages.
+
+                          For the default, all locales, don't use this switch at all.
+                          Specifying just the language part of a locale means all matching
+                          locales will be included.
+
                           Usage:     --with-locales="en es pt fr zh kr ja"
     ],
 ,)
commit bca0fa3fdb2a80e828fc99e163157a1609ac9f9a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Apr 25 12:26:07 2014 +0200

    sw: adapt object/picturedialog.ui to FillAttributes
    
    Change-Id: I7e1876c61468a5c45cf4dfd5db6d9c4a9697d751

diff --git a/sw/uiconfig/swriter/ui/objectdialog.ui b/sw/uiconfig/swriter/ui/objectdialog.ui
index dc48bdf..cd56896 100644
--- a/sw/uiconfig/swriter/ui/objectdialog.ui
+++ b/sw/uiconfig/swriter/ui/objectdialog.ui
@@ -160,10 +160,10 @@
               <placeholder/>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="background">
+              <object class="GtkLabel" id="area">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Background</property>
+                <property name="label" translatable="yes">Area</property>
               </object>
               <packing>
                 <property name="position">5</property>
@@ -174,13 +174,27 @@
               <placeholder/>
             </child>
             <child type="tab">
+              <object class="GtkLabel" id="transparence">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Transparency</property>
+              </object>
+              <packing>
+                <property name="position">6</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
               <object class="GtkLabel" id="macro">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Macro</property>
               </object>
               <packing>
-                <property name="position">6</property>
+                <property name="position">7</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
diff --git a/sw/uiconfig/swriter/ui/picturedialog.ui b/sw/uiconfig/swriter/ui/picturedialog.ui
index 71e3140..5562076 100644
--- a/sw/uiconfig/swriter/ui/picturedialog.ui
+++ b/sw/uiconfig/swriter/ui/picturedialog.ui
@@ -188,10 +188,10 @@
               <placeholder/>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="background">
+              <object class="GtkLabel" id="area">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Background</property>
+                <property name="label" translatable="yes">Area</property>
               </object>
               <packing>
                 <property name="position">7</property>
@@ -202,13 +202,27 @@
               <placeholder/>
             </child>
             <child type="tab">
+              <object class="GtkLabel" id="transparence">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Transparency</property>
+              </object>
+              <packing>
+                <property name="position">8</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
               <object class="GtkLabel" id="macro">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Macro</property>
               </object>
               <packing>
-                <property name="position">8</property>
+                <property name="position">9</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
commit 1d52b9636cf9faf34597604a853d6a9b3a892599
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Apr 17 16:44:58 2014 +0000

    i#124638 support for DrawingLayre FillStyle for GraphicFrames and ...
    
    ... EmbeddedObjectFrames in Writer
    
    (cherry picked from commit 8433ee82c9323501545164ddf6e6008db483ab7a)
    
    Conflicts:
    	sw/source/core/attr/format.cxx
    	sw/source/core/layout/paintfrm.cxx
    	sw/source/core/uibase/shells/grfsh.cxx
    	sw/source/core/unocore/unomap.cxx
    	sw/source/core/unocore/unostyle.cxx
    	sw/source/ui/frmdlg/frmpage.src
    	xmloff/inc/xmloff/XMLShapeStyleContext.hxx
    	xmloff/source/draw/XMLShapeStyleContext.cxx
    
    Change-Id: I441378ec3e9a32764781a8063adcc52051efe17f

diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx
index 89662c0..a93181a 100644
--- a/include/xmloff/XMLShapeStyleContext.hxx
+++ b/include/xmloff/XMLShapeStyleContext.hxx
@@ -36,6 +36,8 @@ protected:
     OUString     m_sControlDataStyleName;
     OUString     m_sListStyleName;
     bool         m_bIsNumRuleAlreadyConverted;
+    //UUUU
+    bool         m_bIsFillStyleAlreadyConverted;
 
 protected:
     virtual void SetAttribute( sal_uInt16 nPrefixKey,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index f718fca..0b3cf4d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -320,9 +320,12 @@
             Calc,           OLE,        hidden  ;
             DrawImpress,    3DObject,   visible ;
             DrawImpress,    Draw,       visible ;
+            DrawImpress,    Graphic,    hidden  ;
             DrawImpress,    TextObject, hidden  ;
             DrawImpress,    OLE,        hidden  ;
             WriterVariants, Draw,       visible ;
+            Writer,         Graphic,    hidden  ;
+            Writer,         OLE,        hidden  ;
             Writer,         Frame,      visible ;
           </value>
         </prop>
diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi
index 7325486..6d1bd32 100644
--- a/sw/sdi/_frmsh.sdi
+++ b/sw/sdi/_frmsh.sdi
@@ -21,6 +21,7 @@ interface BaseTextFrame
     Automation = FALSE;
 ]
 {
+    //UUUU
     SID_ATTR_FILL_STYLE
     [
         Export = FALSE;
@@ -29,6 +30,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_COLOR
     [
         Export = FALSE;
@@ -37,6 +39,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_GRADIENT
     [
         Export = FALSE;
@@ -45,6 +48,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_HATCH
     [
         Export = FALSE;
@@ -53,6 +57,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_BITMAP
     [
         Export = FALSE;
@@ -61,6 +66,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_TRANSPARENCE
     [
         Export = FALSE;
@@ -69,6 +75,7 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_ATTR_FILL_FLOATTRANSPARENCE
     [
         Export = FALSE;
@@ -77,26 +84,31 @@ interface BaseTextFrame
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    //UUUU
     SID_COLOR_TABLE
     [
         StateMethod = GetDrawAttrStateTextFrame;
     ]
 
+    //UUUU
     SID_GRADIENT_LIST
     [
         StateMethod = GetDrawAttrStateTextFrame;
     ]
 
+    //UUUU
     SID_HATCH_LIST
     [
         StateMethod = GetDrawAttrStateTextFrame;
     ]
 
+    //UUUU
     SID_BITMAP_LIST
     [
         StateMethod = GetDrawAttrStateTextFrame;
     ]
 
+    //UUUU
     SID_ATTRIBUTES_AREA
     [
         ExecMethod = ExecDrawDlgTextFrame;
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 776827c..ea2d88a 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -538,16 +538,27 @@ bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
 
     bool bRet = false;
 
+    //UUUU Usel local copy to be able to apply needed changes, e.g. call
+    // CheckForUniqueItemForLineFillNameOrIndex which is needed for NameOrIndex stuff
+    SfxItemSet aTempSet(rSet);
+
+    //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex
+    // and evtl. correct that item to ensure unique names for that type. This call may
+    // modify/correct entries inside of the given SfxItemSet
+    if(GetDoc())
+    {
+        GetDoc()->CheckForUniqueItemForLineFillNameOrIndex(aTempSet);
+    }
+
     //UUUU
     if(RES_FLYFRMFMT == Which())
     {
         const SfxPoolItem* pSource = 0;
 
-        if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, false, &pSource))
+        if(SFX_ITEM_SET == aTempSet.GetItemState(RES_BACKGROUND, false, &pSource))
         {
             //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
             OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
-            SfxItemSet aTempSet(rSet);
 
             // copy all items to be set anyways to a local ItemSet with is also prepared for the new
             // fill attribute ranges [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Add the attributes
@@ -591,7 +602,7 @@ bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
            ( RES_GRFFMTCOLL == nFmtWhich ||
              RES_TXTFMTCOLL == nFmtWhich ) ) )
     {
-        if( ( bRet = aSet.Put( rSet )) )
+        if( ( bRet = aSet.Put( aTempSet )) )
             aSet.SetModifyAtAttr( this );
         // #i71574#
         if ( nFmtWhich == RES_TXTFMTCOLL )
@@ -603,7 +614,7 @@ bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
     {
         SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
                   aNew( *aSet.GetPool(), aSet.GetRanges() );
-        bRet = aSet.Put_BC( rSet, &aOld, &aNew );
+        bRet = aSet.Put_BC( aTempSet, &aOld, &aNew );
         if( bRet )
         {
             // some special treatments for attributes
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 7806a76..1c91e5c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4121,9 +4121,10 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
                 //UUUU check for transparency
                 const FillAttributesPtr aFillAttributes(pSwFrmFmt->getFillAttributes());
 
-                if(aFillAttributes.get())
+                // check if the new fill attributes are used
+                if(aFillAttributes.get() && aFillAttributes->isUsed())
                 {
-                    bPaintCompleteBack = aFillAttributes->isTransparent();
+                    bPaintCompleteBack = true;
                 }
             }
             else
diff --git a/sw/source/core/uibase/shells/frmsh.cxx b/sw/source/core/uibase/shells/frmsh.cxx
index b140b44..9e2f389 100644
--- a/sw/source/core/uibase/shells/frmsh.cxx
+++ b/sw/source/core/uibase/shells/frmsh.cxx
@@ -433,11 +433,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                     SID_HTML_MODE,          SID_HTML_MODE,                          // [10414
                     FN_GET_PRINT_AREA,      FN_GET_PRINT_AREA,                      // [21032
                     FN_SURROUND,            FN_HORI_ORIENT,                         // [21303
-                    FN_SET_FRM_NAME,        FN_SET_FRM_NAME,                        // [21306
-                    FN_KEEP_ASPECT_RATIO,   FN_KEEP_ASPECT_RATIO,                   // [21307
+                    FN_SET_FRM_NAME,        FN_KEEP_ASPECT_RATIO,                   // [21306
                     FN_SET_FRM_ALT_NAME,    FN_SET_FRM_ALT_NAME,                    // [21318
-                    FN_OLE_IS_MATH,         FN_OLE_IS_MATH,                         // [22314
-                    FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT,         // [22315
+                    FN_OLE_IS_MATH,         FN_MATH_BASELINE_ALIGNMENT,             // [22314
                     FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT,                   // [22420
 
                     0);
diff --git a/sw/source/core/uibase/shells/grfsh.cxx b/sw/source/core/uibase/shells/grfsh.cxx
index d78af68..4f0797b 100644
--- a/sw/source/core/uibase/shells/grfsh.cxx
+++ b/sw/source/core/uibase/shells/grfsh.cxx
@@ -68,6 +68,10 @@
 #include <svx/graphichelper.hxx>
 #include <doc.hxx>
 
+#include <doc.hxx>
+#include <docsh.hxx>
+#include <svx/drawitem.hxx>
+
 #define SwGrfShell
 
 #include <sfx2/msg.hxx>
@@ -204,23 +208,42 @@ void SwGrfShell::Execute(SfxRequest &rReq)
             const SwViewOption* pVOpt = rSh.GetViewOptions();
             SwViewOption aUsrPref( *pVOpt );
 
-            SfxItemSet aSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1,
-                            RES_GRFATR_MIRRORGRF,   RES_GRFATR_CROPGRF,
-                            SID_ATTR_BORDER_INNER,  SID_ATTR_BORDER_INNER,
-                            SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM,
-                            SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE,
-                            SID_ATTR_GRAF_FRMSIZE_PERCENT, SID_ATTR_GRAF_FRMSIZE_PERCENT,
-                            SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC,
-                            FN_PARAM_GRF_CONNECT,   FN_PARAM_GRF_CONNECT,
-                            SID_ATTR_PAGE_SIZE,     SID_ATTR_PAGE_SIZE,
-                            FN_GET_PRINT_AREA,      FN_GET_PRINT_AREA,
-                            FN_SET_FRM_NAME,        FN_KEEP_ASPECT_RATIO,
-                            FN_PARAM_GRF_DIALOG,    FN_PARAM_GRF_DIALOG,
-                            SID_DOCFRAME,           SID_DOCFRAME,
-                            SID_HTML_MODE,          SID_HTML_MODE,
-                            FN_SET_FRM_ALT_NAME,    FN_SET_FRM_ALT_NAME,
-                            SID_REFERER,            SID_REFERER,
-                            0);
+            SfxItemSet aSet(GetPool(), //UUUU sorted by indices
+
+                RES_FRMATR_BEGIN,RES_FRMATR_END - 1,                            // [   82
+                RES_GRFATR_MIRRORGRF,RES_GRFATR_CROPGRF,                        // [  123
+
+                //UUUU FillAttribute support
+                XATTR_FILL_FIRST,       XATTR_FILL_LAST,                        // [ 1014
+
+                SID_DOCFRAME,SID_DOCFRAME,                                      // [ 5598
+                SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER,                    // [10023
+                SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE,                          // [10051
+                SID_ATTR_GRAF_KEEP_ZOOM,SID_ATTR_GRAF_KEEP_ZOOM,                // [10882
+                SID_ATTR_GRAF_FRMSIZE,SID_ATTR_GRAF_GRAPHIC,                    // [10884, contains SID_ATTR_GRAF_FRMSIZE_PERCENT
+
+                //UUUU items to hand over XPropertyList things like
+                // XColorList, XHatchList, XGradientList and XBitmapList
+                // to the Area TabPage
+                SID_COLOR_TABLE,        SID_BITMAP_LIST,                        // [10179
+
+                SID_HTML_MODE,SID_HTML_MODE,                                    // [10414
+                FN_GET_PRINT_AREA,FN_GET_PRINT_AREA,                            // [21032
+                FN_PARAM_GRF_CONNECT,FN_PARAM_GRF_CONNECT,                      // [21153
+                FN_PARAM_GRF_DIALOG,FN_PARAM_GRF_DIALOG,                        // [21171
+                FN_SET_FRM_NAME,FN_KEEP_ASPECT_RATIO,                           // [21306
+                FN_SET_FRM_ALT_NAME,FN_SET_FRM_ALT_NAME,                        // [21318
+                SID_REFERER,            SID_REFERER,
+                0);
+
+            //UUUU create needed items for XPropertyList entries from the DrawModel so that
+            // the Area TabPage can access them
+            const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();
+
+            aSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
+            aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
+            aSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
+            aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
 
             sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
             aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
diff --git a/sw/source/core/unocore/unobrushitemhelper.cxx b/sw/source/core/unocore/unobrushitemhelper.cxx
index ebf9a94..d28c40e 100644
--- a/sw/source/core/unocore/unobrushitemhelper.cxx
+++ b/sw/source/core/unocore/unobrushitemhelper.cxx
@@ -130,6 +130,18 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI
             OSL_ENSURE(false, "Could not get Graphic from SvxBrushItem (!)");
         }
     }
+    else
+    {
+        // GPOS_NONE == rBrush.GetGraphicPos() && 0xff == rBrush.GetColor().GetTransparency(),
+        // still need to rescue the color used. There are sequences used on the UNO API at
+        // import time (OLE. e.g. chart) which first set RGB color (MID_BACK_COLOR_R_G_B,
+        // color stays transparent) and then set transparency (MID_BACK_COLOR_TRANSPARENCY)
+        // to zero later. When not saving the color, it will be lost
+        const Color aColor(rBrush.GetColor().GetRGBColor());
+
+        // rToSet.Put(XFillStyleItem(XFILL_NONE));
+        rToSet.Put(XFillColorItem(OUString(), aColor));
+    }
 }
 
 //UUUU
@@ -172,20 +184,24 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, sal_Bool bSea
 //UUUU
 SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents)
 {
-    SvxBrushItem aRetval(RES_BACKGROUND);
-
     const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem*  >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents)));
 
-    if(!pXFillStyleItem)
+    if(!pXFillStyleItem || XFILL_NONE == pXFillStyleItem->GetValue())
     {
-        return aRetval;
+        // need to rescue the evtl. set RGB color, but use as transparent color (we have XFILL_NONE)
+        Color aFillColor(static_cast< const XFillColorItem& >(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents)).GetColorValue());
+        aFillColor.SetTransparency(0xff);
+
+        return SvxBrushItem(aFillColor, RES_BACKGROUND);
     }
 
+    SvxBrushItem aRetval(RES_BACKGROUND);
+
     switch(pXFillStyleItem->GetValue())
     {
         case XFILL_NONE:
         {
-            // done; return default item
+            // already handled above, can not happen again
             break;
         }
         case XFILL_SOLID:
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 3bf159a..1bc89b4 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1770,6 +1770,64 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
                 bDone = true;
             }
 
+            switch(nMemberId)
+            {
+                case MID_NAME:
+                {
+                    //UUUU when named items get set, replace these with the NameOrIndex items
+                    // which exist already in the pool
+                    switch(pEntry->nWID)
+                    {
+                        case XATTR_FILLGRADIENT:
+                        case XATTR_FILLHATCH:
+                        case XATTR_FILLBITMAP:
+                        case XATTR_FILLFLOATTRANSPARENCE:
+                        {
+                            OUString aTempName;
+
+                            if(!(aValue >>= aTempName ))
+                            {
+                                throw lang::IllegalArgumentException();
+                            }
+
+                            bDone = SvxShape::SetFillAttribute(pEntry->nWID, aTempName, aSet);
+                            break;
+                        }
+                        default:
+                        {
+                            break;
+                        }
+                    }
+                    break;
+                }
+                case MID_GRAFURL:
+                {
+                    //UUUU Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
+                    switch(pEntry->nWID)
+                    {
+                        case XATTR_FILLBITMAP:
+                        {
+                            const Graphic aNullGraphic;
+                            XFillBitmapItem aXFillBitmapItem(aSet.GetPool(), aNullGraphic);
+
+                            aXFillBitmapItem.PutValue(aValue, nMemberId);
+                            aSet.Put(aXFillBitmapItem);
+                            bDone = true;
+                            break;
+                        }
+                        default:
+                        {
+                            break;
+                        }
+                    }
+                    break;
+                }
+                default:
+                {
+                    break;
+                }
+            }
+
             if(!bDone)
             {
                 m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
@@ -1836,7 +1894,9 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
                 throw lang::IllegalArgumentException();
             }
             else
+            {
                 pFmt->SetFmtAttr(aSet);
+            }
         }
     }
     else if(IsDescriptor())
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 3bd9cd8..b2fb907 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -337,6 +337,9 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
 #define ANCHOR_TYPES_PROPERTY    { OUString(UNO_NAME_ANCHOR_TYPES), FN_UNO_ANCHOR_TYPES,    cppu::UnoType< cppu::UnoSequenceType<css::text::TextContentAnchorType> >::get(),PropertyAttribute::READONLY, 0xff},
 
 // #i18732# #i28701# #i73249#
+//UUUU all users of COMMON_FRAME_PROPERTIES add the new XATTR_FILL_FIRST, XATTR_FILL_LAST FillStyle,
+// thus it may be possible to remove the RES_BACKGROUND entries from SvxBrushItem completely (this includes
+// all using UNO_NAME_BACK_* slots) in the future
 #define COMMON_FRAME_PROPERTIES \
     { OUString(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR,            cppu::UnoType<sal_Int16>::get(),           PROPERTY_NONE, MID_ANCHOR_PAGENUM       },              \
     { OUString(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR,           cppu::UnoType<css::text::TextContentAnchorType>::get(),            PROPERTY_NONE, MID_ANCHOR_ANCHORTYPE},             \
@@ -901,9 +904,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     cppu::UnoType<bool>::get(), PROPERTY_NONE, 0},
                     { OUString(UNO_NAME_TEXT_VERT_ADJUST), RES_TEXT_VERT_ADJUST, cppu::UnoType<css::drawing::TextVerticalAdjust>::get(), PROPERTY_NONE ,0},
 
-                    //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+                    //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
                     // but need own defines in Writer due to later association of strings
-                    // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+                    // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+                    // This entry is for adding that properties to style import/export
                     FILL_PROPERTIES_SW
 
                     { OUString(), 0, css::uno::Type(), 0, 0 }
@@ -1250,9 +1254,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_WIDTH_TYPE), RES_FRM_SIZE,          cppu::UnoType<sal_Int16>::get()  ,         PROPERTY_NONE,   MID_FRMSIZE_WIDTH_TYPE },
                     { OUString(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
 
-                    //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+                    //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
                     // but need own defines in Writer due to later association of strings
-                    // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+                    // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+                    // This entry is for adding that properties to FlyFrame import/export
                     FILL_PROPERTIES_SW
 
                     { OUString(), 0, css::uno::Type(), 0, 0 }
@@ -1263,7 +1268,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
             case PROPERTY_MAP_TEXT_GRAPHIC:
             {
                 static SfxItemPropertyMapEntry const aGraphicPropertyMap_Impl[] =
-                {
+                {   //UUUU
+                    // evtl. completely remove SvxBrushItem stuff ()
+                    // add support for XATTR_FILL_FIRST, XATTR_FILL_LAST
+                    // COMMON_FRAME_PROPERTIES currently hosts the RES_BACKGROUND entries from SvxBrushItem
                     COMMON_FRAME_PROPERTIES
                     { OUString(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND,            cppu::UnoType<bool>::get(),             PROPERTY_NONE, MID_SURROUND_CONTOUR         },
                     { OUString(UNO_NAME_CONTOUR_OUTSIDE), RES_SURROUND,             cppu::UnoType<bool>::get(),             PROPERTY_NONE, MID_SURROUND_CONTOUROUTSIDE  },
@@ -1289,6 +1297,13 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_GRAPHIC_IS_INVERTED), RES_GRFATR_INVERT,         cppu::UnoType<bool>::get(),    0,   0},
                     { OUString(UNO_NAME_TRANSPARENCY), RES_GRFATR_TRANSPARENCY, cppu::UnoType<sal_Int16>::get(),   0,   0},
                     { OUString(UNO_NAME_GRAPHIC_COLOR_MODE), RES_GRFATR_DRAWMODE,    cppu::UnoType<css::drawing::ColorMode>::get(),      0,   0},
+
+                    //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+                    // but need own defines in Writer due to later association of strings
+                    // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+                    // This entry is for adding that properties to Writer GraphicObject import/export
+                    FILL_PROPERTIES_SW
+
                     { OUString(), 0, css::uno::Type(), 0, 0 }
                 };
                 aMapEntriesArr[nPropertyId] = aGraphicPropertyMap_Impl;
@@ -1297,7 +1312,10 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
             case PROPERTY_MAP_EMBEDDED_OBJECT:
             {
                 static SfxItemPropertyMapEntry const aEmbeddedPropertyMap_Impl[] =
-                {
+                {   //UUUU
+                    // evtl. completely remove SvxBrushItem stuff ()
+                    // add support for XATTR_FILL_FIRST, XATTR_FILL_LAST
+                    // COMMON_FRAME_PROPERTIES currently hosts the RES_BACKGROUND entries from SvxBrushItem
                     COMMON_FRAME_PROPERTIES
                     { OUString(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_SURROUND_CONTOUR },
                     { OUString(UNO_NAME_CONTOUR_OUTSIDE), RES_SURROUND, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_SURROUND_CONTOUROUTSIDE},
@@ -1311,6 +1329,12 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), PropertyAttribute::MAYBEVOID, 0 },
                     { OUString(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, cppu::UnoType<css::lang::XComponent>::get(), PropertyAttribute::READONLY, 0},
                     { OUString(UNO_NAME_EMBEDDED_OBJECT),FN_EMBEDDED_OBJECT, cppu::UnoType<css::embed::XEmbeddedObject>::get(), PROPERTY_NONE, 0},
+                    //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx
+                    // but need own defines in Writer due to later association of strings
+                    // and uno types (see loop at end of this method and definition of SW_PROP_NMID)
+                    // This entry is for adding that properties to OLE/EmbeddedObject import/export
+                    FILL_PROPERTIES_SW
+
                     { OUString(), 0, css::uno::Type(), 0, 0 }
                 };
                 aMapEntriesArr[nPropertyId] = aEmbeddedPropertyMap_Impl;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 283692a..b3304e3 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1739,22 +1739,26 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
         }
         case RES_BACKGROUND:
         {
-            if (SFX_STYLE_FAMILY_FRAME == eFamily)
+            //UUUU No new FillStyle for PageBackground; need to remove again when we want
+            // to support that, too. Add a break to *not* set bDone to true
+            if(SFX_STYLE_FAMILY_PAGE == eFamily)
             {
-                //UUUU
-                SfxItemSet& rStyleSet = rBase.GetItemSet();
-                const SvxBrushItem aOriginalBrushItem(sw::getSvxBrushItemFromSourceSet(rStyleSet));
-                SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
+                break;
+            }
 
-                aChangedBrushItem.PutValue(aValue, nMemberId);
+            //UUUU
+            SfxItemSet& rStyleSet = rBase.GetItemSet();
+            const SvxBrushItem aOriginalBrushItem(sw::getSvxBrushItemFromSourceSet(rStyleSet));
+            SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
 
-                if(!(aChangedBrushItem == aOriginalBrushItem))
-                {
-                    sw::setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet);
-                }
+            aChangedBrushItem.PutValue(aValue, nMemberId);
 
-                bDone = true;
+            if(!(aChangedBrushItem == aOriginalBrushItem))
+            {
+                sw::setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet);
             }
+
+            bDone = true;
             break;
         }
         case OWN_ATTR_FILLBMP_MODE:
@@ -2498,19 +2502,23 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
             }
             case RES_BACKGROUND:
             {
-                if (SFX_STYLE_FAMILY_FRAME == eFamily)
+                //UUUU No new FillStyle for PageBackground; need to remove again when we want
+                // to support that, too. Add a break to *not* set bDone to true
+                if(SFX_STYLE_FAMILY_PAGE == eFamily)
                 {
-                    //UUUU
-                    const SfxItemSet& rSet = rBase.GetItemSet();
-                    const SvxBrushItem aOriginalBrushItem(sw::getSvxBrushItemFromSourceSet(rSet));
+                    break;
+                }
 
-                    if(!aOriginalBrushItem.QueryValue(aRet, nMemberId))
-                    {
-                        OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
-                    }
+                //UUUU
+                const SfxItemSet& rSet = rBase.GetItemSet();
+                const SvxBrushItem aOriginalBrushItem(sw::getSvxBrushItemFromSourceSet(rSet));
 
-                    bDone = true;
+                if(!aOriginalBrushItem.QueryValue(aRet, nMemberId))
+                {
+                    OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
                 }
+
+                bDone = true;
                 break;
             }
             case OWN_ATTR_FILLBMP_MODE:
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index c6b03ee..e37f384 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/drawing/XControlShape.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
 #include <xmloff/xmlimp.hxx>
 #include <xmloff/xmlnumi.hxx>
 #include <xmloff/xmlnmspe.hxx>
@@ -36,6 +37,7 @@
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::drawing;
 using ::xmloff::token::IsXMLToken;
 using ::xmloff::token::XML_TEXT_PROPERTIES;
 using ::xmloff::token::XML_GRAPHIC_PROPERTIES;
@@ -51,7 +53,8 @@ XMLShapeStyleContext::XMLShapeStyleContext(
     SvXMLStylesContext& rStyles,
     sal_uInt16 nFamily)
 :   XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ),
-    m_bIsNumRuleAlreadyConverted( false )
+    m_bIsNumRuleAlreadyConverted( false ),
+    m_bIsFillStyleAlreadyConverted( false ) //UUUU
 {
 }
 
@@ -183,6 +186,82 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
         }
     }
 
+    if(!m_bIsFillStyleAlreadyConverted && GetProperties().size())
+    {
+        const UniReference< XMLPropertySetMapper >&rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
+        ::std::vector< XMLPropertyState >& rProperties = GetProperties();
+        ::std::vector< XMLPropertyState >::iterator a;
+        FillStyle eFS(FillStyle_NONE);
+        static ::rtl::OUString s_FillStyle(RTL_CONSTASCII_USTRINGPARAM("FillStyle"));
+
+        // try to find a FillStyle entry and a value from it
+        for(a = rProperties.begin(); a != rProperties.end(); a++)
+        {
+            if(a->mnIndex != -1)
+            {
+                const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex);
+
+                if(rPropName == s_FillStyle)
+                {
+                    if(a->maValue >>= eFS)
+                    {
+                        // okay, type was good, eFS is set
+                    }
+                    else
+                    {
+                        // also try an int (see XFillStyleItem::PutValue)
+                        sal_Int32 nFS = 0;
+
+                        if(a->maValue >>= nFS)
+                        {
+                            eFS = (FillStyle)nFS;
+                        }
+                    }
+
+                    // exit loop, we found out what we needed to know
+                    break;
+                }
+            }
+        }
+
+        if(FillStyle_NONE != eFS)
+        {
+            //UUUU a FillStyle was found, thus the new [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
+            // description for the Fill definitions is used. All formally used props based
+            // on RES_BACKGROUND need to be deleted to get no conflicts between the two
+            // sets of properties; old files will keep these and adapt accordingly
+            static ::rtl::OUString s_BackColorRGB(RTL_CONSTASCII_USTRINGPARAM("BackColorRGB"));
+            static ::rtl::OUString s_BackTransparent(RTL_CONSTASCII_USTRINGPARAM("BackTransparent"));
+            static ::rtl::OUString s_BackColorTransparency(RTL_CONSTASCII_USTRINGPARAM("BackColorTransparency"));
+            static ::rtl::OUString s_BackGraphicURL(RTL_CONSTASCII_USTRINGPARAM("BackGraphicURL"));
+            static ::rtl::OUString s_BackGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("BackGraphicFilter"));
+            static ::rtl::OUString s_BackGraphicLocation(RTL_CONSTASCII_USTRINGPARAM("BackGraphicLocation"));
+            static ::rtl::OUString s_BackGraphicTransparency(RTL_CONSTASCII_USTRINGPARAM("BackGraphicTransparency"));
+
+            for(a = rProperties.begin(); a != rProperties.end(); a++)
+            {
+                if(a->mnIndex != -1)
+                {
+                    const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex);
+
+                    if(s_BackColorRGB == rPropName
+                        || s_BackTransparent == rPropName
+                        || s_BackColorTransparency == rPropName
+                        || s_BackGraphicURL == rPropName
+                        || s_BackGraphicFilter == rPropName
+                        || s_BackGraphicLocation == rPropName
+                        || s_BackGraphicTransparency== rPropName)
+                    {
+                        // mark entry as inactive
+                        a->mnIndex = -1;
+                    }
+                }
+            }
+        }
+
+        m_bIsFillStyleAlreadyConverted = sal_True;
+    }
+
     struct _ContextID_Index_Pair aContextIDs[] =
     {
         { CTF_DASHNAME , -1 },
commit ad2dc3226db1aa2283d9d141473712d85a3e43d2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 13:57:05 2014 +0300

    Filter out extra ICU data for locales we don't want special support for
    
    Change-Id: I40fd00d91a7e5ad5163bef63e1b60381bac58aa4

diff --git a/i18npool/CustomTarget_breakiterator.mk b/i18npool/CustomTarget_breakiterator.mk
index fb7f0d9..ce8a038 100644
--- a/i18npool/CustomTarget_breakiterator.mk
+++ b/i18npool/CustomTarget_breakiterator.mk
@@ -38,19 +38,26 @@ $(i18npool_BIDIR)/dict_%.cxx : \
 
 endif
 
+# Do we want the char_in.brk data? It's for languages in India (and bn_BD)
+ifeq ($(WITH_LOCALES),)
+i18npool_breakiterator_want_in=TRUE
+else ifneq ($(filter bn bn_% gu gu_% hi hi_% kn kn_% ml ml_% or or_% pa pa_% ta ta_% te te_%,$(WITH_LOCALES)),)
+i18npool_breakiterator_want_in=TRUE
+endif
+
 i18npool_BRKTXTS := \
-    char_in.brk \
+    $(if $(i18npool_breakiterator_want_in),char_in.brk) \
     char.brk \
-    count_word_fi.brk \
+    $(call gb_Helper_optional_locale,fi,count_word_fi.brk) \
     count_word.brk \
-    dict_word_fi.brk \
-    dict_word_he.brk \
-    dict_word_hu.brk \
+    $(call gb_Helper_optional_locale,fi,dict_word_fi.brk) \
+    $(call gb_Helper_optional_locale,he,dict_word_he.brk) \
+    $(call gb_Helper_optional_locale,hu,dict_word_hu.brk) \
     dict_word_nodash.brk \
     dict_word_prepostdash.brk \
     dict_word.brk \
-    edit_word_he.brk \
-    edit_word_hu.brk \
+    $(call gb_Helper_optional_locale,he,edit_word_he.brk) \
+    $(call gb_Helper_optional_locale,hu,edit_word_hu.brk) \
     edit_word.brk \
     line.brk \
     sent.brk
commit 6ad958a1cab94a6a1f79c057788816da8505c8f9
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Fri Apr 25 12:49:12 2014 +0200

    Since bPut is bool, let's use true/false
    
    Change-Id: I37b05b3d62eda03aecfa253bfc729136a777c6eb

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index d06a4be..76b3e33 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -708,7 +708,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
 
     if (   SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxWhich,     false ))
     {
-        bPut = aBoxItem != (const SvxBoxItem&)(rOldSet.Get(nBoxWhich)) ? sal_True : sal_False;
+        bPut = aBoxItem != (const SvxBoxItem&)(rOldSet.Get(nBoxWhich)) ? true : false;
     }
     if(  SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxInfoWhich, false ) )
     {
commit 54ec98e37d179674193176f87dcbeeb7d00b55b7
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Apr 25 11:12:12 2014 +0100

    we need to push a return value in any case, fdo#73148 related
    
    ... not just if there is no error; popping a value from the stack also
    pops an error value, and the error is pushed again instead of the value
    to be pushed, see call of IfErrorPushError() in PushDouble().
    
    Change-Id: I92f486fa226c90870990f608cd43d4a1379a2361

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a7440f4..b2a77b2 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6703,8 +6703,7 @@ void ScInterpreter::ScAggregate()
         // Get rid of the 1st and 2nd (fished) parameters.
         Pop();
         Pop();
-        if ( !nGlobalError )
-            PushDouble( nVal );
+        PushDouble( nVal );
     }
 }
 
commit 0f68293a83b1734f323e09d55f2c803df5b985f3
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Apr 25 10:55:12 2014 +0100

    return early once we pushed an error, fdo#73148 related
    
    Change-Id: Iadc520fe897966bf41c793ae37f510addfd68cef

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 4b6140a..a7440f4 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6663,7 +6663,7 @@ void ScInterpreter::ScAggregate()
                     break;
                 default :
                     PushIllegalArgument();
-                    break;
+                    return;
             }
             // TODO: implement filter options
             if ( nAggrFlags != 0x00 )
commit e41ea8dd4b61652ce189608e14ecefd15e89a546
Author: László Németh <nemeth at numbertext.org>
Date:   Fri Apr 25 12:09:52 2014 +0200

    fdo#48017 fix WIN32 long path name support of spelling dictionaries
    
    Change-Id: I1ccaae9dba4f82cd50531890e159519a765a0fff

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk b/external/hunspell/UnpackedTarball_hunspell.mk
index 8c23f03..730a6ce 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
 	external/hunspell/hunspell-1.3.2-compound.patch \
 	external/hunspell/hunspell.rhbz918938.patch \
 	external/hunspell/hunspell-wundef.patch.1 \
+	external/hunspell/hunspell-fdo48017-wfopen.patch \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch b/external/hunspell/hunspell-fdo48017-wfopen.patch
new file mode 100644
index 0000000..a2782e0
--- /dev/null
+++ b/external/hunspell/hunspell-fdo48017-wfopen.patch
@@ -0,0 +1,109 @@
+diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
+--- hunspell/src/hunspell/csutil.cxx	2011-02-02 11:35:43.000000000 +0100
++++ build/hunspell/src/hunspell/csutil.cxx	2014-04-24 19:42:01.373285409 +0200
+@@ -17,6 +17,10 @@
+   unsigned short clower;
+ };
+ 
++#ifdef _WIN32
++#include <wchar.h>
++#endif
++
+ #ifdef OPENOFFICEORG
+ #  include <unicode/uchar.h>
+ #else
+@@ -46,6 +50,21 @@
+ static struct unicode_info2 * utf_tbl = NULL;
+ static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances
+ 
++FILE * myfopen(const char * path, const char * mode) {
++#ifdef _WIN32
++#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
++    if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
++        int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
++        wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
++        MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
++        FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++        free(buff);
++        return f;
++    }
++#endif
++    return fopen(path, mode);
++}
++
+ /* only UTF-16 (BMP) implementation */
+ char * u16_u8(char * dest, int size, const w_char * src, int srclen) {
+     signed char * u8 = (signed char *)dest;
+diff -ru hunspell/src/hunspell/csutil.hxx build/hunspell/src/hunspell/csutil.hxx
+--- hunspell/src/hunspell/csutil.hxx	2010-09-06 09:58:53.000000000 +0200
++++ build/hunspell/src/hunspell/csutil.hxx	2014-04-24 19:42:01.373285409 +0200
+@@ -52,6 +52,9 @@
+ #define FORBIDDENWORD  65510
+ #define ONLYUPCASEFLAG 65511
+ 
++// fopen or optional _wfopen to fix long pathname problem of WIN32
++LIBHUNSPELL_DLL_EXPORTED FILE * myfopen(const char * path, const char * mode);
++
+ // convert UTF-16 characters to UTF-8
+ LIBHUNSPELL_DLL_EXPORTED char * u16_u8(char * dest, int size, const w_char * src, int srclen);
+ 
+diff -ru hunspell/src/hunspell/dictmgr.cxx build/hunspell/src/hunspell/dictmgr.cxx
+--- hunspell/src/hunspell/dictmgr.cxx	2010-06-02 21:33:59.000000000 +0200
++++ build/hunspell/src/hunspell/dictmgr.cxx	2014-04-24 19:42:01.381285408 +0200
+@@ -5,6 +5,7 @@
+ #include <stdio.h>
+ 
+ #include "dictmgr.hxx"
++#include "csutil.hxx"
+ 
+ DictMgr::DictMgr(const char * dictpath, const char * etype) : numdict(0)
+ {
+@@ -57,7 +58,7 @@
+ 
+     // open the dictionary list file
+     FILE * dictlst;
+-    dictlst = fopen(dictpath,"r");
++    dictlst = myfopen(dictpath,"r");
+     if (!dictlst) {
+       return 1;
+     }
+diff -ru hunspell/src/hunspell/filemgr.cxx build/hunspell/src/hunspell/filemgr.cxx
+--- hunspell/src/hunspell/filemgr.cxx	2010-04-14 11:42:03.000000000 +0200
++++ build/hunspell/src/hunspell/filemgr.cxx	2014-04-25 00:44:05.049789586 +0200
+@@ -6,6 +6,7 @@
+ #include <stdio.h>
+ 
+ #include "filemgr.hxx"
++#include "csutil.hxx"
+ 
+ int FileMgr::fail(const char * err, const char * par) {
+     fprintf(stderr, err, par);
+@@ -15,7 +16,7 @@
+ FileMgr::FileMgr(const char * file, const char * key) {
+     linenum = 0;
+     hin = NULL;
+-    fin = fopen(file, "r");
++    fin = myfopen(file, "r");
+     if (!fin) {
+         // check hzipped file
+         char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1);
+diff -ru hunspell/src/hunspell/hunzip.cxx build/hunspell/src/hunspell/hunzip.cxx
+--- hunspell/src/hunspell/hunzip.cxx	2010-04-27 16:07:14.000000000 +0200
++++ build/hunspell/src/hunspell/hunzip.cxx	2014-04-24 19:42:01.381285408 +0200
+@@ -3,6 +3,7 @@
+ #include <stdio.h> 
+ 
+ #include "hunzip.hxx"
++#include "csutil.hxx"
+ 
+ #define CODELEN  65536
+ #define BASEBITREC 5000
+@@ -38,7 +38,7 @@
+ 
+     if (!filename) return -1;
+ 
+-    fin = fopen(filename, "rb");
++    fin = myfopen(filename, "rb");
+     if (!fin) return -1;
+ 
+     // read magic number
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 1622e1d..a58885b 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -300,16 +300,17 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL
                     OUString aff;
                     osl::FileBase::getSystemPathFromFileURL(dicpath,dict);
                     osl::FileBase::getSystemPathFromFileURL(affpath,aff);
-                    OString aTmpaff(OU2ENC(aff,osl_getThreadTextEncoding()));
-                    OString aTmpdict(OU2ENC(dict,osl_getThreadTextEncoding()));
-
 #if defined(WNT)
                     // workaround for Windows specific problem that the
                     // path length in calls to 'fopen' is limted to somewhat
                     // about 120+ characters which will usually be exceed when
-                    // using dictionaries as extensions.
-                    aTmpaff = Win_GetShortPathName( aff );
-                    aTmpdict = Win_GetShortPathName( dict );
+                    // using dictionaries as extensions. (Hunspell waits UTF-8 encoded
+                    // path with \\?\ long path prefix.)
+                    OString aTmpaff = OUStringToOString(aff, RTL_TEXTENCODING_UTF8));
+                    OString aTmpdict = OUStringToOString(dict, RTL_TEXTENCODING_UTF8));
+#else
+                    OString aTmpaff(OU2ENC(aff,osl_getThreadTextEncoding()));
+                    OString aTmpdict(OU2ENC(dict,osl_getThreadTextEncoding()));
 #endif
 
                     aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr());
commit b6a0a2e7cc9578257ad0cf80f818a7a12def1e46
Author: Michaël Lefèvre <lefevre00 at yahoo.fr>
Date:   Mon Apr 7 15:33:26 2014 +0200

    fdo#43157 : [API CHANGE] Remove OSL_THIS_FILE
    
    Change-Id: Ifa6bdb2f2bdf96826f09c42a1e36d97ed6e034cd
    Reviewed-on: https://gerrit.libreoffice.org/8886
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/osl/diagnose.h b/include/osl/diagnose.h
index e64160c..fdae8cc 100644
--- a/include/osl/diagnose.h
+++ b/include/osl/diagnose.h
@@ -87,8 +87,6 @@
 #define OSL_DEBUG_LEVEL 0
 #endif
 
-#define OSL_THIS_FILE       __FILE__
-
 /* the macro OSL_LOG_PREFIX is intended to be an office internal macro for now
 
    it is deprecated and superseded by (C++ only) SAL_WHERE
diff --git a/registry/test/regdiagnose.h b/registry/test/regdiagnose.h
index 1ac6e92..69aa1b1 100644
--- a/registry/test/regdiagnose.h
+++ b/registry/test/regdiagnose.h
@@ -23,7 +23,7 @@
 
 #include <osl/diagnose.h>
 
-#define REG_ENSURE(c, m)   _REG_ENSURE(c, OSL_THIS_FILE, __LINE__, m)
+#define REG_ENSURE(c, m)   _REG_ENSURE(c, __FILE__, __LINE__, m)
 
 #define _REG_ENSURE(c, f, l, m) \
     do \
commit a184afe3b6b563ff6ea4bc55f4bc386b6484c4fb
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 12:50:27 2014 +0300

    Add css_comp_chart2_ChartDocumentWrapper_get_implementation
    
    At least with my test documents, this is the only component we now need
    from the chartcontroller library.
    
    Change-Id: Ia2c203413a585f4d9207bb22fa5f548eda3fb9a8

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 309a3c0..c2917c40 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -50,6 +50,8 @@ core_factory_list = [
     ]
 
 core_constructor_list = [
+# chart2/source/controller/chartcontroller.component
+    "com_sun_star_comp_chart2_ChartDocumentWrapper_get_implementation",
 # framework/util/fwk.component
     "com_sun_star_comp_framework_AutoRecovery_get_implementation",
     "com_sun_star_comp_framework_Desktop_get_implementation",
commit 023c6959facb84b4e6006099a57a6db9e3ca10c8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 12:14:49 2014 +0300

    Drop libchartcontrollerlo.a in preparation for vmiklos's rework
    
    Change-Id: Ic8ce9b91e666774eff7e452ec9f07c6053dce03b

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index f29a7879..309a3c0 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -20,7 +20,6 @@ core_factory_list = [
     ("libembobj.a", "embobj_component_getFactory"),
     ("libreflectionlo.a", "reflection_component_getFactory"),
     ("libstocserviceslo.a", "stocservices_component_getFactory"),
-    ("libchartcontrollerlo.a", "chartcontroller_component_getFactory"),
     ("libchartcorelo.a", "chartcore_component_getFactory"),
     ("libcomphelper.a", "comphelp_component_getFactory"),
     ("libconfigmgrlo.a", "configmgr_component_getFactory"),
commit 26be67d0ff9a9fe1d6a840812e14379b5a89cd00
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 12:12:22 2014 +0300

    Print the important failure messages on iOS even in a non-debug build
    
    It might be that having fprintfs leftover in an app submitted to the
    App Store is a no-go, but will fix that then if/when it happens.
    
    Change-Id: Ic671fcce567c655a06fd4ed139100dc9b6f435be

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 9218581..debbdb0 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -197,6 +197,10 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
         }
         if (fp == 0) {
             SAL_WARN("cppuhelper", "unknown factory name \"" << name << "\"");
+#if defined IOS && !defined SAL_LOG_WARN
+            // If the above SAL_WARN expanded to nothing, print to stderr...

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list