n#325936 fix ww8 export of fly frames with transparent background in headers

Regression from commit ed8b5f2d -- to be safe, reverted only for fly
frames in headers.

Change-Id: Ia538b69bb913567c7d087d40afc7f0a141b7a0ed
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index e47d881..d4d7801 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -77,6 +77,7 @@
#include <frmfmt.hxx>
#include <flyfrm.hxx>
#include <pagefrm.hxx>
#include <frmatr.hxx>
#include <fmtcntnt.hxx>
#include <ndindex.hxx>
#include <doc.hxx>
@@ -1763,16 +1764,24 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
        rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
    }

    SvxBrushItem aBrush(rWrt.TrueFrameBgBrush(rFmt));
    WriteBrushAttr(aBrush, rPropOpt);

    const SdrObject* pObj = rFmt.FindRealSdrObject();

    // SwWW8ImplReader::Read_GrafLayer() imports these as opaque
    // unconditionally, so if both are true, don't export the property.
    bool bIsInHeader = lcl_isInHeader(rFmt);
    bool bIsThrought = rFmt.GetSurround().GetValue() == SURROUND_THROUGHT;

    if (bIsInHeader)
    {
        const SvxBrushItem& rBrush(rFmt.GetBackground());
        WriteBrushAttr(rBrush, rPropOpt);
    }
    else
    {
        SvxBrushItem aBrush(rWrt.TrueFrameBgBrush(rFmt));
        WriteBrushAttr(aBrush, rPropOpt);
    }

    const SdrObject* pObj = rFmt.FindRealSdrObject();

    if( pObj && (pObj->GetLayer() == GetHellLayerId() ||
        pObj->GetLayer() == GetInvisibleHellId() ) && !(bIsInHeader && bIsThrought))
    {