desktop/source/lib/init.cxx | 13 +++-- filter/source/svg/svgexport.cxx | 2 include/vcl/ITiledRenderable.hxx | 4 + sc/inc/docuno.hxx | 2 sc/qa/unit/tiledrendering/tiledrendering.cxx | 4 - sc/source/ui/app/inputhdl.cxx | 5 + sc/source/ui/unoobj/docuno.cxx | 7 ++ sc/source/ui/view/cliputil.cxx | 16 +++++- sd/qa/unit/tiledrendering/tiledrendering.cxx | 68 +++++++++++++++++++++++++++ sd/source/ui/inc/DrawViewShell.hxx | 2 sd/source/ui/inc/unomodel.hxx | 2 sd/source/ui/unoidl/unomodel.cxx | 4 - sd/source/ui/view/drviews1.cxx | 23 ++++++--- sd/source/ui/view/drviews3.cxx | 14 ++++- sw/inc/unotxdoc.hxx | 2 sw/source/uibase/uno/unotxdoc.cxx | 2 16 files changed, 142 insertions(+), 28 deletions(-)
New commits: commit ce7bf351972bbfd64ca99e8d2fb4c5f77591c9e0 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Mar 25 17:21:35 2021 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Apr 14 13:42:29 2021 +0200 impress: don't exit textbox editing when new slide was added When new slide is added by other user before currently visible slide then SwitchPage is called and textbox editing is ended. Avoid any focus change when setPart is called just for rendering or SwitchPage is used on previously avtive slide (only slide numer changed). Change-Id: I7fef42b863e0079acc84dadfc3f891548652b48f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113144 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113806 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 15250bc35085..bc21a07e5ac5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2972,7 +2972,7 @@ static int doc_getPart (LibreOfficeKitDocument* pThis) return pDoc->getPart(); } -static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) +static void doc_setPartImpl(LibreOfficeKitDocument* pThis, int nPart, bool bAllowChangeFocus = true) { comphelper::ProfileZone aZone("doc_setPart"); @@ -2986,7 +2986,12 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) return; } - pDoc->setPart( nPart ); + pDoc->setPart( nPart, bAllowChangeFocus ); +} + +static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) +{ + doc_setPartImpl(pThis, nPart, true); } static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart) @@ -3300,7 +3305,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, nOrigPart = doc_getPart(pThis); if (nPart != nOrigPart) { - doc_setPart(pThis, nPart); + doc_setPartImpl(pThis, nPart, false); } } @@ -3308,7 +3313,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, if (!isText && nPart != nOrigPart) { - doc_setPart(pThis, nOrigPart); + doc_setPartImpl(pThis, nOrigPart, false); } if (!isText && nViewId != nOrigViewId) { diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 42689ed98c2a..cf609fa0d0a5 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -72,8 +72,10 @@ public: /** * Set the document "part", i.e. slide for a slideshow, and * tab for a spreadsheet. + * bool bAllowChangeFocus - used to not disturb other users while editing when + * setPart is used for tile rendering only */ - virtual void setPart( int ) {} + virtual void setPart( int /*nPart*/, bool /*bAllowChangeFocus*/ = true ) {} /** * Get the number of parts -- see setPart for further details. diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 44fdc3463aed..b58990a37fd7 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -312,7 +312,7 @@ public: virtual Size getDocumentSize() override; /// @see vcl::ITiledRenderable::setPart(). - virtual void setPart(int nPart) override; + virtual void setPart(int nPart, bool bAllowChangeFocus = true) override; /// @see vcl::ITiledRenderable::getPart(). virtual int getPart() override; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index eca643fc5a1c..5906c85ef498 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -570,7 +570,7 @@ void ScModelObj::paintTile( VirtualDevice& rDevice, nTilePosX, nTilePosY, nTileWidth, nTileHeight); } -void ScModelObj::setPart( int nPart ) +void ScModelObj::setPart( int nPart, bool /*bAllowChangeFocus*/ ) { ScViewData* pViewData = ScDocShell::GetViewData(); ScTabView* pTabView = dynamic_cast< ScTabView* >( pViewData->GetView() ); diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index ae4aab1b1e91..811c25a68660 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -115,6 +115,7 @@ public: void testCommentChangeImpress(); void testCommentChangeDraw(); void testMultiViewInsertDeletePage(); + void testMultiViewInsertDeletePage2(); void testDisableUndoRepair(); void testDocumentRepair(); void testLanguageStatus(); @@ -168,6 +169,7 @@ public: CPPUNIT_TEST(testCommentChangeImpress); CPPUNIT_TEST(testCommentChangeDraw); CPPUNIT_TEST(testMultiViewInsertDeletePage); + CPPUNIT_TEST(testMultiViewInsertDeletePage2); CPPUNIT_TEST(testDisableUndoRepair); CPPUNIT_TEST(testDocumentRepair); CPPUNIT_TEST(testLanguageStatus); @@ -1954,6 +1956,72 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage() CPPUNIT_ASSERT_EQUAL(4, pXImpressDocument->getPart()); } +void SdTiledRenderingTest::testMultiViewInsertDeletePage2() +{ + // Load the document. + SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); + ViewCallback aView1; + int nView1 = SfxLokHelper::getView(); + uno::Sequence<beans::PropertyValue> aArgs; + SdDrawDocument* pDoc = pXImpressDocument->GetDocShell()->GetDoc(); + + // Create second view + SfxLokHelper::createView(); + pXImpressDocument->initializeForTiledRendering(aArgs); + ViewCallback aView2; + int nView2 = SfxLokHelper::getView(); + + // the document has 8 slides + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(8), pDoc->GetSdPageCount(PageKind::Standard)); + + // Switch to 5th page in 2nd view + pXImpressDocument->setPart(4); + + // Begin text edit on the only object on the slide. + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + SdPage* pActualPage = pViewShell->GetActualPage(); + SdrObject* pObject1 = pActualPage->GetObj(0); + CPPUNIT_ASSERT(pObject1 != nullptr); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); + + // Double-click outside the text to enter edit mode. + const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect(); + const auto cornerX = convertMm100ToTwip(aRect.getX() + (aRect.getWidth() / 4)); + const auto cornerY = convertMm100ToTwip(aRect.getY() + (aRect.getHeight() / 4)); + pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, + cornerX, cornerY, + 2, MOUSE_LEFT, 0); + pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, + cornerX, cornerY, + 2, MOUSE_LEFT, 0); + Scheduler::ProcessEventsToIdle(); + + // We must be in text editing mode and have cursor visible. + CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit()); + + // Insert slide in 1st view + SfxLokHelper::setView(nView1); + comphelper::dispatchCommand(".uno:InsertPage", aArgs); + Scheduler::ProcessEventsToIdle(); + + // See if the current slide number changed in 2nd view too + SfxLokHelper::setView(nView2); + CPPUNIT_ASSERT_EQUAL(5, pXImpressDocument->getPart()); + + // Delete the page in 1st view now + SfxLokHelper::setView(nView1); + comphelper::dispatchCommand(".uno:DeletePage", aArgs); + Scheduler::ProcessEventsToIdle(); + + // See if current slide number changed in 2nd view too + SfxLokHelper::setView(nView2); + CPPUNIT_ASSERT_EQUAL(4, pXImpressDocument->getPart()); + + // We must be still in text editing mode and have cursor visible. + CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit()); +} + void SdTiledRenderingTest::testDisableUndoRepair() { // Load the document. diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 5170883b3379..4213d12750cb 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -243,7 +243,7 @@ public: void ResetActualPage(); void ResetActualLayer(); - bool SwitchPage(sal_uInt16 nPage); + bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true); bool IsSwitchPageAllowed() const; /** diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 483dca72f73a..2873e705ca6b 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -232,7 +232,7 @@ public: tools::Long nTileWidth, tools::Long nTileHeight ) override; virtual Size getDocumentSize() override; - virtual void setPart( int nPart ) override; + virtual void setPart( int nPart, bool bAllowChangeFocus = true ) override; virtual int getPart() override; virtual int getParts() override; virtual OUString getPartName( int nPart ) override; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index b325c3c9e201..a246aab75b34 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2295,13 +2295,13 @@ OUString SdXImpressDocument::getPartInfo(int nPart) return aPartInfo; } -void SdXImpressDocument::setPart( int nPart ) +void SdXImpressDocument::setPart( int nPart, bool bAllowChangeFocus ) { DrawViewShell* pViewSh = GetViewShell(); if (!pViewSh) return; - pViewSh->SwitchPage( nPart ); + pViewSh->SwitchPage( nPart, bAllowChangeFocus ); } int SdXImpressDocument::getParts() diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index b1105e38872f..06462ecdf75c 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -71,6 +71,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vcl/uitest/logger.hxx> #include <vcl/uitest/eventdescription.hxx> +#include <svl/intitem.hxx> using namespace com::sun::star; @@ -652,6 +653,7 @@ void DrawViewShell::ResetActualPage() return; sal_uInt16 nCurrentPageId = maTabControl->GetCurPageId(); + sal_uInt16 nNewPageId = nCurrentPageId; sal_uInt16 nCurrentPageNum = maTabControl->GetPagePos(nCurrentPageId); sal_uInt16 nPageCount = (meEditMode == EditMode::Page)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind); @@ -678,7 +680,8 @@ void DrawViewShell::ResetActualPage() GetDoc()->SetSelected(pPage, false); } - maTabControl->SetCurPageId(maTabControl->GetPageId(nCurrentPageNum)); + nNewPageId = maTabControl->GetPageId(nCurrentPageNum); + maTabControl->SetCurPageId(nNewPageId); } else // EditMode::MasterPage { @@ -698,12 +701,16 @@ void DrawViewShell::ResetActualPage() nCurrentPageNum = i; } - maTabControl->SetCurPageId(maTabControl->GetPageId(nCurrentPageNum)); + nNewPageId = maTabControl->GetPageId(nCurrentPageNum); + maTabControl->SetCurPageId(nNewPageId); SwitchPage(nCurrentPageNum); } - GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE, - SfxCallMode::ASYNCHRON | SfxCallMode::RECORD); + bool bAllowChangeFocus = nNewPageId != nCurrentPageId; + SfxBoolItem aI(SID_SWITCHPAGE, bAllowChangeFocus); + GetViewFrame()->GetDispatcher()->ExecuteList(SID_SWITCHPAGE, + SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, + { &aI }); } /** @@ -818,8 +825,11 @@ bool DrawViewShell::IsVisible(sal_uInt16 nPage) /** * Switch to desired page. * nSelectPage refers to the current EditMode + * bAllowChangeFocus set to false when slide is inserted before current page + * and we need to only update the current page number, + * do not disturb editing in that case */ -bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) +bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus) { /** Under some circumstances there are nested calls to SwitchPage() and may crash the application (activation of form controls when the @@ -923,7 +933,8 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) } } - mpDrawView->SdrEndTextEdit(); + if (bAllowChangeFocus) + mpDrawView->SdrEndTextEdit(); mpActualPage = nullptr; diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index ed28a4370ebc..545c7befeca4 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -106,6 +106,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) // End text edit mode for some requests. sal_uInt16 nSlot = rReq.GetSlot(); + bool bAllowFocusChange = true; switch (nSlot) { case SID_OUTPUT_QUALITY_COLOR: @@ -114,6 +115,15 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_OUTPUT_QUALITY_CONTRAST: // Do nothing. break; + case SID_SWITCHPAGE: + if (rReq.GetArgs() && rReq.GetArgs()->Count () == 1) + { + const SfxBoolItem* pAllowFocusChange = rReq.GetArg<SfxBoolItem>(SID_SWITCHPAGE); + bAllowFocusChange = pAllowFocusChange->GetValue(); + if (!bAllowFocusChange) + break; + } + BOOST_FALLTHROUGH; default: if ( mpDrawView->IsTextEdit() ) { @@ -137,7 +147,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) const SfxItemSet *pArgs = rReq.GetArgs (); sal_uInt16 nSelectedPage = 0; - if (! pArgs) + if (! pArgs || pArgs->Count () == 1) { nSelectedPage = maTabControl->GetCurPagePos(); } @@ -183,7 +193,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if( GetDocSh() && (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)) GetDocSh()->SetModified(); - SwitchPage(nSelectedPage); + SwitchPage(nSelectedPage, bAllowFocusChange); if(HasCurrentFunction(SID_BEZIER_EDIT)) GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 1f814a915b05..d6d66ff3021f 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -398,7 +398,7 @@ public: /// @see vcl::ITiledRenderable::getDocumentSize(). virtual Size getDocumentSize() override; /// @see vcl::ITiledRenderable::setPart(). - virtual void setPart(int nPart) override; + virtual void setPart(int nPart, bool bAllowChangeFocus = true) override; /// @see vcl::ITiledRenderable::getParts(). virtual int getParts() override; /// @see vcl::ITiledRenderable::getPart(). diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index fce0ff7ceb74..53e7e3292b3e 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3156,7 +3156,7 @@ Size SwXTextDocument::getDocumentSize() aDocSize.Height() + 2 * DOCUMENTBORDER); } -void SwXTextDocument::setPart(int nPart) +void SwXTextDocument::setPart(int nPart, bool /*bAllowChangeFocus*/) { SolarMutexGuard aGuard; commit 5900fd583a6b2ea5810a78f66e75b2910b34b7cc Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Mar 25 10:41:11 2021 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Apr 14 13:41:54 2021 +0200 SVGFilter::implGenerateMetaData check page before use Avoid crash in online impress: 1. session A edits the textbox 2. session B removed slide which is edited by A 3. session A tries to edit another textbox on other slide Change-Id: Ic875321107baa48fd2a5b52aa2580a8fcde40823 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113077 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index e32ad834f1b8..2c8130667c6b 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1234,6 +1234,8 @@ void SVGFilter::implGenerateMetaData() { const Reference< css::drawing::XDrawPage > & xDrawPage = mSelectedPages[i]; Reference< css::drawing::XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY ); + if (!xMasterPageTarget.is()) + continue; Reference< css::drawing::XDrawPage > xMasterPage = xMasterPageTarget->getMasterPage(); OUString aSlideId(aId + "_" + OUString::number( i )); commit 830e7b88a4df2e25e5f777b63e400ccfff46c3ed Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Mar 24 15:39:05 2021 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Apr 14 13:37:53 2021 +0200 lok: Disable the "AutoInput" again. This partially reverts "lok: sc - suppress LOK editengine events for the calc input bar." The feature itself is very problematic in Online: 1) causes unwanted jumps to other cells, 2) causes the selection blinking in the cell when typing, and 3) it is very annoying in the form that in which it is implemented in LibreOffice anyway, compared to other office suites. Let's disable it, and enable again when we address the above issues. This (partially) reverts commit 91319ad56887f932b2da334db560d5d0a79a0280. Change-Id: I2234455c29069f74d13896474f3499035935931b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113047 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 5555e2ba9874..a4c63f29dba5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -801,7 +801,6 @@ ScInputHandler::ScInputHandler() if (comphelper::LibreOfficeKit::isActive()) { ScInputHandler::bOptLoaded = true; // Evaluate App options - ScInputHandler::bAutoComplete = true; // Is set in KeyInput } } @@ -2695,7 +2694,9 @@ void ScInputHandler::UpdateFormulaMode() if (pInputWin) pInputWin->SetFormulaMode(true); - if ( bAutoComplete ) + // in LOK, we always need to perform the GetFormulaData() call so + // that the formula insertion works + if (bAutoComplete || comphelper::LibreOfficeKit::isActive()) GetFormulaData(); UpdateParenthesis(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index b6d19cce1fcb..eca643fc5a1c 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1167,6 +1167,11 @@ void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans { SolarMutexGuard aGuard; + // disable word autocompletion + ScAppOptions aAppOptions( SC_MOD()->GetAppOptions() ); + aAppOptions.SetAutoComplete(false); + SC_MOD()->SetAppOptions(aAppOptions); + for (const beans::PropertyValue& rValue : rArguments) { if (rValue.Name == ".uno:SpellOnline" && rValue.Value.has<bool>()) commit 1357c6afde2ee947f94a23280cd9c3f14af8e93c Author: Gökay Şatır <gokay.sa...@collabora.com> AuthorDate: Mon Apr 12 14:36:46 2021 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Apr 14 13:36:01 2021 +0200 Calc: Send sheet invalidation for full row/col ops Change-Id: I4da476804d2dfaf11c1cfd6cbe11cc4a651e0f09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113251 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114038 Tested-by: Jenkins Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com> diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 20693b9f4431..2ab7f9ac1e52 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -2378,8 +2378,8 @@ void ScTiledRenderingTest::testPasteIntoWrapTextCell() pView->GetViewFrame()->GetBindings().Execute(SID_PASTE); Scheduler::ProcessEventsToIdle(); - // SG invalidations for rows - CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry); + // SG invalidations for all + CPPUNIT_ASSERT_EQUAL(OString("all"), aView.m_sInvalidateSheetGeometry); SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr); } diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx index 7b14bed2db6d..ca019047482d 100644 --- a/sc/source/ui/view/cliputil.cxx +++ b/sc/source/ui/view/cliputil.cxx @@ -97,11 +97,21 @@ void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTab } if (comphelper::LibreOfficeKit::isActive()) { - const ScLineBreakCell* pItem = rThisDoc.GetAttr(nThisCol, nThisRow, nThisTab, ATTR_LINEBREAK); - if (pItem && pItem->GetValue()) + bool entireColumnOrRowSelected = false; + if (pOwnClip) + { + ScClipParam clipParam = pOwnClip->GetDocument()->GetClipParam(); + if (clipParam.maRanges.size() > 0) + { + if (clipParam.maRanges[0].aEnd.Col() == MAXCOLCOUNT -1 || clipParam.maRanges[0].aEnd.Row() == MAXROWCOUNT - 1) + entireColumnOrRowSelected = true; + } + } + const SfxBoolItem* pItem = rThisDoc.GetAttr(nThisCol, nThisRow, nThisTab, ATTR_LINEBREAK); + if (pItem->GetValue() || entireColumnOrRowSelected) { ScTabViewShell::notifyAllViewsSheetGeomInvalidation( - pTabViewShell, false /* bColumns */, true /* bRows */, true /* bSizes*/, + pTabViewShell, true /* bColumns */, true /* bRows */, true /* bSizes*/, true /* bHidden */, true /* bFiltered */, true /* bGroups */, nThisTab); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits