sc/qa/unit/data/xlsx/tdf66377.xlsx |binary sc/qa/unit/subsequent_filters_test2.cxx | 15 +++++++++++++++ sc/source/filter/oox/stylesbuffer.cxx | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-)
New commits: commit 10d52f40f8440dd3e97877a1ff71817f0d9ea5c5 Author: Balazs Varga <[email protected]> AuthorDate: Thu Feb 12 19:52:46 2026 +0100 Commit: Balazs Varga <[email protected]> CommitDate: Tue Feb 17 09:21:52 2026 +0100 tdf#66377 sc ooxml import: fix wrongly applied PatternType attribute XML_None: "The fill style is none (no fill). When foreground and/or background colors are specified, a pattern of 'none' overrides and means the cell has no fill." Based on the ooxml standard no fill should be applied, not even a transparent white color. Change-Id: I0a7293dd9fb279051b7ce41149fbbdb3ac98d7e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199302 Reviewed-by: Balazs Varga <[email protected]> Tested-by: Jenkins diff --git a/sc/qa/unit/data/xlsx/tdf66377.xlsx b/sc/qa/unit/data/xlsx/tdf66377.xlsx new file mode 100644 index 000000000000..97f48b093c64 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf66377.xlsx differ diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 6c81cbad9fb5..1f591c73cd67 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -1744,6 +1744,21 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBackColorFilter) } } +CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf66377) +{ + createScDoc("xlsx/tdf66377.xlsx"); + + ScDocument* pDoc = getScDoc(); + const ScPatternAttr* pAttr = pDoc->GetPattern(2, 2, 0); + CPPUNIT_ASSERT(pAttr); + const SvxBrushItem* pExplicitBackground = pAttr->GetItemSet().GetItemIfSet(ATTR_BACKGROUND); + CPPUNIT_ASSERT(!pExplicitBackground); + // Without the fix in place it would not have fail and + // we would have a transparent white color set + /*const Color& rColor = pExplicitBackground->GetColor(); + CPPUNIT_ASSERT_EQUAL(Color(COL_TRANSPARENT), rColor);*/ +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 7189a5688bc8..83a34f5dc41a 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2037,8 +2037,8 @@ void Fill::finalizeImport() maApiData.mbUsed = rModel.mbPatternUsed; if( rModel.mnPattern == XML_none ) { - maApiData.mnColor = API_RGB_TRANSPARENT; - maApiData.mbTransparent = true; + // XML_none should not apply any color + maApiData.mbUsed = false; } else {
