sc/qa/unit/tiledrendering/SheetViewTest.cxx | 66 +++++++++++++++++++++++ sc/source/ui/inc/operation/FillAutoOperation.hxx | 1 sc/source/ui/operation/FillAutoOperation.cxx | 28 +++++---- sd/source/filter/eppt/pptx-epptooxml.cxx | 37 ------------ 4 files changed, 85 insertions(+), 47 deletions(-)
New commits: commit acadc2b21a7d9caf023498ba0e4475f4c8853fc1 Author: Marco Cecchetti <[email protected]> AuthorDate: Sun Feb 8 20:58:29 2026 +0100 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Tue Mar 10 14:35:13 2026 +0100 fix pptx font embedding issues - file size too big since Noto CJK included even if not used - PowerPoint warning on opening document: not possible to install Noto CJK Change-Id: I0459d0acc00c49a9cb1bb98b24bd8911d9fde92b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201065 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 5657803cf386..38a9b1b63bdb 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -616,26 +616,6 @@ private: std::vector<editeng::Section> aSections; rEditText.GetAllSections(aSections); - { - SfxStyleSheet* pStyleSheet = pTextObject->getSdrPageFromSdrObject()->GetTextStyleSheetForObject(pTextObject); - if (pStyleSheet) - { - auto aItemSet = pStyleSheet->GetItemSet(); - if (const SvxFontItem* pItem = aItemSet.GetItemIfSet(EE_CHAR_FONTINFO, false)) - { - addFontItem(pItem); - } - if (const SvxFontItem* pItem = aItemSet.GetItemIfSet(EE_CHAR_FONTINFO_CJK, false)) - { - addFontItem(pItem); - } - if (const SvxFontItem* pItem = aItemSet.GetItemIfSet(EE_CHAR_FONTINFO_CTL, false)) - { - addFontItem(pItem); - } - } - } - for (editeng::Section const& rSection : aSections) { if (SvxFontItem const* pFontItem = getFontItem(rSection, EE_CHAR_FONTINFO); pFontItem && mbEmbedLatinScript) @@ -665,23 +645,8 @@ protected: void handleSdrObject(SdrObject* pObject) override { SdrTextObj* pTextShape = DynCastSdrTextObj(pObject); - if (pTextShape) + if (pTextShape && !pTextShape->IsEmptyPresObj()) { - auto& rItemSet = pTextShape->GetMergedItemSet(); - - if (SvxFontItem const* pFontItem = rItemSet.GetItemIfSet(EE_CHAR_FONTINFO, true); pFontItem && mbEmbedLatinScript) - { - addFontItem(pFontItem); - } - if (SvxFontItem const* pFontItem = rItemSet.GetItemIfSet(EE_CHAR_FONTINFO_CJK, true); pFontItem && mbEmbedAsianScript) - { - addFontItem(pFontItem); - } - if (SvxFontItem const* pFontItem = rItemSet.GetItemIfSet(EE_CHAR_FONTINFO_CTL, true); pFontItem && mbEmbedComplexScript) - { - addFontItem(pFontItem); - } - traverseEditEng(pTextShape); } } commit fb28dbf05a1b8fad2e3362602bb240b2a25e9922 Author: Tomaž Vajngerl <[email protected]> AuthorDate: Sat Mar 7 01:46:02 2026 +0000 Commit: Miklos Vajna <[email protected]> CommitDate: Tue Mar 10 14:35:11 2026 +0100 sc: Add sheet view sync to FillAutoOperation, test case This adds a test case that checks the FillAutoOperation is syncing correctly, and adds the sheet view syncing to FillAutoOperation. Similar to FillSimpleOperation this one can't be run on the sheet view if the input intersects with the auto filter. Change-Id: I927698263b53d48265c2e56dece0a64b9f1ce8a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201327 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sc/qa/unit/tiledrendering/SheetViewTest.cxx b/sc/qa/unit/tiledrendering/SheetViewTest.cxx index 9c698df64f74..be1c5debb391 100644 --- a/sc/qa/unit/tiledrendering/SheetViewTest.cxx +++ b/sc/qa/unit/tiledrendering/SheetViewTest.cxx @@ -2093,6 +2093,72 @@ CPPUNIT_TEST_FIXTURE(SyncTest, testSync_FillSeries_DefaultAndSheetView) } } +CPPUNIT_TEST_FIXTURE(SyncTest, testSync_FillAuto_DefaultAndSheetView) +{ + ScModelObj* pModelObj = createDoc("SheetView_AutoFilter.ods"); + pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>()); + ScDocShell* pDocShell = dynamic_cast<ScDocShell*>(pModelObj->GetEmbeddedObject()); + + setupViews(); + + // Create new sheet view and sort autofilter ascending + { + switchToSheetView(); + createNewSheetViewInCurrentView(); + sortAscendingForCell(u"A1"); + } + + // Sort autofilter descending in default view + { + switchToDefaultView(); + sortDescendingForCell(u"A1"); + } + + // Switch to sheet view and fill auto + { + switchToSheetView(); + + // Current state default view + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"7", u"5", u"4", u"3" }), + getValues(mpTabViewDefaultView, 0, 1, 4)); + + // Current state sheet view + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"3", u"4", u"5", u"7" }), + getValues(mpTabViewSheetView, 0, 1, 4)); + + // FillAuto source A2:A3 on default view (index 0), FILL_TO_BOTTOM, nCount=2 + // Source: 7, 5 (step -2), fills A4:A5 with 3, 1 + ScRange aFillRange(0, 1, 0, 0, 2, 0); + pDocShell->GetDocFunc().FillAuto(aFillRange, nullptr, FILL_TO_BOTTOM, FILL_AUTO, FILL_DAY, + 2, 1.0, 100.0, true, true); + + // Default view: 7, 5, 3, 1 + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"7", u"5", u"3", u"1" }), + getValues(mpTabViewDefaultView, 0, 1, 4)); + + // Sheet view: synced and re-sorted + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"1", u"3", u"5", u"7" }), + getValues(mpTabViewSheetView, 0, 1, 4)); + } + + // Try to FillAuto on the sheet view — should be blocked because it intersects autofilter + { + switchToSheetView(); + + SCTAB nSheetViewTab = mpTabViewSheetView->GetViewData().GetTabNumber(); + ScRange aFillRange(0, 1, nSheetViewTab, 0, 2, nSheetViewTab); + bool bResult = pDocShell->GetDocFunc().FillAuto( + aFillRange, nullptr, FILL_TO_BOTTOM, FILL_AUTO, FILL_DAY, 2, 1.0, 100.0, true, true); + CPPUNIT_ASSERT(!bResult); + + // Values should remain unchanged + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"7", u"5", u"3", u"1" }), + getValues(mpTabViewDefaultView, 0, 1, 4)); + CPPUNIT_ASSERT_EQUAL(expectedValues({ u"1", u"3", u"5", u"7" }), + getValues(mpTabViewSheetView, 0, 1, 4)); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/operation/FillAutoOperation.hxx b/sc/source/ui/inc/operation/FillAutoOperation.hxx index 39986553cbf8..9d26e23b4870 100644 --- a/sc/source/ui/inc/operation/FillAutoOperation.hxx +++ b/sc/source/ui/inc/operation/FillAutoOperation.hxx @@ -35,6 +35,7 @@ private: double mfStep; double mfMax; + bool canRunTheOperation() const override; bool runImplementation() override; public: diff --git a/sc/source/ui/operation/FillAutoOperation.cxx b/sc/source/ui/operation/FillAutoOperation.cxx index 76b61432b37c..0e871eca4e92 100644 --- a/sc/source/ui/operation/FillAutoOperation.cxx +++ b/sc/source/ui/operation/FillAutoOperation.cxx @@ -44,17 +44,24 @@ FillAutoOperation::FillAutoOperation(ScDocFunc& rDocFunc, ScDocShell& rDocShell, { } +bool FillAutoOperation::canRunTheOperation() const +{ + return !isInputOnSheetViewAutoFilter(mrRange); +} + bool FillAutoOperation::runImplementation() { ScDocShellModificator aModificator(mrDocShell); ScDocument& rDoc = mrDocShell.GetDocument(); - SCCOL nStartCol = mrRange.aStart.Col(); - SCROW nStartRow = mrRange.aStart.Row(); - SCTAB nStartTab = mrRange.aStart.Tab(); - SCCOL nEndCol = mrRange.aEnd.Col(); - SCROW nEndRow = mrRange.aEnd.Row(); - SCTAB nEndTab = mrRange.aEnd.Tab(); + + ScRange aRange = convertRange(mrRange); + SCCOL nStartCol = aRange.aStart.Col(); + SCROW nStartRow = aRange.aStart.Row(); + SCTAB nStartTab = aRange.aStart.Tab(); + SCCOL nEndCol = aRange.aEnd.Col(); + SCROW nEndRow = aRange.aEnd.Row(); + SCTAB nEndTab = aRange.aEnd.Tab(); if (mbRecord && !rDoc.IsUndoEnabled()) mbRecord = false; @@ -68,8 +75,8 @@ bool FillAutoOperation::runImplementation() aMark.SelectTable(nTab, true); } - ScRange aSourceArea = mrRange; - ScRange aDestArea = mrRange; + ScRange aSourceArea = aRange; + ScRange aDestArea = aRange; switch (meDir) { @@ -102,9 +109,6 @@ bool FillAutoOperation::runImplementation() break; } - if (!checkSheetViewProtection()) - return false; - // Test for cell protection //! Source range can be protected !!! //! but can't contain matrix fragments !!! @@ -170,6 +174,8 @@ bool FillAutoOperation::runImplementation() mrDocFunc.AdjustRowHeight(aDestArea, true, mbApi); + syncSheetViews(); + if (mbRecord) // only now is Draw-Undo available { mrDocShell.GetUndoManager()->AddUndoAction(std::make_unique<ScUndoAutoFill>(
