tdf#125628: FORMATTING: Part of text loose yellow highlight reopening document

Change-Id: Id42c33857537451c2dec17d24f65b10f9c16dfa2
Reviewed-on: https://gerrit.libreoffice.org/77135
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 0397d1a..f246d78 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -1130,9 +1130,8 @@ void XMLTextExportPropertySetMapper::ContextFilter(
        pClip11State->mnIndex = -1;

    // When both background attributes are available export the visible one
    if( pCharHighlight && pCharBackground )
    if (pCharHighlight)
    {
        assert(pCharBackgroundTransparency); // always together
        Color nColor = COL_TRANSPARENT;
        pCharHighlight->maValue >>= nColor;
        if( nColor == COL_TRANSPARENT )
@@ -1141,8 +1140,10 @@ void XMLTextExportPropertySetMapper::ContextFilter(
            // and we'd need another property CharHighlightTransparent for that
            pCharHighlight->mnIndex = -1;
        }
        else
        // When both background attributes are available export the visible one
        else if(pCharBackground)
        {
            assert(pCharBackgroundTransparency); // always together
            pCharBackground->mnIndex = -1;
            pCharBackgroundTransparency->mnIndex = -1;
        }