compilerplugins/clang/badstatics.cxx | 5 cui/uiconfig/ui/widgettestdialog.ui | 4 desktop/qa/data/validity.ods |binary desktop/qa/desktop_lib/test_desktop_lib.cxx | 78 + desktop/source/lib/init.cxx | 272 +-- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 4 include/LibreOfficeKit/LibreOfficeKit.h | 3 include/LibreOfficeKit/LibreOfficeKit.hxx | 7 include/animations/animationnodehelper.hxx | 93 - include/drawinglayer/primitive2d/baseprimitive2d.hxx | 6 include/sfx2/childwin.hxx | 3 include/sfx2/sidebar/PanelLayout.hxx | 3 include/svx/svdpagv.hxx | 2 include/vcl/ITiledRenderable.hxx | 3 include/vcl/jsdialog/executor.hxx | 10 include/vcl/menu.hxx | 3 include/vcl/weld.hxx | 4 linguistic/source/dlistimp.cxx | 15 linguistic/source/dlistimp.hxx | 17 offapi/com/sun/star/presentation/XSlideShow.idl | 18 sc/inc/validat.hxx | 3 sc/source/core/data/validat.cxx | 27 sc/source/ui/app/inputhdl.cxx | 25 sc/source/ui/app/inputwin.cxx | 51 sc/source/ui/app/scdll.cxx | 4 sc/source/ui/inc/gridwin.hxx | 1 sc/source/ui/inc/inputhdl.hxx | 2 sc/source/ui/inc/inputwin.hxx | 12 sc/source/ui/unoobj/docuno.cxx | 7 sc/source/ui/view/cellsh1.cxx | 10 sc/source/ui/view/cellsh2.cxx | 203 +- sc/source/ui/view/dbfunc.cxx | 3 sc/source/ui/view/drawview.cxx | 22 sc/source/ui/view/gridwin.cxx | 4 sc/source/ui/view/gridwin4.cxx | 7 sc/source/ui/view/tabvwshc.cxx | 2 sc/uiconfig/scalc/ui/sidebarcellappearance.ui | 5 sd/inc/sdpage.hxx | 3 sd/qa/unit/tiledrendering/data/SlideRenderingTest_Animations.odp |binary sd/qa/unit/tiledrendering/data/SlideRenderingTest_Animations_SecondParagraphMultipleEffects.odp |binary sd/qa/unit/tiledrendering/data/SlideRenderingTest_TextBox.odp |binary sd/qa/unit/tiledrendering/tiledrendering.cxx | 250 ++- sd/qa/unit/tiledrendering/tiledrenderingmodeltestbase.cxx | 2 sd/source/core/sdpage.cxx | 34 sd/source/ui/animations/SlideTransitionPane.cxx | 9 sd/source/ui/app/sddll.cxx | 4 sd/source/ui/docshell/docshel2.cxx | 12 sd/source/ui/inc/SlideshowLayerRenderer.hxx | 70 sd/source/ui/inc/unomodel.hxx | 3 sd/source/ui/tools/SlideshowLayerRenderer.cxx | 418 ++++- sd/source/ui/unoidl/unomodel.cxx | 217 -- sd/source/ui/view/drviews1.cxx | 4 sd/source/ui/view/drviews5.cxx | 10 sd/source/ui/view/drviewsg.cxx | 16 sfx2/source/dialog/StyleList.cxx | 12 sfx2/source/dialog/templdlg.cxx | 7 sfx2/source/inc/StyleList.hxx | 1 sfx2/source/sidebar/PanelLayout.cxx | 12 sfx2/source/sidebar/ResourceManager.cxx | 2 sfx2/uiconfig/ui/templatepanel.ui | 7 slideshow/source/engine/slide/slideimpl.cxx | 779 ---------- slideshow/source/engine/slideshowimpl.cxx | 72 slideshow/source/inc/slide.hxx | 8 starmath/source/SmElementsPanel.cxx | 11 starmath/source/SmElementsPanel.hxx | 5 starmath/source/SmPanelFactory.cxx | 5 svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 15 svx/source/svdraw/svdotextdecomposition.cxx | 14 svx/source/svdraw/svdpage.cxx | 19 svx/source/svdraw/svdpagv.cxx | 18 svx/source/tbxctrls/tbunocontroller.cxx | 7 sw/inc/ndtxt.hxx | 11 sw/qa/core/txtnode/data/comment-reply-copy.odt |binary sw/qa/core/txtnode/txtnode.cxx | 36 sw/source/core/crsr/annotationmark.cxx | 12 sw/source/core/txtnode/ndtxt.cxx | 49 sw/source/core/txtnode/thints.cxx | 5 sw/source/uibase/app/swmodule.cxx | 4 sw/source/uibase/docvw/AnnotationWin.cxx | 1 sw/source/uibase/docvw/PostItMgr.cxx | 6 test/source/lokcallback.cxx | 1 vcl/Library_vcl.mk | 2 vcl/inc/jsdialog/enabled.hxx | 3 vcl/inc/jsdialog/jsdialogbuilder.hxx | 238 --- vcl/inc/jsdialog/jsdialogmessages.hxx | 125 + vcl/inc/jsdialog/jsdialogregister.hxx | 52 vcl/inc/jsdialog/jsdialogsender.hxx | 80 + vcl/inc/salvtables.hxx | 5 vcl/jsdialog/enabled.cxx | 23 vcl/jsdialog/executor.cxx | 48 vcl/jsdialog/jsdialogbuilder.cxx | 722 ++------- vcl/jsdialog/jsdialogregister.cxx | 72 vcl/jsdialog/jsdialogsender.cxx | 392 +++++ vcl/source/treelist/svtabbx.cxx | 4 vcl/source/window/builder.cxx | 10 vcl/source/window/menu.cxx | 21 vcl/source/window/toolbox2.cxx | 12 97 files changed, 2645 insertions(+), 2273 deletions(-)
New commits: commit 7961c07609f253385ace14cd090d4e97defb85fa Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Feb 13 15:51:54 2025 +0500 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:33:29 2025 +0100 Setting zoom must also reset offsets in LOK cached view The problem was, that having a spreadsheet with objects, e.g. rectangles, drawn e.g. over M15:O31, and zooming the spreadsheet in Online, the object was painted with substantial offset from the actual placement (it could be three rows below, and some millimeters to the right). The problem was, that respective ViewObjectContact did not reset its maGridOffset upon changing zoom, because it belonged to a view cached in ScGridWindow. It is different from what GetSdrPageView will return in ScDrawView::resetGridOffsetsForAllSdrPageViews; we need to handle that in ScModelObj::setClientZoom, or zooming in Calc would paint drawing objects in wrong positions. The sizes of the objects are still painted incorrectly. Change-Id: Ie2f90568f0570bc0492b614a5fa9128c3e5e9a1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181611 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index e52814bb08ae..c6cd8b93efa4 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -253,6 +253,8 @@ public: // #103911# Set/Get document color for svx at SdrPageViews void SetApplicationDocumentColor(Color aDocumentColor); const Color& GetApplicationDocumentColor() const { return maDocumentColor;} + + void resetGridOffsetsOfAllPageWindows() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index f456712b616f..232c1d0bc9d1 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -509,6 +509,7 @@ public: /// notify this view with new positions for other view's cursors (after zoom) void updateKitOtherCursors() const; void updateOtherKitSelections() const; + void resetCachedViewGridOffsets() const; void notifyKitCellFollowJump() const; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index eed37d2dd8c5..7511d9fce378 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1103,9 +1103,11 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int pHdl->SetRefScale(pViewData->GetZoomX(), pViewData->GetZoomY()); // refresh our view's take on other view's cursors & selections - pViewData->GetActiveWin()->UpdateEditViewPos(); - pViewData->GetActiveWin()->updateKitOtherCursors(); - pViewData->GetActiveWin()->updateOtherKitSelections(); + ScGridWindow* pGridWindow = pViewData->GetActiveWin(); + pGridWindow->UpdateEditViewPos(); + pGridWindow->updateKitOtherCursors(); + pGridWindow->updateOtherKitSelections(); + pGridWindow->resetCachedViewGridOffsets(); if (ScDrawView* pDrawView = pViewData->GetScDrawView()) pDrawView->resetGridOffsetsForAllSdrPageViews(); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index b0c5e396322e..ca8ac4b29f1e 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -964,26 +964,8 @@ void ScDrawView::SyncForGrid( SdrObject* pObj ) void ScDrawView::resetGridOffsetsForAllSdrPageViews() { - SdrPageView* pPageView(GetSdrPageView()); - - if(nullptr == pPageView) - return; - - for(sal_uInt32 a(0); a < pPageView->PageWindowCount(); a++) - { - SdrPageWindow* pPageWindow(pPageView->GetPageWindow(a)); - assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)"); - - if(nullptr != pPageWindow) - { - sdr::contact::ObjectContact& rObjectContact(pPageWindow->GetObjectContact()); - - if(rObjectContact.supportsGridOffsets()) - { - rObjectContact.resetAllGridOffsets(); - } - } - } + if (SdrPageView* pPageView = GetSdrPageView()) + pPageView->resetGridOffsetsOfAllPageWindows(); } bool ScDrawView::calculateGridOffsetForSdrObject( diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 7a13917fd917..2ede73ce874f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1500,6 +1500,13 @@ namespace }; } // anonymous namespace +void ScGridWindow::resetCachedViewGridOffsets() const +{ + if (mpLOKDrawView) + if (SdrPageView* pPageView = mpLOKDrawView->GetSdrPageView()) + pPageView->resetGridOffsetsOfAllPageWindows(); +} + void ScGridWindow::PaintTile( VirtualDevice& rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 8b1f837a6301..1ce89406a18c 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -25,6 +25,7 @@ #include <svx/svdogrp.hxx> #include <svx/svdtypes.hxx> +#include <svx/sdr/contact/objectcontact.hxx> #include <svx/sdr/contact/viewobjectcontactredirector.hxx> #include <algorithm> @@ -898,5 +899,22 @@ void SdrPageView::SetApplicationDocumentColor(Color aDocumentColor) maDocumentColor = aDocumentColor; } +void SdrPageView::resetGridOffsetsOfAllPageWindows() const +{ + for (auto& pPageWindow : maPageWindows) + { + assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)"); + + if (pPageWindow) + { + sdr::contact::ObjectContact& rObjectContact(pPageWindow->GetObjectContact()); + + if (rObjectContact.supportsGridOffsets()) + { + rObjectContact.resetAllGridOffsets(); + } + } + } +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 3f7c25a687e95bfc46352ef55c2f6b420047a7b2 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Feb 5 14:10:56 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:33:14 2025 +0100 jsdialog: toolbar set_item_active method it was not updating state when toolbar in style sidebar was used Change-Id: Ie1a6f9fe8cc867d30abe2a7359bda42163a0d92e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181170 (cherry picked from commit 7e5075fea733d68c8167ac33e5ce34d89b50a6a9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181216 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 4484292fea95..944b96c75e86 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -644,6 +644,7 @@ public: JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + virtual void set_item_active(const OUString& rIdent, bool bActive) override; virtual void set_menu_item_active(const OUString& rIdent, bool bActive) override; virtual void set_item_sensitive(const OUString& rIdent, bool bSensitive) override; virtual void set_item_icon_name(const OUString& rIdent, const OUString& rIconName) override; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index dd738c2e3037..81c4e178ab2f 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1571,6 +1571,15 @@ JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBu { } +void JSToolbar::set_item_active(const OUString& rIdent, bool bActive) +{ + bool bWasActive = get_item_active(rIdent); + SalInstanceToolbar::set_item_active(rIdent, bActive); + + if (bWasActive != bActive) + sendUpdate(); +} + void JSToolbar::set_menu_item_active(const OUString& rIdent, bool bActive) { bool bWasActive = get_menu_item_active(rIdent); commit 5309fb15c0edfdc30a34bfdd78bd7dda73b96594 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Fri Jan 24 18:06:18 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:33:08 2025 +0100 sc: convert data validity dialog async Change-Id: Ifef985c15a58c1c081f9a011e174e3b2547f3ea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179402 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180704 Tested-by: Jenkins diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 38a2e62ac177..553ef3401f14 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -920,102 +920,135 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) auto xDlg = std::make_shared<ScValidationDlg>(pParentWin, &aArgSet, pTabViewShell); ScValidationRegisteredDlg aRegisterThatDlgExists(pParentWin, xDlg); - short nResult = xDlg->run(); - if ( nResult == RET_OK ) + struct lcl_auxData { - const SfxItemSet* pOutSet = xDlg->GetOutputItemSet(); - - if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_MODE ) ) - eMode = static_cast<ScValidationMode>(pItem->GetValue()); - if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_CONDMODE ) ) - eOper = static_cast<ScConditionMode>(pItem->GetValue()); - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_VALUE1 ) ) + ScAddress aCursorPos; + ScValidationMode eMode; + ScConditionMode eOper; + OUString aExpr1; + OUString aExpr2; + bool bBlank; + sal_Int16 nListType; + bool bShowHelp; + OUString aHelpTitle; + OUString aHelpText; + bool bShowError; + ScValidErrorStyle eErrStyle; + OUString aErrTitle; + OUString aErrText; + bool bCaseSensitive; + }; + + std::shared_ptr<lcl_auxData> pAuxData = std::make_shared<lcl_auxData>(lcl_auxData{ + aCursorPos, eMode, eOper, aExpr1, aExpr2, bBlank, nListType, bShowHelp, + aHelpTitle, aHelpText, bShowError, eErrStyle, aErrTitle, aErrText, bCaseSensitive}); + + auto xRequest = std::make_shared<SfxRequest>(rReq); + rReq.Ignore(); // the 'old' request is not relevant any more + SfxTabDialogController::runAsync( + xDlg, + [&rDoc, xRequest=std::move(xRequest), pAuxData, xDlg, pTabViewShell](sal_Int32 nResult) + { + if ( nResult == RET_OK ) { - OUString aTemp1 = pItem->GetValue(); - if (eMode == SC_VALID_DATE || eMode == SC_VALID_TIME) + const SfxItemSet* pOutSet = xDlg->GetOutputItemSet(); + + if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_MODE ) ) + pAuxData->eMode = static_cast<ScValidationMode>(pItem->GetValue()); + if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_CONDMODE ) ) + pAuxData->eOper = static_cast<ScConditionMode>(pItem->GetValue()); + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_VALUE1 ) ) { - sal_uInt32 nNumIndex = 0; - double nVal; - if (rDoc.GetFormatTable()->IsNumberFormat(aTemp1, nNumIndex, nVal)) - aExpr1 = ::rtl::math::doubleToUString( nVal, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::getLocaleData().getNumDecimalSep()[0], true); + OUString aTemp1 = pItem->GetValue(); + if (pAuxData->eMode == SC_VALID_DATE || pAuxData->eMode == SC_VALID_TIME) + { + sal_uInt32 nNumIndex = 0; + double nVal; + if (rDoc.GetFormatTable()->IsNumberFormat(aTemp1, nNumIndex, nVal)) + pAuxData->aExpr1 = ::rtl::math::doubleToUString( nVal, + rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, + ScGlobal::getLocaleData().getNumDecimalSep()[0], true); + else + pAuxData->aExpr1 = aTemp1; + } else - aExpr1 = aTemp1; + pAuxData->aExpr1 = aTemp1; } - else - aExpr1 = aTemp1; - } - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_VALUE2 ) ) - { - OUString aTemp2 = pItem->GetValue(); - if (eMode == SC_VALID_DATE || eMode == SC_VALID_TIME) + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_VALUE2 ) ) { - sal_uInt32 nNumIndex = 0; - double nVal; - if (rDoc.GetFormatTable()->IsNumberFormat(aTemp2, nNumIndex, nVal)) - aExpr2 = ::rtl::math::doubleToUString( nVal, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::getLocaleData().getNumDecimalSep()[0], true); - else - aExpr2 = aTemp2; - if ( eMode == SC_VALID_TIME ) { - sal_Int32 wraparound = aExpr1.compareTo(aExpr2); - if (wraparound > 0) { - if (eOper == ScConditionMode::Between) { - eOper = ScConditionMode::NotBetween; - std::swap( aExpr1, aExpr2 ); - } - else if (eOper == ScConditionMode::NotBetween) { - eOper = ScConditionMode::Between; - std::swap( aExpr1, aExpr2 ); + OUString aTemp2 = pItem->GetValue(); + if (pAuxData->eMode == SC_VALID_DATE || pAuxData->eMode == SC_VALID_TIME) + { + sal_uInt32 nNumIndex = 0; + double nVal; + if (rDoc.GetFormatTable()->IsNumberFormat(aTemp2, nNumIndex, nVal)) + pAuxData->aExpr2 = ::rtl::math::doubleToUString( nVal, + rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, + ScGlobal::getLocaleData().getNumDecimalSep()[0], true); + else + pAuxData->aExpr2 = aTemp2; + if ( pAuxData->eMode == SC_VALID_TIME ) { + sal_Int32 wraparound = pAuxData->aExpr1.compareTo(pAuxData->aExpr2); + if (wraparound > 0) { + if (pAuxData->eOper == ScConditionMode::Between) { + pAuxData->eOper = ScConditionMode::NotBetween; + std::swap( pAuxData->aExpr1, pAuxData->aExpr2 ); + } + else if (pAuxData->eOper == ScConditionMode::NotBetween) { + pAuxData->eOper = ScConditionMode::Between; + std::swap( pAuxData->aExpr1, pAuxData->aExpr2 ); + } } } } + else + pAuxData->aExpr2 = aTemp2; } - else - aExpr2 = aTemp2; + if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_BLANK ) ) + pAuxData->bBlank = pItem->GetValue(); + if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_CASESENS ) ) + pAuxData->bCaseSensitive = pItem->GetValue(); + if ( const SfxInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_LISTTYPE ) ) + pAuxData->nListType = pItem->GetValue(); + + if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_SHOWHELP ) ) + pAuxData->bShowHelp = pItem->GetValue(); + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_HELPTITLE ) ) + pAuxData->aHelpTitle = pItem->GetValue(); + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_HELPTEXT ) ) + pAuxData->aHelpText = pItem->GetValue(); + + if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_SHOWERR ) ) + pAuxData->bShowError = pItem->GetValue(); + if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRSTYLE ) ) + pAuxData->eErrStyle = static_cast<ScValidErrorStyle>(pItem->GetValue()); + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRTITLE ) ) + pAuxData->aErrTitle = pItem->GetValue(); + if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRTEXT ) ) + pAuxData->aErrText = pItem->GetValue(); + + ScValidationData aData( pAuxData->eMode, pAuxData->eOper, pAuxData->aExpr1, pAuxData->aExpr2, rDoc, pAuxData->aCursorPos ); + aData.SetIgnoreBlank( pAuxData->bBlank ); + aData.SetCaseSensitive( pAuxData->bCaseSensitive ); + aData.SetListType( pAuxData->nListType ); + + aData.SetInput(pAuxData->aHelpTitle, pAuxData->aHelpText); // sets bShowInput to TRUE + if (!pAuxData->bShowHelp) + aData.ResetInput(); // reset only bShowInput + + aData.SetError(pAuxData->aErrTitle, pAuxData->aErrText, pAuxData->eErrStyle); // sets bShowError to TRUE + if (!pAuxData->bShowError) + aData.ResetError(); // reset only bShowError + + pTabViewShell->SetValidation( aData ); + pTabViewShell->TestHintWindow(); + xRequest->Done( *pOutSet ); } - if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_BLANK ) ) - bBlank = pItem->GetValue(); - if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_CASESENS ) ) - bCaseSensitive = pItem->GetValue(); - if ( const SfxInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_LISTTYPE ) ) - nListType = pItem->GetValue(); - - if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_SHOWHELP ) ) - bShowHelp = pItem->GetValue(); - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_HELPTITLE ) ) - aHelpTitle = pItem->GetValue(); - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_HELPTEXT ) ) - aHelpText = pItem->GetValue(); - - if ( const SfxBoolItem* pItem = pOutSet->GetItemIfSet( FID_VALID_SHOWERR ) ) - bShowError = pItem->GetValue(); - if ( const SfxUInt16Item* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRSTYLE ) ) - eErrStyle = static_cast<ScValidErrorStyle>(pItem->GetValue()); - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRTITLE ) ) - aErrTitle = pItem->GetValue(); - if ( const SfxStringItem* pItem = pOutSet->GetItemIfSet( FID_VALID_ERRTEXT ) ) - aErrText = pItem->GetValue(); - - ScValidationData aData( eMode, eOper, aExpr1, aExpr2, rDoc, aCursorPos ); - aData.SetIgnoreBlank( bBlank ); - aData.SetCaseSensitive( bCaseSensitive ); - aData.SetListType( nListType ); - - aData.SetInput(aHelpTitle, aHelpText); // sets bShowInput to TRUE - if (!bShowHelp) - aData.ResetInput(); // reset only bShowInput - - aData.SetError(aErrTitle, aErrText, eErrStyle); // sets bShowError to TRUE - if (!bShowError) - aData.ResetError(); // reset only bShowError - - pTabViewShell->SetValidation( aData ); - pTabViewShell->TestHintWindow(); - rReq.Done( *pOutSet ); - } + else + { + pTabViewShell->TestHintWindow(); + } + }); } } break; commit 77fa12d67caa515bb7786b7a6aa97e5ffb86bbd3 Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Thu Jan 9 18:14:08 2025 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:33:02 2025 +0100 cool#10967: LOK Impress: Invalidate tiles on switching the view mode. Issue: * Select second slide (some slide other than the first one). * Switch to notes view. * Switch back to normal view. * Edit textbox content. * Switch to notes view again. * Notice that the preview in notes view is not updated. Reason: * Invalidate tiles callback is called before the view is connected. Solution: * Call invalidation on connection. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: I997c603e11024743420ced659c7d0b0f1c5bc937 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180022 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181480 Tested-by: Jenkins diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 6a3ea2edfda1..caf6c44f1778 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -39,6 +39,9 @@ #include <rtl/character.hxx> #include <tools/debug.hxx> +#include <sfx2/lokhelper.hxx> +#include <comphelper/lok.hxx> + namespace sd { /** @@ -147,6 +150,15 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect, void DrawDocShell::Connect(ViewShell* pViewSh) { mpViewShell = pViewSh; + + if (comphelper::LibreOfficeKit::isActive()) + { + SfxViewShell* sfxViewShell = mpViewShell->GetViewShell(); + if (sfxViewShell) + { + mpViewShell->GetViewShell()->libreOfficeKitViewInvalidateTilesCallback(nullptr, sfxViewShell->getPart(), sfxViewShell->getEditMode()); + } + } } void DrawDocShell::Disconnect(ViewShell const * pViewSh) commit ea41e4675d9f74eff4d5693376801558b9cc82c7 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Jan 20 13:20:27 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:57 2025 +0100 jsdialog: scroll to row before use If we first select lat row, then try to select some top row in LOK -> we will not get correct result for popup menu as the coordinates will be negative and we will also fail on assertion. We need to scroll row to be visible first Change-Id: Ib8a76eff093817fe7e3a777aa8cecf1246fae25f (cherry picked from commit 62b81789a7c16925c4b15692e40b1da6badb73d1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180509 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 2385c19f4a4a..e5ea1f19a770 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -583,6 +583,9 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap std::unique_ptr<weld::TreeIter> itEntry(pTreeView->make_iterator()); if (pTreeView->get_iter_abs_pos(*itEntry, nEntryAbsPos)) { + // avoid negative coordinates and crash + pTreeView->scroll_to_row(*itEntry); + tools::Rectangle aRect = pTreeView->get_row_area(*itEntry); CommandEvent aCommand(aRect.Center(), CommandEventId::ContextMenu); commit a3b080676748b02286ed49c6f1f7e041446a0778 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Mon Dec 30 02:20:22 2024 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:51 2025 +0100 sc: make data validy error dialog async (invalid value error) Change-Id: Icd077776b26e21b226b4dee5beb1a5ff6dcf301a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179509 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 495be2dcb34d22af59a2028d3a686a0d48774166) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180286 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <lpra...@collabora.com> diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index 4afd9e2ba8f2..863397f3ca57 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -159,7 +159,8 @@ public: OUString& rStrResult, double& nVal, sal_uInt32& nFormat, bool& bIsVal) const; // TRUE -> break - bool DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos) const; + void DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos, + std::function<void(bool forget)> callback) const; void DoCalcError( ScFormulaCell* pCell ) const; bool IsEmpty() const; diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index a830da8cef34..744cee56adeb 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -245,10 +245,10 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput, // Macro not found (only with input) { //TODO: different error message, if found, but not bAllowed ?? - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, VclMessageType::Warning, VclButtonsType::Ok, ScResId(STR_VALID_MACRONOTFOUND))); - xBox->run(); + xBox->runAsync(xBox, [] (sal_uInt32){ }); } return bScriptReturnedFalse; @@ -351,10 +351,10 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput, if ( !bDone && !pCell ) // Macro not found (only with input) { //TODO: different error message, if found, but not bAllowed ?? - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, VclMessageType::Warning, VclButtonsType::Ok, ScResId(STR_VALID_MACRONOTFOUND))); - xBox->run(); + xBox->runAsync(xBox, [](sal_uInt32) {}); } return bRet; @@ -373,14 +373,16 @@ IMPL_STATIC_LINK_NOARG(ScValidationData, InstallLOKNotifierHdl, void*, vcl::ILib // true -> abort -bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, - const ScAddress& rPos) const +void ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, const ScAddress& rPos, + std::function<void(bool forget)> callback) const { - if ( eErrorStyle == SC_VALERR_MACRO ) - return DoMacro(rPos, rInput, nullptr, pParent); + if ( eErrorStyle == SC_VALERR_MACRO ) { + DoMacro(rPos, rInput, nullptr, pParent); + return; + } if (!bShowError) - return true; + return; // Output error message @@ -407,7 +409,7 @@ bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, break; } - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eType, + std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eType, eStyle, aMessage, SfxViewShell::Current())); xBox->set_title(aTitle); xBox->SetInstallLOKNotifierHdl(LINK(nullptr, ScValidationData, InstallLOKNotifierHdl)); @@ -424,9 +426,8 @@ bool ScValidationData::DoError(weld::Window* pParent, const OUString& rInput, break; } - short nRet = xBox->run(); - - return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL ); + xBox->runAsync(xBox, [&, callback](sal_uInt32 result) + { callback(eErrorStyle == SC_VALERR_STOP || result == RET_CANCEL); }); } bool ScValidationData::IsDataValidCustom( diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d62f61f0ef70..dece0aa45cec 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3118,13 +3118,6 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL ImplCreateEditEngine(); - bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX ); - - SfxApplication* pSfxApp = SfxGetpApp(); - std::unique_ptr<EditTextObject> pObject; - std::unique_ptr<ScPatternAttr> pCellAttrs; - bool bForget = false; // Remove due to validity? - OUString aString = GetEditText(mpEditEngine.get()); OUString aPreAutoCorrectString(aString); EditView* pActiveView = pTopView ? pTopView : pTableView; @@ -3193,12 +3186,24 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL return; } - if (pData->DoError(pActiveViewSh->GetFrameWeld(), aString, aCursorPos)) - bForget = true; // Do not take over input - + pData->DoError( + pActiveViewSh->GetFrameWeld(), aString, aCursorPos, + [this, nBlockMode, &aString, &aPreAutoCorrectString](bool bForget) + { EnterHandler2(nBlockMode, bForget, aString, aPreAutoCorrectString); }); + return; } } } + EnterHandler2(nBlockMode, false, aString, aPreAutoCorrectString); +} + +void ScInputHandler::EnterHandler2(ScEnterMode nBlockMode, bool bForget, OUString& aString, + OUString& aPreAutoCorrectString) +{ + std::unique_ptr<EditTextObject> pObject; + std::unique_ptr<ScPatternAttr> pCellAttrs; + bool bMatrix = (nBlockMode == ScEnterMode::MATRIX); + SfxApplication* pSfxApp = SfxGetpApp(); // Check for input into DataPilot table if ( bModified && !bForget ) diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 3067dd819397..08fff9269dbd 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -198,6 +198,8 @@ public: bool KeyInput( const KeyEvent& rKEvt, bool bStartEdit ); void EnterHandler( ScEnterMode nBlockMode = ScEnterMode::NORMAL, bool bBeforeSavingInLOK = false ); + void EnterHandler2(ScEnterMode nBlockMode, bool bForget, OUString& aString, + OUString& aPreAutoCorrectString); void CancelHandler(); void SetReference( const ScRange& rRef, const ScDocument& rDoc ); void AddRefEntry(); commit 2b863ab858735b97c71fa54e572edf2240c33e26 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Fri Jan 10 02:11:10 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:45 2025 +0100 math: store main viewshell id in math view shell problem: when we enter to edit a formula a new view shell is created. In LOK all the JSwidgets would be mapped to this window id. But when LOK requests widgets we get the requests from the main viewshell and we can't find any widgets mapped to the main viewshell which means LOK can't load any widgets. Currently there's no mechanism to find the sub viewshell Change-Id: I4f9ce161101ef6815f4d9e712d9bd42f0dc83ea3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180038 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180287 Tested-by: Jenkins diff --git a/include/sfx2/sidebar/PanelLayout.hxx b/include/sfx2/sidebar/PanelLayout.hxx index 3058c9d514dd..d4f17ebd108e 100644 --- a/include/sfx2/sidebar/PanelLayout.hxx +++ b/include/sfx2/sidebar/PanelLayout.hxx @@ -37,6 +37,9 @@ private: public: PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription); + PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription, + sal_uInt64 nWindowId); + void SetPanel(sfx2::sidebar::Panel* pPanel); virtual ~PanelLayout(); diff --git a/sfx2/source/sidebar/PanelLayout.cxx b/sfx2/source/sidebar/PanelLayout.cxx index afe018db8a93..d741106369a4 100644 --- a/sfx2/source/sidebar/PanelLayout.cxx +++ b/sfx2/source/sidebar/PanelLayout.cxx @@ -17,8 +17,16 @@ using namespace sfx2::sidebar; -PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription) - : m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, false, reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))) +PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID, + const OUString& rUIXMLDescription) + : PanelLayout(pParent, rID, rUIXMLDescription, + reinterpret_cast<sal_uInt64>(SfxViewShell::Current())) +{ +} + +PanelLayout::PanelLayout(weld::Widget* pParent, const OUString& rID, + const OUString& rUIXMLDescription, sal_uInt64 nWindowId) + : m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, false, nWindowId)) , m_xContainer(m_xBuilder->weld_container(rID)) , m_pPanel(nullptr) { diff --git a/starmath/source/SmElementsPanel.cxx b/starmath/source/SmElementsPanel.cxx index afe27a80fc50..f6826f8df31f 100644 --- a/starmath/source/SmElementsPanel.cxx +++ b/starmath/source/SmElementsPanel.cxx @@ -35,15 +35,16 @@ namespace sm::sidebar { // static -std::unique_ptr<PanelLayout> SmElementsPanel::Create(weld::Widget& rParent, - const SfxBindings& rBindings) +std::unique_ptr<PanelLayout> +SmElementsPanel::Create(weld::Widget& rParent, const SfxBindings& rBindings, sal_uInt64 nWindowId) { - return std::make_unique<SmElementsPanel>(rParent, rBindings); + return std::make_unique<SmElementsPanel>(rParent, rBindings, nWindowId); } -SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings) +SmElementsPanel::SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings, + sal_uInt64 nWindowId) : PanelLayout(&rParent, u"MathElementsPanel"_ustr, - u"modules/smath/ui/sidebarelements_math.ui"_ustr) + u"modules/smath/ui/sidebarelements_math.ui"_ustr, nWindowId) , mrBindings(rBindings) , mxCategoryList(m_xBuilder->weld_combo_box(u"categorylist"_ustr)) , mxElementsControl(std::make_unique<SmElementsControl>( diff --git a/starmath/source/SmElementsPanel.hxx b/starmath/source/SmElementsPanel.hxx index c1f4b2ab31f3..d77518630505 100644 --- a/starmath/source/SmElementsPanel.hxx +++ b/starmath/source/SmElementsPanel.hxx @@ -36,11 +36,12 @@ namespace sm::sidebar class SmElementsPanel : public PanelLayout, public SfxListener { public: - static std::unique_ptr<PanelLayout> Create(weld::Widget& rParent, const SfxBindings& rBindings); + static std::unique_ptr<PanelLayout> Create(weld::Widget& rParent, const SfxBindings& rBindings, + sal_uInt64 nWindowId); void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); - SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings); + SmElementsPanel(weld::Widget& rParent, const SfxBindings& rBindings, sal_uInt64 nWindowId); ~SmElementsPanel(); private: diff --git a/starmath/source/SmPanelFactory.cxx b/starmath/source/SmPanelFactory.cxx index 833530ace90d..644e9ca6c6a3 100644 --- a/starmath/source/SmPanelFactory.cxx +++ b/starmath/source/SmPanelFactory.cxx @@ -28,6 +28,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <sfx2/sidebar/SidebarPanelBase.hxx> #include <vcl/weldutils.hxx> +#include <view.hxx> #include "SmElementsPanel.hxx" #include "SmPropertiesPanel.hxx" @@ -91,7 +92,9 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen } else if (ResourceURL.endsWith("/MathElementsPanel")) { - pPanel = sm::sidebar::SmElementsPanel::Create(*pParent, *pBindings); + SfxViewShell* pViewShell = SfxViewShell::Get(xFrame->getController()); + pPanel = sm::sidebar::SmElementsPanel::Create(*pParent, *pBindings, + reinterpret_cast<sal_uInt64>(pViewShell)); aLayoutSize = { 300, -1, -1 }; } commit 73cbfa230d290145c912ca41709b32804e2920be Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Thu Jan 9 22:02:37 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:40 2025 +0100 svx: avoid emptying sidebar properties these properties are either updated or reformatted based on *Blanked variables so no need to do an extra update problem: emptying these properties causes to lose measurement units in LOK. It happens due to second time this sidebar is not completly initialised but just updated the value of the fields so units are lost for LOK. Change-Id: Id32638686578652ab4ffa25a638b5308c46eea2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179583 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180288 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <lpra...@collabora.com> diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 04844ff1fee2..d6d232286495 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -552,8 +552,6 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; } } - - mxMtrWidth->set_text(u""_ustr); mbMtrWidthBlanked = true; break; @@ -578,8 +576,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; } } - - mxMtrHeight->set_text( u""_ustr); + mbMtrHeightBlanked = true; break; case SID_ATTR_TRANSFORM_POS_X: @@ -602,8 +599,6 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; } } - - mxMtrPosX->set_text(u""_ustr); mbMtrPosXBlanked = true; break; @@ -627,8 +622,6 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; } } - - mxMtrPosY->set_text(u""_ustr); mbMtrPosYBlanked = true; break; @@ -735,8 +728,6 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; } } - - mxMtrAngle->set_text(u""_ustr); mbMtrAngleBlanked = true; mxCtrlDial->SetRotation( 0_deg100 ); break; @@ -935,7 +926,6 @@ void PosSizePropertyPanel::MetricState(SfxItemState eState, const SfxPoolItem* p SetFieldUnit( *mxMtrPosX, meDlgUnit, true ); if (bPosXBlank) { - mxMtrPosX->set_text(u""_ustr); mbMtrPosXBlanked = true; } @@ -944,7 +934,6 @@ void PosSizePropertyPanel::MetricState(SfxItemState eState, const SfxPoolItem* p SetFieldUnit( *mxMtrPosY, meDlgUnit, true ); if (bPosYBlank) { - mxMtrPosY->set_text(u""_ustr); mbMtrPosYBlanked = true; } @@ -955,7 +944,6 @@ void PosSizePropertyPanel::MetricState(SfxItemState eState, const SfxPoolItem* p SetFieldUnit( *mxMtrWidth, meDlgUnit, true ); if (bWidthBlank) { - mxMtrWidth->set_text(u""_ustr); mbMtrWidthBlanked = true; } @@ -964,7 +952,6 @@ void PosSizePropertyPanel::MetricState(SfxItemState eState, const SfxPoolItem* p SetFieldUnit( *mxMtrHeight, meDlgUnit, true ); if (bHeightBlank) { - mxMtrHeight->set_text(u""_ustr); mbMtrHeightBlanked = true; } } commit 6faf1b5e3ec507cee9823ac8c01c4c1da6777cda Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Tue Jan 7 11:14:10 2025 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:34 2025 +0100 Online Calc: Update view pos after setting the client zoom. Issue: If user zooms in/out while editing is active, the edited area is misplaced and tiles are rendering wrong. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: Ib9ec8237da52363bffcf586b85a1bd041785c693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179857 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181481 Tested-by: Jenkins diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 06e8f47a6b9c..eed37d2dd8c5 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1103,6 +1103,7 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int pHdl->SetRefScale(pViewData->GetZoomX(), pViewData->GetZoomY()); // refresh our view's take on other view's cursors & selections + pViewData->GetActiveWin()->UpdateEditViewPos(); pViewData->GetActiveWin()->updateKitOtherCursors(); pViewData->GetActiveWin()->updateOtherKitSelections(); commit b782ae2b80af13fe06d6cfed485ae9a677467f77 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Jan 8 12:09:48 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:28 2025 +0100 jsdialog: export sortable property for treeview columns Signed-off-by: Szymon Kłos <szymon.k...@collabora.com> Change-Id: I2e2e6ce0a50239e29ac51b3e6974ed2d3bd2e421 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179949 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180933 Tested-by: Jenkins diff --git a/cui/uiconfig/ui/widgettestdialog.ui b/cui/uiconfig/ui/widgettestdialog.ui index 4bb3adc2d85c..0441ae7c77b8 100644 --- a/cui/uiconfig/ui/widgettestdialog.ui +++ b/cui/uiconfig/ui/widgettestdialog.ui @@ -617,6 +617,8 @@ <object class="GtkTreeViewColumn" id="treeviewcolumn1"> <property name="resizable">True</property> <property name="spacing">6</property> + <property name="sort-indicator">True</property> + <property name="clickable">True</property> <property name="title" translatable="no">Column 1</property> <child> <object class="GtkCellRendererText" id="cellrenderer1"/> @@ -630,6 +632,8 @@ <object class="GtkTreeViewColumn" id="treeviewcolumn2"> <property name="resizable">True</property> <property name="spacing">6</property> + <property name="sort-indicator">True</property> + <property name="clickable">True</property> <property name="title" translatable="no">Column 2</property> <child> <object class="GtkCellRendererText" id="cellrenderer2"/> diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index b4d15cde9aaf..067da05f8985 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -644,7 +644,9 @@ void SvHeaderTabListBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) for(sal_uInt16 i = 0; i < pHeaderBar->GetItemCount(); i++) { auto aNode = rJsonWriter.startStruct(); - rJsonWriter.put("text", pHeaderBar->GetItemText(pHeaderBar->GetItemId(i))); + sal_uInt16 nItemId = pHeaderBar->GetItemId(i); + rJsonWriter.put("text", pHeaderBar->GetItemText(nItemId)); + rJsonWriter.put("sortable", !!(pHeaderBar->GetItemBits(nItemId) & HeaderBarItemBits::CLICKABLE)); } } commit 1588ad1f32a20947f3c6245a7aeb2aa259dcbdeb Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Tue Dec 24 11:59:39 2024 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:22 2025 +0100 lok: send username of the person who removed comments This can be userful to know when a user is editing comment and another user deletes it. It will help to identify and inform about the conflict to relevent users only Change-Id: I81f5edc8f6cbb85ad00e03b5bf668b68eeae1ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179298 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 0b3e73526496875735eeb657929d94897a840b02) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180289 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <lpra...@collabora.com> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 5bcbdee0c061..116cc7961d9d 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -183,6 +183,12 @@ namespace { aAnnotation.put("textRange", sRects.getStr()); aAnnotation.put("layoutStatus", pItem->mLayoutStatus); } + if (nType == CommentNotificationType::Remove && comphelper::LibreOfficeKit::isActive()) + { + // Redline author is basically the author which has made the modification rather than author of the comments + // This is important to know who removed the comment + aAnnotation.put("author", SwModule::get()->GetRedlineAuthor(SwModule::get()->GetRedlineAuthor())); + } boost::property_tree::ptree aTree; aTree.add_child("comment", aAnnotation); commit c316dc673cf6ad144b9249b99c53bbfdea17bef2 Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Tue Dec 24 11:38:39 2024 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:17 2025 +0100 cool#10794 Test for: Don't open validity dropdown in readOnly mode. Issue: In readonly mode, validity dropdown is still usable. There are 2 tests here. 1 is to ensure that dropdown opens and it also exists as an example on dropdown events. The other is to ensure that dropdown is not opened in readonly mode. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: Id73c4421454af2af4f306925d6c628f776ecd2d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179303 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179697 Tested-by: Jenkins diff --git a/desktop/qa/data/validity.ods b/desktop/qa/data/validity.ods new file mode 100644 index 000000000000..9f9677242ff0 Binary files /dev/null and b/desktop/qa/data/validity.ods differ diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index cc8bbe5400e9..a91270f94bad 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -193,6 +193,8 @@ public: void testCommentsCallbacksWriter(); void testCommentsAddEditDeleteDraw(); void testCommentsInReadOnlyMode(); + void testCalcValidityDropdown(); + void testCalcValidityDropdownInReadonlyMode(); void testRunMacro(); void testExtractParameter(); void testGetSignatureState_NonSigned(); @@ -264,6 +266,8 @@ public: CPPUNIT_TEST(testCommentsCallbacksWriter); CPPUNIT_TEST(testCommentsAddEditDeleteDraw); CPPUNIT_TEST(testCommentsInReadOnlyMode); + CPPUNIT_TEST(testCalcValidityDropdown); + CPPUNIT_TEST(testCalcValidityDropdownInReadonlyMode); CPPUNIT_TEST(testRunMacro); CPPUNIT_TEST(testExtractParameter); CPPUNIT_TEST(testGetSignatureState_Signed); @@ -2130,6 +2134,7 @@ class ViewCallback int mnView; public: OString m_aCellFormula; + boost::property_tree::ptree m_JSONDialog; int m_nTableSelectionCount; int m_nColorPaletteCallbackCount = 0; bool m_bEmptyTableSelection; @@ -2214,6 +2219,13 @@ public: ++m_nColorPaletteCallbackCount; } break; + case LOK_CALLBACK_JSDIALOG: + { + m_JSONDialog.clear(); + std::stringstream aStream(pPayload); + boost::property_tree::read_json(aStream, m_JSONDialog); + } + break; } } }; @@ -2745,6 +2757,72 @@ void DesktopLOKTest::testCommentsInReadOnlyMode() //CPPUNIT_ASSERT_EQUAL(nCommentId, aView.m_aCommentCallbackResult.get<int>("id")); } +void DesktopLOKTest::testCalcValidityDropdown() +{ + LibLODocument_Impl* pDocument = loadDoc("validity.ods"); + Scheduler::ProcessEventsToIdle(); + pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}"); + Scheduler::ProcessEventsToIdle(); + + ViewCallback aView(pDocument); + Scheduler::ProcessEventsToIdle(); + + // Select row 1 from column 1. + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, 1000, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, 1000, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + + // Open dropdown. + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, 1380, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, 1380, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + + // Select some value from dropdown. + pDocument->pClass->sendDialogEvent(pDocument, aView.m_JSONDialog.get_child("id").get_value<int>(), "{\"id\":\"list\", \"cmd\": \"select\", \"data\": \"3\", \"type\": \"treeview\"}"); + Scheduler::ProcessEventsToIdle(); + + // Activate the selected value. + pDocument->pClass->sendDialogEvent(pDocument, aView.m_JSONDialog.get_child("id").get_value<int>(), "{\"id\":\"list\", \"cmd\": \"activate\", \"data\": \"3\", \"type\": \"treeview\"}"); + Scheduler::ProcessEventsToIdle(); + + // Check the content of the current cell. The selected value of the dropdown was 1. It should be 4 now. + char* pCellContent = pDocument->pClass->getTextSelection(pDocument, "text/plain;charset=utf-8", nullptr); + CPPUNIT_ASSERT_EQUAL("4"_ostr, OString(pCellContent)); + free(pCellContent); +} + +void DesktopLOKTest::testCalcValidityDropdownInReadonlyMode() +{ + LibLODocument_Impl* pDocument = loadDoc("validity.ods"); + Scheduler::ProcessEventsToIdle(); + pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}"); + Scheduler::ProcessEventsToIdle(); + + ViewCallback aView(pDocument); + Scheduler::ProcessEventsToIdle(); + + int viewId = pDocument->m_pDocumentClass->getView(pDocument); + SfxLokHelper::setViewReadOnly(viewId, true); + Scheduler::ProcessEventsToIdle(); + + // Select row 1 from column 1. + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, 1000, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, 1000, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + + // Attempt to open dropdown. + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONDOWN, 1380, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + pDocument->pClass->postMouseEvent(pDocument, LOK_MOUSEEVENT_MOUSEBUTTONUP, 1380, 150, 1, 1, 0); + Scheduler::ProcessEventsToIdle(); + + // Dropdown should not open in readonly mode. + CPPUNIT_ASSERT_EQUAL(true, aView.m_JSONDialog.empty()); +} + void DesktopLOKTest::testRunMacro() { LibLibreOffice_Impl aOffice; commit 9f2e39f5d2d04acc1a95238861e266772a2de000 Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Thu Dec 12 19:28:47 2024 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:11 2025 +0100 cool#10794 Don't open validity dropdown in readOnly mode. Issue: In readonly mode, validity dropdown is still usable. Since the action is not performed via an uno command but event handling (function name is also: HandleMouseButtonDown), we need to add a guard to event handler. This issue is online only. Desktop view doesn't have the issue. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: Ic0883d610f484cbc2b777200333e6ae5d14f52d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178378 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179696 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 2a73bc1857fa..eb7cbb2e27a7 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2127,6 +2127,10 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta if (!bWasMouseCaptured && IsMouseCaptured()) ReleaseMouse(); + const bool lokReadOnly = comphelper::LibreOfficeKit::isActive() && pViewSh->IsLokReadOnlyView(); + if (lokReadOnly) + return; // Return as if the action was performed, so the flow is not affected. + LaunchDataSelectMenu( aListValPos.Col(), aListValPos.Row() ); nMouseStatus = SC_GM_FILTER; // not set in DoAutoFilterMenue for bDataSelect commit d3a136d4ea65c6abe052eefd9f11296526e577d0 Author: Darshan-upadhyay1110 <darshan.upadh...@collabora.com> AuthorDate: Wed Dec 25 12:32:11 2024 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:32:01 2025 +0100 Add missing a11y information for toolitem - Pass `aria` label and description for `ToolItem` in Sidebar cell appearance. - Enhance accessibility with `aria` attributes for better screen reader support. Change-Id: Iec434aee339db3a73b70a0baec33aad5599412e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179324 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 9d98c8133e008ea0b960a0eb51e0503b1fba02de) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179601 Tested-by: Jenkins diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui index 1611c326d2ac..01bd2a1fd38b 100644 --- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui +++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui @@ -82,6 +82,11 @@ <property name="homogeneous">True</property> </packing> </child> + <child internal-child="accessible"> + <object class="AtkObject" id="cellbordertype-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="sidebarcellappearance|cellbordertype-atkobject">Border Style</property> + </object> + </child> </object> <packing> <property name="left-attach">0</property> diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index c0c806038060..9bd4e5b69140 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1748,6 +1748,18 @@ void ToolBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) if (!IsItemEnabled(nId)) rJsonWriter.put("enabled", false); + OUString sAccName = GetAccessibleName(nId); + OUString sAccDesc = GetAccessibleDescription(); + + if (!sAccName.isEmpty() || !sAccDesc.isEmpty()) + { + auto aAria = rJsonWriter.startNode("aria"); + if (!sAccName.isEmpty()) + rJsonWriter.put("label", sAccName); + if (!sAccDesc.isEmpty()) + rJsonWriter.put("description", sAccDesc); + } + Image aImage = GetItemImage(nId); if (!sCommand.startsWith(".uno:") && !!aImage) { commit 782605110ec290012aa7c67fbaa86755e5472f09 Author: Rashesh <rashesh.pa...@collabora.com> AuthorDate: Thu Dec 19 14:03:52 2024 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:31:43 2025 +0100 sc: fix: can't switch focus from font menu back to edit window - Steps to reproduce: 1. Open Calc 2. Put the cursor in the font selection field, and type 3. Try to move the cursor back to the sheet and to type Change-Id: I596e5380d38f761a310c2a363389b0b03a0e94ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178787 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 2c95e7186e053ed5f2e7d8388fbe087fa60636c2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178796 Tested-by: Jenkins diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8cb78264b7a4..9ee7648a7a3c 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2252,7 +2252,7 @@ void ScTextWnd::TextGrabFocus() // Position window ScPosWnd::ScPosWnd(vcl::Window* pParent, ScTabViewShell* pViewShell) - : InterimItemWindow(pParent, u"modules/scalc/ui/posbox.ui"_ustr, u"PosBox"_ustr, false, + : InterimItemWindow(pParent, u"modules/scalc/ui/posbox.ui"_ustr, u"PosBox"_ustr, true, reinterpret_cast<sal_uInt64>(pViewShell)) , m_xWidget(m_xBuilder->weld_combo_box(u"pos_window"_ustr)) , m_nAsyncGetFocusId(nullptr) commit 509bc3ed6e1bd2a869666a8e722ada381101b626 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Mon Dec 16 07:42:05 2024 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:31:37 2025 +0100 lokit: add scale parameter to "renderNextSlideLayer" When client side change the device pixel ratio. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I6356ff2a2e6513ac835b5f02a755173aafe01dc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178580 Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179825 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6687e158f6c5..b2e6a11e303e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1340,7 +1340,7 @@ static bool doc_createSlideRenderer( static void doc_postSlideshowCleanup(LibreOfficeKitDocument* pThis); static bool doc_renderNextSlideLayer( - LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* bIsBitmapLayer, char** pJsonMsg); + LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* bIsBitmapLayer, double* pScale, char** pJsonMsg); static void doc_setViewOption(LibreOfficeKitDocument* pDoc, const char* pOption, const char* pValue); @@ -5649,7 +5649,7 @@ static void doc_postSlideshowCleanup(LibreOfficeKitDocument* pThis) } static bool doc_renderNextSlideLayer( - LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* pIsBitmapLayer, char** pJsonMessage) + LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* pIsBitmapLayer, double* pScale, char** pJsonMessage) { SolarMutexGuard aGuard; SetLastExceptionMsg(); @@ -5662,7 +5662,7 @@ static bool doc_renderNextSlideLayer( } OUString sJsonMesssage; bool bIsBitmapLayer = false; - bool bDone = pDoc->renderNextSlideLayer(pBuffer, bIsBitmapLayer, sJsonMesssage); + bool bDone = pDoc->renderNextSlideLayer(pBuffer, bIsBitmapLayer, *pScale, sJsonMesssage); if (pJsonMessage) *pJsonMessage = convertOUString(sJsonMesssage); diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index f8f64bc48652..66ff0418e326 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -554,7 +554,7 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::renderNextSlideLayer bool (*renderNextSlideLayer)( - LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* bIsBitmapLayer, char** pJsonMessage); + LibreOfficeKitDocument* pThis, unsigned char* pBuffer, bool* bIsBitmapLayer, double* pScale, char** pJsonMessage); /// @see lok::Document::setViewOption void (*setViewOption)(LibreOfficeKitDocument* pThis, const char* pOption, const char* pValue); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index b311fa03d1a9..f6f581c1ca43 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -932,9 +932,9 @@ public: } /// Render the slide layer - bool renderNextSlideLayer(unsigned char* pBuffer, bool* bIsBitmapLayer, char** pJsonMessage) + bool renderNextSlideLayer(unsigned char* pBuffer, bool* bIsBitmapLayer, double* pScale, char** pJsonMessage) { - return mpDoc->pClass->renderNextSlideLayer(mpDoc, pBuffer, bIsBitmapLayer, pJsonMessage); + return mpDoc->pClass->renderNextSlideLayer(mpDoc, pBuffer, bIsBitmapLayer, pScale, pJsonMessage); } /// Set named view options diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 9e57fc53b0a0..fa42c077df5f 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -405,7 +405,7 @@ public: } /** render slideshow layer*/ - virtual bool renderNextSlideLayer(unsigned char* /*pBuffer*/, bool& /*bIsBitmapLayer*/, OUString& /*rJsonMsg*/) + virtual bool renderNextSlideLayer(unsigned char* /*pBuffer*/, bool& /*bIsBitmapLayer*/, double& /*rScale*/, OUString& /*rJsonMsg*/) { return true; } diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 066d2306844c..0860126b6367 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2837,15 +2837,17 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content @@ -2865,8 +2867,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -2886,8 +2889,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); } @@ -2918,15 +2922,17 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -2946,8 +2952,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -2967,8 +2974,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -2988,8 +2996,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); @@ -3013,8 +3022,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"Background\"") >= 0); @@ -3030,8 +3040,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); @@ -3047,8 +3058,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); @@ -3064,8 +3076,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3081,8 +3094,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3098,8 +3112,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); @@ -3123,8 +3138,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"Background\"") >= 0); @@ -3141,8 +3157,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); @@ -3156,8 +3173,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); @@ -3171,8 +3189,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3187,8 +3206,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); + CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3203,8 +3224,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3220,8 +3242,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3236,8 +3259,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); CPPUNIT_ASSERT(bIsBitmapLayer); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); @@ -3253,8 +3277,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); @@ -3279,8 +3304,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3288,8 +3314,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3297,8 +3324,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3306,8 +3334,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(4, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3315,8 +3344,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(5, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3325,8 +3355,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); @@ -3351,8 +3382,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3360,8 +3392,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3369,8 +3402,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); } @@ -3379,8 +3413,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString rJsonMsg; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, rJsonMsg)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, rJsonMsg)); } pXImpressDocument->postSlideshowCleanup(); diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx b/sd/source/ui/inc/SlideshowLayerRenderer.hxx index e83eae573a40..48490c981512 100644 --- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx +++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx @@ -185,7 +185,7 @@ public: * The properties of the layer are written to the input string in JSON format. * * @returns false, if nothing was rendered and rendering is done */ - bool render(unsigned char* pBuffer, OString& rJsonMsg); + bool render(unsigned char* pBuffer, double& scale, OString& rJsonMsg); }; } // end of namespace sd diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 1df7e4eaab04..4b8d80d7e8a0 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -310,7 +310,7 @@ public: /// @see vcl::ITiledRenderable::postSlideshowCleanup(). SD_DLLPUBLIC void postSlideshowCleanup() override; /// @see vcl::ITiledRenderable::renderNextSlideLayer(). - SD_DLLPUBLIC bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) override; + SD_DLLPUBLIC bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) override; rtl::Reference< SdDrawPagesAccess > getSdDrawPages(); diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx index 89084a9aef47..ac14c5a94d2c 100644 --- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx +++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx @@ -49,10 +49,13 @@ struct RenderContext SdrModel& mrModel; EEControlBits mnSavedControlBits; + Fraction maScale; ScopedVclPtrInstance<VirtualDevice> maVirtualDevice; - RenderContext(unsigned char* pBuffer, SdrModel& rModel, SdrPage& rPage, Size const& rSlideSize) + RenderContext(unsigned char* pBuffer, SdrModel& rModel, SdrPage& rPage, Size const& rSlideSize, + const Fraction& rScale) : mrModel(rModel) + , maScale(rScale) , maVirtualDevice(DeviceFormat::WITHOUT_ALPHA) { // Turn off spelling @@ -62,8 +65,8 @@ struct RenderContext maVirtualDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); - maVirtualDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(rSlideSize, Fraction(1.0), - Point(), pBuffer); + maVirtualDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(rSlideSize, maScale, Point(), + pBuffer); Size aPageSize(rPage.GetSize()); MapMode aMapMode(MapUnit::Map100thMM); @@ -598,14 +601,14 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg) maRenderState.incrementIndex(); } -bool SlideshowLayerRenderer::render(unsigned char* pBuffer, OString& rJsonMsg) +bool SlideshowLayerRenderer::render(unsigned char* pBuffer, double& rScale, OString& rJsonMsg) { // We want to render one pass (one iteration through objects) // Reset state for this pass maRenderState.resetPass(); - RenderContext aRenderContext(pBuffer, mrModel, mrPage, maSlideSize); + RenderContext aRenderContext(pBuffer, mrModel, mrPage, maSlideSize, Fraction(rScale)); createViewAndDraw(aRenderContext); // Check if we are done rendering all passes and there is no more output diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index a7b875c05603..b4de36be2f33 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -4705,7 +4705,7 @@ void SdXImpressDocument::postSlideshowCleanup() pViewSh->destroyXSlideShowInstance(); } -bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) +bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) { bool bDone = true; @@ -4713,7 +4713,7 @@ bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsB return bDone; OString sMsg; - bool bOK = mpSlideshowLayerRenderer->render(pBuffer, sMsg); + bool bOK = mpSlideshowLayerRenderer->render(pBuffer, rScale, sMsg); if (bOK) { commit 186a15642c06ce214365056f69d0ca0f470eec5e Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Dec 17 15:35:34 2024 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:31:31 2025 +0100 jsdialog: setup parent for menu similar to popup we point what is the parent so we can show menu just below that element / entry Signed-off-by: Szymon Kłos <szymon.k...@collabora.com> Change-Id: I09a524d3da7c5fe1c36de6a2a2033058e5554a40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178670 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179710 Tested-by: Jenkins diff --git a/vcl/inc/jsdialog/jsdialogmessages.hxx b/vcl/inc/jsdialog/jsdialogmessages.hxx index 97d37a13342d..d3fafb986784 100644 --- a/vcl/inc/jsdialog/jsdialogmessages.hxx +++ b/vcl/inc/jsdialog/jsdialogmessages.hxx @@ -118,7 +118,8 @@ private: OString generatePopupMessage(const VclPtr<vcl::Window>& pWindow, const rtl::OUString& sParentId, const OUString& sCloseId) const; OString generateClosePopupMessage(const rtl::OUString& sWindowId) const; - OString generateMenuMessage(const VclPtr<PopupMenu>& pMenu) const; + OString generateMenuMessage(const VclPtr<PopupMenu>& pMenu, const OUString& sParentId, + const OUString& sCloseId) const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/jsdialog/jsdialogsender.hxx b/vcl/inc/jsdialog/jsdialogsender.hxx index 44324fb07844..c43cf04cccb4 100644 --- a/vcl/inc/jsdialog/jsdialogsender.hxx +++ b/vcl/inc/jsdialog/jsdialogsender.hxx @@ -64,7 +64,8 @@ public: std::unique_ptr<jsdialog::ActionDataMap> pData); virtual void sendPopup(const VclPtr<vcl::Window>& pWindow, const OUString& sParentId, const OUString& sCloseId); - virtual void sendMenu(const VclPtr<PopupMenu>& pMenu); + virtual void sendMenu(const VclPtr<PopupMenu>& pMenu, const OUString& sParentId, + const OUString& sCloseId); virtual void sendClosePopup(vcl::LOKWindowId nWindowId); void flush() { mpIdleNotify->Invoke(); } diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 268ee1529492..dd738c2e3037 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1968,11 +1968,22 @@ JSMenu::JSMenu(JSDialogSender* pSender, PopupMenu* pPopupMenu, SalInstanceBuilde { } -OUString JSMenu::popup_at_rect(weld::Widget* /*pParent*/, const tools::Rectangle& /*rRect*/, +OUString JSMenu::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, weld::Placement /*ePlace*/) { // Do not block with SalInstanceMenu::popup_at_rect(pParent, rRect, ePlace); - m_pSender->sendMenu(m_pPopupMenu); + + // we find position based on parent widget id and row text inside TreeView for context menu + OUString sCancelId; + weld::TreeView* pTree = dynamic_cast<weld::TreeView*>(pParent); + if (pTree) + { + std::unique_ptr<weld::TreeIter> itEntry(pTree->make_iterator()); + if (pTree->get_dest_row_at_pos(rRect.Center(), itEntry.get(), false, false)) + sCancelId = pTree->get_text(*itEntry); + } + + m_pSender->sendMenu(m_pPopupMenu, pParent ? pParent->get_buildable_name() : "", sCancelId); // Don't return any action - simulate canceled menu return ""; diff --git a/vcl/jsdialog/jsdialogsender.cxx b/vcl/jsdialog/jsdialogsender.cxx index fac9cf229013..9df5f99299b3 100644 --- a/vcl/jsdialog/jsdialogsender.cxx +++ b/vcl/jsdialog/jsdialogsender.cxx @@ -212,7 +212,9 @@ OString JSDialogNotifyIdle::generateClosePopupMessage(const OUString& sWindowId) return aJsonWriter.finishAndGetAsOString(); } -OString JSDialogNotifyIdle::generateMenuMessage(const VclPtr<PopupMenu>& pMenu) const +OString JSDialogNotifyIdle::generateMenuMessage(const VclPtr<PopupMenu>& pMenu, + const OUString& sParentId, + const OUString& sCloseId) const { if (!pMenu || !m_aNotifierWindow) return OString(); @@ -230,7 +232,8 @@ OString JSDialogNotifyIdle::generateMenuMessage(const VclPtr<PopupMenu>& pMenu) aJsonWriter.put("jsontype", "dialog"); aJsonWriter.put("type", "dropdown"); aJsonWriter.put("cancellable", true); - aJsonWriter.put("popupParent", m_aNotifierWindow->get_id()); + aJsonWriter.put("popupParent", sParentId); + aJsonWriter.put("clickToClose", sCloseId); aJsonWriter.put("id", m_aNotifierWindow->GetLOKWindowId()); return aJsonWriter.finishAndGetAsOString(); @@ -282,7 +285,8 @@ void JSDialogNotifyIdle::Invoke() case jsdialog::MessageType::Menu: { - send(generateMenuMessage(rMessage.m_pMenu)); + send(generateMenuMessage(rMessage.m_pMenu, (*rMessage.m_pData)[PARENT_ID ""_ostr], + (*rMessage.m_pData)[CLOSE_ID ""_ostr])); break; } } @@ -371,12 +375,17 @@ void JSDialogSender::sendClosePopup(vcl::LOKWindowId nWindowId) flush(); } -void JSDialogSender::sendMenu(const VclPtr<PopupMenu>& pMenu) +void JSDialogSender::sendMenu(const VclPtr<PopupMenu>& pMenu, const OUString& sParentId, + const OUString& sCloseId) { if (!mpIdleNotify) return; - mpIdleNotify->sendMessage(jsdialog::MessageType::Menu, pMenu); + std::unique_ptr<jsdialog::ActionDataMap> pData = std::make_unique<jsdialog::ActionDataMap>(); + (*pData)[PARENT_ID ""_ostr] = sParentId; + (*pData)[CLOSE_ID ""_ostr] = sCloseId; + + mpIdleNotify->sendMessage(jsdialog::MessageType::Menu, pMenu, std::move(pData)); mpIdleNotify->Start(); } commit 6b361bec16397c45e0b6cd18361fba43d70eee5d Author: Rashesh <rashesh.pa...@collabora.com> AuthorDate: Tue Dec 17 13:48:12 2024 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Feb 15 14:31:26 2025 +0100 lokit: move re-initialization of wordbook to addconfig option - previously we used to re-initialize it in lo_init because we wanted regonize newly added dictionaries but then we again had to re-initailize the XDictionary if new dicionary are added after ForKit is created and when new LoKit is initialized - this patch now does it on "addconfig" setOption which after kit is initialized Change-Id: I115e8ef23e0b3184f35169f6421fe461239c856a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178665 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 21e34972ee87..6687e158f6c5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5092,6 +5092,17 @@ static void updateConfig(const OUString& rConfigPath) xUpdate->insertModificationXcuFile(xcustat.getFileURL(), aAllowedSubset, {}); } } + else if (sFileName == "wordbook") + { + uno::Reference<css::linguistic2::XSearchableDictionaryList> xDicList + = LinguMgr::GetDictionaryList(); + if (xDicList.is()) + { + uno::Reference<lang::XInitialization> xReInitDictionaryList(xDicList, + uno::UNO_QUERY_THROW); -e ... etc. - the rest is truncated