desktop/inc/lib/init.hxx | 9 -- desktop/qa/desktop_lib/test_desktop_lib.cxx | 97 ------------------------ desktop/source/lib/init.cxx | 70 ----------------- download.lst | 4 external/freetype/freetype-2.6.5.patch.1 | 6 - external/freetype/ubsan.patch | 21 ++--- sc/source/ui/view/viewfun2.cxx | 8 + sd/qa/unit/data/xml/n593612_0.xml | 4 svx/qa/unit/data/tdf165521_fixedCellHeight.pptx |binary svx/qa/unit/table.cxx | 47 +++++++++++ svx/source/svdraw/svdoashp.cxx | 2 11 files changed, 75 insertions(+), 193 deletions(-)
New commits: commit b2fdd8545899a5d8e5aa34c27f60a5186db96280 Author: Jaume Pujantell <jaume.pujant...@collabora.com> AuthorDate: Tue Mar 25 10:05:02 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 27 12:52:45 2025 +0100 sc: avoid cursor jump on failed search When using the command .uno:ExecuteSearch with the SearchStartPointX/Y options, the cursor would change position even if no matching string is found in the sheet. Change-Id: I94471b79b00a882489e0c92295c8359d68ee3372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183292 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183365 diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 8c93a2fe393a..c1b8a67218e5 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1970,6 +1970,9 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, if (bAddUndo && !rDoc.IsUndoEnabled()) bAddUndo = false; + bool bCursorMoved = false; + SCCOL nOrigPosX = GetViewData().GetCurX(); + SCROW nOrigPosY = GetViewData().GetCurY(); if ( !rMark.IsMarked() && !rMark.IsMultiMarked() && (pSearchItem->HasStartPoint()) ) { // No selection -> but we have a start point (top left corner of the @@ -1985,6 +1988,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, AlignToCursor( nPosX, nPosY, SC_FOLLOW_JUMP ); SetCursor( nPosX, nPosY, true ); + bCursorMoved = true; } SCCOL nCol, nOldCol; @@ -2260,6 +2264,10 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, pDocSh->PostPaintGridAll(); // mark GetFrameWin()->LeaveWait(); } + else if (bCursorMoved) + { + SetCursor(nOrigPosX, nOrigPosY, true); + } return bFound; } commit 700afb5575dad62499dc6b7dabd064df52f6b984 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Mar 27 08:37:36 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 27 12:52:45 2025 +0100 cool#11289 revert invalidation optimization on co-24.04 Revert "cool#11289 desktop lok: don't assume all views invalidate the same area" This reverts commit 6f2b99b10f27a8523864d26028b10b9c478a7d16. Revert "cool#11254 desktop lok: avoid invalidations if no tiles are sent" This reverts commit 43965ae570ded21653dabb5ec0570f8aaa7c497e. Too risky for co-24.04, do it on co-25.04 only. Change-Id: Iac0191def4cd0fd419a573bab2bb01427f537883 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183362 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 0341cc0aa9c8..536faf00aff9 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -115,9 +115,6 @@ namespace desktop { void setViewId( int viewId ) { m_viewId = viewId; } - void tilePainted(int nPart, int nMode, const tools::Rectangle& rRectangle); - const OString& getViewRenderState() const { return m_aViewRenderState; } - // SfxLockCallbackInterface virtual void libreOfficeKitViewCallback(int nType, const OString& pPayload) override; virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString& pPayload, int nViewId) override; @@ -213,9 +210,6 @@ namespace desktop { std::unordered_map<OString, OString> m_lastStateChange; std::unordered_map<int, std::unordered_map<int, OString>> m_viewStates; - /// BBox of already painted tiles: part number -> part mode -> rectangle. - std::map<int, std::map<int, tools::Rectangle>> m_aPaintedTiles; - // For some types only the last message matters (see isUpdatedType()) or only the last message // per each viewId value matters (see isUpdatedTypePerViewId()), so instead of using push model // where we'd get flooded by repeated messages (which might be costly to generate and process), @@ -236,7 +230,6 @@ namespace desktop { boost::container::flat_map<int, std::vector<PerViewIdData>> m_updatedTypesPerViewId; // key is view, index is type LibreOfficeKitDocument* m_pDocument; - OString m_aViewRenderState; int m_viewId = -1; // view id of the associated SfxViewShell LibreOfficeKitCallback m_pCallback; ImplSVEvent* m_pFlushEvent; @@ -258,8 +251,6 @@ namespace desktop { explicit LibLODocument_Impl(css::uno::Reference<css::lang::XComponent> xComponent, int nDocumentId); ~LibLODocument_Impl(); - - void updateViewsForPaintedTile(int nOrigViewId, int nPart, int nMode, const tools::Rectangle& rRectangle); }; struct DESKTOP_DLLPUBLIC LibLibreOffice_Impl : public _LibreOfficeKit diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 088026e52685..f4766980b026 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -184,8 +184,6 @@ public: void testTileInvalidationCompression(); void testPartInInvalidation(); void testBinaryCallback(); - void testOmitInvalidate(); - void test2ViewsOmitInvalidate(); void testInput(); void testRedlineWriter(); void testRedlineCalc(); @@ -258,8 +256,6 @@ public: CPPUNIT_TEST(testTileInvalidationCompression); CPPUNIT_TEST(testPartInInvalidation); CPPUNIT_TEST(testBinaryCallback); - CPPUNIT_TEST(testOmitInvalidate); - CPPUNIT_TEST(test2ViewsOmitInvalidate); CPPUNIT_TEST(testInput); CPPUNIT_TEST(testRedlineWriter); CPPUNIT_TEST(testRedlineCalc); @@ -2001,7 +1997,6 @@ void DesktopLOKTest::testBinaryCallback() std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, ¬ifs)); handler->setViewId(SfxLokHelper::getView()); - handler->tilePainted(/*nPart=*/INT_MIN, /*nMode=*/0, rect1); handler->libreOfficeKitViewInvalidateTilesCallback(&rect1, INT_MIN, 0); Scheduler::ProcessEventsToIdle(); @@ -2016,7 +2011,6 @@ void DesktopLOKTest::testBinaryCallback() std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, ¬ifs)); handler->setViewId(SfxLokHelper::getView()); - handler->tilePainted(/*nPart=*/INT_MIN, /*nMode=*/0, rect1); handler->libreOfficeKitViewInvalidateTilesCallback(nullptr, INT_MIN, 0); Scheduler::ProcessEventsToIdle(); @@ -2027,97 +2021,6 @@ void DesktopLOKTest::testBinaryCallback() } } -void DesktopLOKTest::testOmitInvalidate() -{ - LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); - tools::Rectangle aRectangle{Point(0, 0), Size(10, 10)}; - - { - // Given a clean state: - std::vector<std::tuple<int, std::string>> aCallbacks; - std::unique_ptr<CallbackFlushHandler> pHandler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &aCallbacks)); - pHandler->setViewId(0); - - // When emitting just an invalidation: - pHandler->libreOfficeKitViewInvalidateTilesCallback(&aRectangle, /*nPart=*/0, /*nMode=*/0); - - // Then make sure that's filtered out: - Scheduler::ProcessEventsToIdle(); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 0 - // - Actual : 1 - // i.e. invalidation was emitted when we haven't rendered any tiles yet. - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), aCallbacks.size()); - } - - { - // Given a clean state: - std::vector<std::tuple<int, std::string>> aCallbacks; - std::unique_ptr<CallbackFlushHandler> pHandler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &aCallbacks)); - pHandler->setViewId(0); - - // When emitting an invalidation outside the painted area: - pHandler->tilePainted(/*nPart=*/0, /*nMode=*/0, aRectangle); - tools::Rectangle aElsewhere{Point(20, 20), Size(10, 10)}; - pHandler->libreOfficeKitViewInvalidateTilesCallback(&aElsewhere, /*nPart=*/0, /*nMode=*/0); - - // Then make sure that's filtered out: - Scheduler::ProcessEventsToIdle(); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), aCallbacks.size()); - } - - { - // Given a clean state: - std::vector<std::tuple<int, std::string>> aCallbacks; - std::unique_ptr<CallbackFlushHandler> pHandler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &aCallbacks)); - pHandler->setViewId(0); - - // When emitting an invalidation partly outside the painted area: - pHandler->tilePainted(/*nPart=*/0, /*nMode=*/0, aRectangle); - tools::Rectangle aLarger{Point(0, 0), Size(20, 10)}; - pHandler->libreOfficeKitViewInvalidateTilesCallback(&aLarger, /*nPart=*/0, /*nMode=*/0); - - // Then make sure that's cropped: - Scheduler::ProcessEventsToIdle(); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aCallbacks.size()); - CPPUNIT_ASSERT_EQUAL(int(LOK_CALLBACK_INVALIDATE_TILES), std::get<0>(aCallbacks[0])); - // x, y, w, h, part, mode; so this is cropped. - CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 9, 9, 0, 0"), std::get<1>(aCallbacks[0])); - } -} - -void DesktopLOKTest::test2ViewsOmitInvalidate() -{ - // Given a document with 2 views: - LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); - std::vector<std::tuple<int, std::string>> aCallbacks1; - std::shared_ptr<CallbackFlushHandler> pHandler1(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &aCallbacks1)); - pHandler1->setViewId(0); - pDocument->mpCallbackFlushHandlers[0] = pHandler1; - std::vector<std::tuple<int, std::string>> aCallbacks2; - std::shared_ptr<CallbackFlushHandler> pHandler2(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &aCallbacks2)); - pHandler2->setViewId(1); - pDocument->mpCallbackFlushHandlers[1] = pHandler2; - - // When painting a tile for a larger area, and then 2 invalidates: the first view gets a smaller - // invalidate, the second view gets a larger invalidate: - tools::Rectangle aPaint{Point(0, 0), Size(20, 10)}; - pDocument->updateViewsForPaintedTile(/*nOrigViewId=*/0, /*nPart=*/0, /*nMode=*/0, aPaint); - tools::Rectangle aSmaller{Point(0, 0), Size(10, 10)}; - pHandler1->libreOfficeKitViewInvalidateTilesCallback(&aSmaller, /*nPart=*/0, /*nMode=*/0); - tools::Rectangle aLarger{Point(0, 0), Size(20, 10)}; - pHandler2->libreOfficeKitViewInvalidateTilesCallback(&aLarger, /*nPart=*/0, /*nMode=*/0); - - // Then make sure this larger invalidate for the 2nd view is not lost: - Scheduler::ProcessEventsToIdle(); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 1 - // - Actual : 0 - // i.e. the 2nd view's (larger) invalidate was lost. - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aCallbacks2.size()); - CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 19, 9, 0, 0"), std::get<1>(aCallbacks2[0])); -} - void DesktopLOKTest::testInput() { // Load a Writer document, enable change recording and press a key. diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8a18622b79f2..9b3de8876ca3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1627,12 +1627,6 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li m_states.emplace(LOK_CALLBACK_RULER_UPDATE, "NIL"_ostr); m_states.emplace(LOK_CALLBACK_VERTICAL_RULER_UPDATE, "NIL"_ostr); m_states.emplace(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, "NIL"_ostr); - - if (char* pViewRenderState = pDocument->pClass->getCommandValues(pDocument, ".uno:ViewRenderState")) - { - m_aViewRenderState = pViewRenderState; - free(pViewRenderState); - } } void CallbackFlushHandler::stop() @@ -1721,34 +1715,7 @@ void CallbackFlushHandler::libreOfficeKitViewCallbackWithViewId(int nType, const void CallbackFlushHandler::libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart, int nMode) { - tools::Rectangle& rPaintedTiles = m_aPaintedTiles[nPart][nMode]; - if (rPaintedTiles.IsEmpty()) - { - // We have not sent any tiles: don't send invalidations. - return; - } - - tools::Rectangle aRect; - if (pRect) - { - // We got an invalidate: crop it against the bbox. - aRect = *pRect; - aRect.Intersection(rPaintedTiles); - if (aRect.IsEmpty()) - { - return; - } - } - else - { - // EMPTY invalidation: reset the bbox. - rPaintedTiles = tools::Rectangle(); - // nullptr pRect means: invalidate everything. - aRect = RectangleAndPart::emptyAllRectangle; - } - - // RectangleAndPart ctor doesn't store &aRect, so this is OK. - CallbackData callbackData(&aRect, nPart, nMode); + CallbackData callbackData(pRect, nPart, nMode); queue(LOK_CALLBACK_INVALIDATE_TILES, callbackData); } @@ -1837,10 +1804,6 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) { bIsComment = true; } - else if (type == LOK_CALLBACK_VIEW_RENDER_STATE) - { - m_aViewRenderState = aCallbackData.getPayload(); - } if (callbacksDisabled() && !bIsChartActive && !bIsComment) { @@ -2657,13 +2620,6 @@ void CallbackFlushHandler::removeViewStates(int viewId) m_viewStates.erase(viewId); } -void CallbackFlushHandler::tilePainted(int nPart, int nMode, const tools::Rectangle& rRectangle) -{ - // Painted a new tile: grow the bbox. - tools::Rectangle& rPaintedTiles = m_aPaintedTiles[nPart][nMode]; - rPaintedTiles.Union(rRectangle); -} - static void doc_destroy(LibreOfficeKitDocument *pThis) { @@ -4512,30 +4468,6 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } enableViewCallbacks(pDocument, nOrigViewId); - - // Inform all views with the same view render state about the paint, so they know if makes sense - // to invalidate those areas later. - tools::Rectangle aRectangle{Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)}; - pDocument->updateViewsForPaintedTile(nOrigViewId, nPart, nMode, aRectangle); -} - -void LibLODocument_Impl::updateViewsForPaintedTile(int nOrigViewId, int nPart, int nMode, const tools::Rectangle& rRectangle) -{ - auto it = mpCallbackFlushHandlers.find(nOrigViewId); - if (it == mpCallbackFlushHandlers.end()) - { - return; - } - - const OString& rViewRenderState = it->second->getViewRenderState(); - for (const auto& rHandler : mpCallbackFlushHandlers) - { - if (rHandler.second->getViewRenderState() != rViewRenderState) - { - continue; - } - rHandler.second->tilePainted(nPart, nMode, rRectangle); - } } static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) commit d01539defc247109e048fd00d3ceb3b78d60cc97 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Mar 15 16:43:03 2025 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 27 12:52:44 2025 +0100 tdf#165521 svx layout: clear Outliner FixedCellHeight after use This specifically avoids a PPTX custom shape's editEngine flag from bleeding into the remainder of the document and affecting another shape's sizing calculations. This bleeding was noticably affecting PPTX table sizes, triggering the investigation that lead to this patch. FALSE REGRESSION NOTE: It appears that perhaps PPT/X tables SHOULD ALWAYS be sized according to SDRATTR_TEXT_USEFIXEDCELLHEIGHT = TRUE. In other words, tables currently match MS Powerpoint's table size only when they accidentally have this setting bleed through. With this patch, we are effectively always setting it to FALSE, and thus tables will never be accidentally correct anymore. ... and the same possibly is true for all kinds of other shapes. The problem with having a correct Powerpoint table size is that the text inside the table needs to also be in sync with this sizing calculation. Otherwise it will either be too small (commonly), or it could spill out of the table (in cases where the font is designed with a large leading). This patch's effect on tables is to allow the table to only be defined by its own content. Now when other actions cause a table recalculation (like selecting text, drag and drop, editing) the table size won't fluctuate (since in this re-draw context there wasn't any FixedCellHeight bleeding into the calculation). make CppunitTest_svx_unit \ CPPUNIT_TEST_NAME=testTdf165521_fixedCellHeight Change-Id: I5239c78cf8f1e8fffd65b6aa285a840428e92e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183342 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Justin Luth <jl...@mail.com> (cherry picked from commit e871dc2bb1bbb949783e8eea8d632a6bcb89e738) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183344 Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sd/qa/unit/data/xml/n593612_0.xml b/sd/qa/unit/data/xml/n593612_0.xml index 0639294c5007..eea24cdac903 100644 --- a/sd/qa/unit/data/xml/n593612_0.xml +++ b/sd/qa/unit/data/xml/n593612_0.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <XShapes> - <XShape positionX="11429" positionY="1324" sizeX="2259" sizeY="15124" type="com.sun.star.drawing.CustomShape" name="Rectangle 52" text=" " fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="254" textRightDistance="254" textUpperDistance="127" textLowerDistance="127" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="3c8c93" fillTransparence="0" fillTran sparenceGradientName=""> + <XShape positionX="11429" positionY="1324" sizeX="2259" sizeY="12149" type="com.sun.star.drawing.CustomShape" name="Rectangle 52" text=" " fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="254" textRightDistance="254" textUpperDistance="127" textLowerDistance="127" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="3c8c93" fillTransparence="0" fillTran sparenceGradientName=""> <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> <FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/> @@ -10,7 +10,7 @@ <LineEnd/> <Transformation> <Line1 column1="2260.000000" column2="0.000000" column3="11429.000000"/> - <Line2 column1="0.000000" column2="15125.000000" column3="1324.000000"/> + <Line2 column1="0.000000" column2="12150.000000" column3="1324.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> </Transformation> <CustomShapeGeometry> diff --git a/svx/qa/unit/data/tdf165521_fixedCellHeight.pptx b/svx/qa/unit/data/tdf165521_fixedCellHeight.pptx new file mode 100644 index 000000000000..82192eb1c2ef Binary files /dev/null and b/svx/qa/unit/data/tdf165521_fixedCellHeight.pptx differ diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx index e51cd3f860ce..2316de1fa57f 100644 --- a/svx/qa/unit/table.cxx +++ b/svx/qa/unit/table.cxx @@ -102,6 +102,53 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) "transparence"_ostr, "80"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf165521_fixedCellHeight) +{ + // Given a document containing a table whose size/text should match the textbox: + // (In this Liberation Sans unit test, the text is too small and doesn't fill the table, + // while in the bug report's Marianne font example, the text is too large, spilling out of it.) + + loadFromFile(u"tdf165521_fixedCellHeight.pptx"); + + // When rendering the table: + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence + = renderPageToPrimitives(xDrawPage); + + // TODO: Then make sure the text in both table and textbox are the same line height + drawinglayer::Primitive2dXmlDump aDumper; + xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence); + const OString sTextboxPath7 + = "/primitive2D/objectinfo[1]/unhandled/sdrblocktext/texthierarchyblock/texthierarchyparagraph/texthierarchyline[7]/textsimpleportion"_ostr; + CPPUNIT_ASSERT( + getXPath(pDocument, sTextboxPath7, "text"_ostr) + .startsWith("Autofit Custom Shape forces Fixed Cell Height even in the table.")); + // const sal_Int32 nTextBoxFontLineHeight = getXPath(pDocument, sTextboxPath7, "y"_ostr).toInt32() + // - getXPath(pDocument, sTextboxPath6, "y"_ostr).toInt32(); + + const OString sTablePath6 + = "/primitive2D/objectinfo[2]/sdrCell[2]/sdrblocktext/texthierarchyblock/texthierarchyparagraph/texthierarchyline[6]/textsimpleportion"_ostr; + const OString sTablePath7 + = "/primitive2D/objectinfo[2]/sdrCell[2]/sdrblocktext/texthierarchyblock/texthierarchyparagraph/texthierarchyline[7]/textsimpleportion"_ostr; + CPPUNIT_ASSERT(getXPath(pDocument, sTablePath7, "text"_ostr).startsWith("Qualcomm Snapdragon")); + const sal_Int32 nTableFontLineHeight = getXPath(pDocument, sTablePath7, "y"_ostr).toInt32() + - getXPath(pDocument, sTablePath6, "y"_ostr).toInt32(); + // Expected: 593. + // Actual (without the acompanying patch) 553 + // CPPUNIT_ASSERT_EQUAL(nTextBoxFontLineHeight, nTableFontLineHeight); + + // All of the text must fit inside the table, + // and the table must be approximately the same size as the lines of text. + sal_Int32 nTableHeight + = getXPath(pDocument, + "/primitive2D/objectinfo[2]/sdrCell[2]/polypolygoncolor/polypolygon"_ostr, + "height"_ostr) + .toInt32(); + CPPUNIT_ASSERT_DOUBLES_EQUAL(7 * nTableFontLineHeight, nTableHeight, 1); +} + CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape) { // Given a document with a table shape, editing cell text: diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index eeaa5571576b..4ad82f21a251 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2368,7 +2368,9 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool nHgt = rR.getOpenHeight(); } } + // cleanup outliner rOutliner.Clear(); + rOutliner.SetFixedCellHeight(false); } } else commit 762c9358f2f01ace0f2ce855a71be29d9c1d47da Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Aug 29 18:15:38 2024 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 27 12:52:44 2025 +0100 freetype: upgrade to 2.13.3 Downloaded from https://sourceforge.net/projects/freetype/files/freetype2/2.13.3/freetype-2.13.3.tar.xz/download Change-Id: Id38ce5fe5c04d515f4e8298326336cfb60f7ed36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172607 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 265914ee3e99e70a9b1f5a9a80f3574fc9af5392) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183334 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/download.lst b/download.lst index 854233ab395b..349359b5aad3 100644 --- a/download.lst +++ b/download.lst @@ -370,8 +370,8 @@ FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -FREETYPE_SHA256SUM := 5ee23abd047636c24b2d43c6625dcafc66661d1aca64dec9e0d05df29592624c -FREETYPE_TARBALL := freetype-2.13.0.tar.xz +FREETYPE_SHA256SUM := 0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 +FREETYPE_TARBALL := freetype-2.13.3.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/freetype/freetype-2.6.5.patch.1 b/external/freetype/freetype-2.6.5.patch.1 index 544e4fa496a6..5d940b11addc 100644 --- a/external/freetype/freetype-2.6.5.patch.1 +++ b/external/freetype/freetype-2.6.5.patch.1 @@ -146,12 +146,12 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure ;; *) XX_ANSIFLAGS="" -@@ -13796,7 +13796,7 @@ if ac_fn_c_try_compile "$LINENO" +@@ -13982,7 +13982,7 @@ then : { printf "%s " "$as_me:${as_lineno-$LINENO}: result: ok, adding to XX_ANSIFLAGS" >&5 printf "%s " "ok, adding to XX_ANSIFLAGS" >&6; } - XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}" + XX_ANSIFLAGS="${XX_ANSIFLAGS}" - else $as_nop - { printf "%s " "$as_me:${as_lineno-$LINENO}: result: no" >&5 + else case e in #( + e) { printf "%s " "$as_me:${as_lineno-$LINENO}: result: no" >&5 diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch index 43ce217c4b7d..7e474c815942 100644 --- a/external/freetype/ubsan.patch +++ b/external/freetype/ubsan.patch @@ -1,15 +1,3 @@ ---- src/psaux/psobjs.c.orig 2023-02-04 23:00:05.000000000 +0900 -+++ src/psaux/psobjs.c 2023-02-22 16:28:26.632283841 +0900 -@@ -200,7 +200,8 @@ - /* add the object to the base block and adjust offset */ - table->elements[idx] = FT_OFFSET( table->block, table->cursor ); - table->lengths [idx] = length; -- FT_MEM_COPY( table->block + table->cursor, object, length ); -+ if (length != 0) -+ FT_MEM_COPY( table->block + table->cursor, object, length ); - - table->cursor += length; - return FT_Err_Ok; --- src/truetype/ttgxvar.c +++ src/truetype/ttgxvar.c @@ -1045,7 +1045,7 @@ commit 90c00466b66ab5302774c32d957793ff49ff1308 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Sun Feb 25 21:50:07 2024 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 27 12:52:44 2025 +0100 external/freetype: nullptr-with-offset ...as seen during CppunitTest_xmloff_style, > workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1048:31: runtime error: applying zero offset to null pointer > #0 in tt_var_get_item_delta at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1048:31 > #1 in tt_hvadvance_adjust at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1242:13 > #2 in tt_vadvance_adjust at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1278:12 > #3 in tt_face_get_metrics at workdir/UnpackedTarball/freetype/src/sfnt/ttmtx.c:319:11 > #4 in cff_slot_load at workdir/UnpackedTarball/freetype/src/cff/cffgload.c:660:11 > #5 in cff_glyph_load at workdir/UnpackedTarball/freetype/src/cff/cffdrivr.c:192:13 > #6 in FT_Load_Glyph at workdir/UnpackedTarball/freetype/src/base/ftobjs.c:1066:15 > #7 in _cairo_ft_scaled_glyph_load_glyph at workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2455:13 > #8 in _cairo_ft_scaled_glyph_init at workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2640:11 > #9 in _cairo_scaled_glyph_lookup at workdir/UnpackedTarball/cairo/src/cairo-scaled-font.c:3035:6 > #10 in _cairo_scaled_font_glyph_device_extents at workdir/UnpackedTarball/cairo/src/cairo-scaled-font.c:2250:15 > #11 in _cairo_composite_rectangles_init_for_glyphs at workdir/UnpackedTarball/cairo/src/cairo-composite-rectangles.c:476:14 > #12 in _cairo_compositor_glyphs at workdir/UnpackedTarball/cairo/src/cairo-compositor.c:280:14 > #13 in _cairo_image_surface_glyphs at workdir/UnpackedTarball/cairo/src/cairo-image-surface.c:1030:12 > #14 in _cairo_surface_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-surface.c:2920:15 > #15 in _cairo_gstate_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-gstate.c:2077:15 > #16 in _cairo_default_context_glyphs at workdir/UnpackedTarball/cairo/src/cairo-default-context.c:1334:12 > #17 in cairo_show_glyphs at workdir/UnpackedTarball/cairo/src/cairo.c:3670:14 > #18 in CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) at vcl/unx/generic/gdi/cairotextrender.cxx:477:9 > #19 in SvpSalGraphics::DrawTextLayout(GenericSalLayout const&) at vcl/headless/svptext.cxx:72:23 > #20 in GenericSalLayout::DrawText(SalGraphics&) const at vcl/source/gdi/CommonSalLayout.cxx:171:18 > #21 in OutputDevice::ImplDrawTextDirect(SalLayout&, bool) at vcl/source/outdev/text.cxx:312:16 > #22 in OutputDevice::ImplDrawText(SalLayout&) at vcl/source/outdev/text.cxx:463:9 > #23 in OutputDevice::DrawTextArray(Point const&, rtl::OUString const&, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, int, int, SalLayoutFlags, SalLayoutGlyphs const*) at vcl/source/outdev/text.cxx:701:9 > #24 in SwFntObj::DrawText(SwDrawTextInfo&) at sw/source/core/txtnode/fntcache.cxx:1490:31 > #25 in SwSubFont::DrawText_(SwDrawTextInfo&, bool) at sw/source/core/txtnode/swfont.cxx:1144:24 > #26 in SwFont::DrawText_(SwDrawTextInfo&) at sw/source/core/inc/swfont.hxx:324:29 > #27 in SwTextPaintInfo::DrawText_(rtl::OUString const&, SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, o3tl::strong_int<int, Tag_TextFrameIndex>, bool, bool, bool, bool) at sw/source/core/text/inftxt.cxx:730:21 > #28 in SwTextPaintInfo::DrawText(SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, bool) const at sw/source/core/text/inftxt.hxx:783:41 > #29 in SwTextPortion::Paint(SwTextPaintInfo const&) const at sw/source/core/text/portxt.cxx:603:18 > #30 in SwTextPainter::DrawTextLine(SwRect const&, SwSaveClip&, bool, std::optional<SwTaggedPDFHelper>&, std::optional<SwTaggedPDFHelper>&, bool) at sw/source/core/text/itrpaint.cxx:433:23 > #31 in SwTextFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/text/frmpaint.cxx:787:23 > #32 in SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:3804:21 > #33 in SwFlyFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:4507:20 > #34 in SwVirtFlyDrawObj::wrap_DoPaintObject(drawinglayer::geometry::ViewInformation2D const&) const at sw/source/core/draw/dflyobj.cxx:541:18 > #35 in drawinglayer::primitive2d::(anonymous namespace)::SwVirtFlyDrawObjPrimitive::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at sw/source/core/draw/dflyobj.cxx:244:35 > #36 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #37 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:397:13 > #38 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:69:21 > #39 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:284:31 > #40 in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:120:21 > #41 in SdrPageWindow::RedrawLayer(o3tl::strong_int<short, SdrLayerIDTag> const*, sdr::contact::ViewObjectContactRedirector*, basegfx::B2IRange const*) at svx/source/svdraw/sdrpagewindow.cxx:421:28 > #42 in SdrPageView::DrawLayer(o3tl::strong_int<short, SdrLayerIDTag>, OutputDevice*, sdr::contact::ViewObjectContactRedirector*, tools::Rectangle const&, basegfx::B2IRange const*) at svx/source/svdraw/svdpagv.cxx:265:27 > #43 in SwViewShellImp::PaintLayer(o3tl::strong_int<short, SdrLayerIDTag>, SwPageFrame const&, SwRect const&, Color const*, bool, sdr::contact::ViewObjectContactRedirector*) at sw/source/core/view/vdraw.cxx:139:20 > #44 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:3527:33 > #45 in SwViewShell::PrtOle2(SwDoc*, SwViewOption const*, SwPrintData const&, OutputDevice&, tools::Rectangle const&, bool) at sw/source/core/view/vprint.cxx:592:27 > #46 in SwDocShell::Draw(OutputDevice*, JobSetup const&, unsigned short, bool) at sw/source/uibase/app/docsh.cxx:881:5 > #47 in SfxObjectShell::DoDraw_Impl(OutputDevice*, Point const&, Fraction const&, Fraction const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:204:5 > #48 in SfxObjectShell::DoDraw(OutputDevice*, Point const&, Size const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:151:9 > #49 in SfxObjectShell::CreatePreview_Impl(bool, VirtualDevice*, GDIMetaFile*) const at sfx2/source/doc/objcont.cxx:198:40 > #50 in SfxObjectShell::GetPreviewBitmap() const at sfx2/source/doc/objcont.cxx:110:9 > #51 in SfxObjectShell::WriteThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::io::XStream> const&) at sfx2/source/doc/objstor.cxx:3850:31 > #52 in SfxObjectShell::GenerateAndStoreThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) at sfx2/source/doc/objstor.cxx:3808:33 > #53 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1531:19 > #54 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:3117:39 > #55 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:2907:9 > #56 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t>>, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objserv.cxx:320:19 > #57 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:3233:42 > #58 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1815:13 > #59 in UnoApiTest::saveWithParams(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:213:16 > #60 in UnoApiTest::save(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:178:5 > #61 in testWritingModeBTLR::TestBody() at xmloff/qa/unit/style.cxx:193:9 Change-Id: I54d4d90e203127e018b99c34785602ac3d96e425 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163925 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 9a8f4fb40867889bb08e4c5e1a89f2dbbf27681a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183333 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Miklos Vajna <vmik...@collabora.com> diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch index 80446ac5c89c..43ce217c4b7d 100644 --- a/external/freetype/ubsan.patch +++ b/external/freetype/ubsan.patch @@ -10,3 +10,14 @@ table->cursor += length; return FT_Err_Ok; +--- src/truetype/ttgxvar.c ++++ src/truetype/ttgxvar.c +@@ -1045,7 +1045,7 @@ + if ( varData->longWords ) + per_region_size *= 2; + +- bytes = varData->deltaSet + per_region_size * innerIndex; ++ bytes = varData->deltaSet ? varData->deltaSet + per_region_size * innerIndex : NULL; + + if ( varData->longWords ) + {