sw/source/filter/ww8/rtfattributeoutput.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 6931d41640e31db4f1ad07afb48ec4df7086f6bb
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Feb 26 15:28:10 2024 -0500
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Feb 27 08:45:44 2024 +0100

    address nit: use boolean flag instead of minor copy/paste
    
    Change-Id: I380ca73047fecefd9b7ff508eb6f8bf8202b1b62
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163969
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 0f2885068d12..36bb03149c06 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3760,13 +3760,11 @@ void RtfAttributeOutput::FormatFillGradient(const 
XFillGradientItem& rFillGradie
             std::make_pair<OString, OString>("fillAngle"_ostr, 
OString::number(nAngle)));
     }
 
+    bool bIsSymmetrical = true;
     if (rColorStops.size() < 3)
     {
-        if (rGradient.GetGradientStyle() == awt::GradientStyle_AXIAL)
-        {
-            m_aFlyProperties.push_back(
-                std::make_pair<OString, OString>("fillFocus"_ostr, 
OString::number(50)));
-        }
+        if (rGradient.GetGradientStyle() != awt::GradientStyle_AXIAL)
+            bIsSymmetrical = false;
     }
     else
     {
@@ -3774,15 +3772,18 @@ void RtfAttributeOutput::FormatFillGradient(const 
XFillGradientItem& rFillGradie
         // FillModel::pushToPropMap 'fFocus' value and usage.
         // The 2nd color is the in-between color, use it
         aMSOEndColor = Color(rColorStops[1].getStopColor());
-
-        m_aFlyProperties.push_back(
-            std::make_pair<OString, OString>("fillFocus"_ostr, 
OString::number(50)));
     }
 
     m_aFlyProperties.push_back(std::make_pair<OString, OString>(
         "fillColor"_ostr, 
OString::number(wwUtility::RGBToBGR(aMSOStartColor))));
     m_aFlyProperties.push_back(std::make_pair<OString, OString>(
         "fillBackColor"_ostr, 
OString::number(wwUtility::RGBToBGR(aMSOEndColor))));
+
+    if (bIsSymmetrical)
+    {
+        m_aFlyProperties.push_back(
+            std::make_pair<OString, OString>("fillFocus"_ostr, 
OString::number(50)));
+    }
 }
 
 void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)

Reply via email to