oox/source/export/drawingml.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
New commits: commit 4272cdfc24660a59bea171bd14a13996f8b17127 Author: Mike Kaganski <[email protected]> AuthorDate: Thu Oct 9 12:25:09 2025 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Oct 10 09:34:30 2025 +0200 Related: tdf#80224 A blind attempt to fix conditions ... introduced in commit 43679f94b45f4d9e120c64a3fb5cc3ee77f12b11 (Fix tdf#80224 Custom text color changed to black on .PPTX export, 2015-08-25). Those conditions, presumably, intended to use GetProperty in the non-bCheckDirect case. But the implementation effectively made the bCheckDirect case also call GetProperty, when state check fails, which, in the end, has the same effect, as calling GetProperty in all cases. I attempted to fix it like this: bCheckDirect ? GetDirectProperty(rXPropSet, rXPropState, u"Foo"_ustr) : GetProperty(rXPropSet, u"Foo"_ustr) but it failed CppunitTest_chart2_export3 then: Test name: testFormattedChartTitles::TestBody equality assertion failed - Expected: 1 - Actual : 0 - In <>, XPath '/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[5]/a:rPr/a:uFillTx' number of nodes is incorrect So this just simplifies the calls to what they effectively did all this time. There is no failing document; I found this accidentally, reading the code. Change-Id: I6581c23e395a74140daa30a06cdca27b57f4e6a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192111 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 45e237a2df68..2ae2c3e2d5fd 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2552,8 +2552,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool break; } - if ((bCheckDirect && GetDirectProperty(rXPropSet, rXPropState, u"CharUnderline"_ustr)) - || GetProperty(rXPropSet, u"CharUnderline"_ustr)) + if (GetProperty(rXPropSet, u"CharUnderline"_ustr)) { switch ( *o3tl::doAccess<sal_Int16>(mAny) ) { @@ -2611,8 +2610,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } } - if ((bCheckDirect && GetDirectProperty(rXPropSet, rXPropState, u"CharStrikeout"_ustr)) - || GetProperty(rXPropSet, u"CharStrikeout"_ustr)) + if (GetProperty(rXPropSet, u"CharStrikeout"_ustr)) { switch ( *o3tl::doAccess<sal_Int16>(mAny) ) { @@ -2722,8 +2720,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool else { // mso doesn't like text color to be placed after typeface - if ((bCheckDirect && GetDirectProperty(rXPropSet, rXPropState, u"CharColor"_ustr)) - || GetProperty(rXPropSet, u"CharColor"_ustr)) + if (GetProperty(rXPropSet, u"CharColor"_ustr)) { ::Color color( ColorTransparency, *o3tl::doAccess<sal_uInt32>(mAny) ); SAL_INFO("oox.shape", "run color: " << sal_uInt32(color) << " auto: " << sal_uInt32(COL_AUTO)); @@ -2815,8 +2812,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } if (underline - && ((bCheckDirect && GetDirectProperty(rXPropSet, rXPropState, u"CharUnderlineColor"_ustr)) - || GetProperty(rXPropSet, u"CharUnderlineColor"_ustr))) + && (GetProperty(rXPropSet, u"CharUnderlineColor"_ustr))) { ::Color color(ColorTransparency, *o3tl::doAccess<sal_uInt32>(mAny)); // if color is automatic, then we shouldn't write information about color but to take color from character
