sd/inc/app.hrc | 2 sd/sdi/_drvwsh.sdi | 10 +++ sd/sdi/sdraw.sdi | 34 +++++++++++ sd/source/ui/sidebar/MasterPagesSelector.cxx | 24 ++++---- sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 3 + sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 8 ++ sd/source/ui/view/drviews2.cxx | 12 ++++ sd/source/ui/view/drviews7.cxx | 4 + sfx2/source/control/unoctitm.cxx | 1 svx/source/svdraw/svdograf.cxx | 49 +++++++---------- vcl/inc/iconview.hxx | 4 + vcl/source/app/salvtables.cxx | 16 ++--- vcl/source/treelist/iconview.cxx | 7 ++ 13 files changed, 124 insertions(+), 50 deletions(-)
New commits: commit 7bcdae521d7848c1545903b2e5063440fc53b4fd Author: Rashesh <rashesh.pa...@collabora.com> AuthorDate: Sat Mar 8 21:27:41 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Mar 12 14:17:28 2025 +0100 tdf#165606 sd: fix master slide panel doesn't resized correctly Change-Id: Ifb26d80f431f0fe6c4e58e58621e170e5a33a718 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182671 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 2ee57bca11c3..b098486054ed 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -582,16 +582,20 @@ void MasterPagesSelector::UpdateItemList (::std::unique_ptr<ItemList> && pNewIte css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidth) { - if (maIconViewId == "masterpageall_icons") - return css::ui::LayoutSize(-1, -1, -1); - - const sal_uInt32 nItemWidth = mxPreviewIconView->get_item_width(); - sal_Int32 nMinimumHeight = mxPreviewIconView->get_preferred_size().getHeight(); - const sal_Int32 itemsInRows = floor(nWidth / nItemWidth); - sal_Int32 totalItems = mxPreviewIconView->n_children(); - if (itemsInRows > 0) - nMinimumHeight = ((totalItems / itemsInRows) + 1) * nMinimumHeight; - return css::ui::LayoutSize(nMinimumHeight, nMinimumHeight, nMinimumHeight); + // there is no way to get margin of item programatically, we use value provided in ui file. + const int nMargin = 6; + sal_Int32 nColumnCount = nWidth / (mxPreviewIconView->get_item_width() + (5 * nMargin)); + if (nColumnCount < 1) + nColumnCount = 1; + + sal_Int32 nTotalItems = mxPreviewIconView->n_children(); + sal_Int32 nRowCount = (nTotalItems + nColumnCount - 1) / nColumnCount; + if (nRowCount < 1) + nRowCount = 1; + + sal_Int32 nPreferedHeight + = nRowCount * (mxPreviewIconView->get_rect(nTotalItems - 1).GetHeight() + (2 * nMargin)); + return css::ui::LayoutSize(nPreferedHeight, nPreferedHeight, nPreferedHeight); } } // end of namespace sd::sidebar commit 8170cb7f0f5c9acafe9648905ae0c4fa5c77def2 Author: Rashesh <rashesh.pa...@collabora.com> AuthorDate: Sat Mar 8 17:29:01 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Mar 12 14:17:28 2025 +0100 tdf#165610 sd: master slide panel is broken with "show large preview" Change-Id: If7d6350ca289ab165f11af71bd1f22dee7be86d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182668 Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/vcl/inc/iconview.hxx b/vcl/inc/iconview.hxx index 438590b083ab..c6b67df852ef 100644 --- a/vcl/inc/iconview.hxx +++ b/vcl/inc/iconview.hxx @@ -22,6 +22,7 @@ #include <tools/json_writer.hxx> #include <vcl/toolkit/treelistbox.hxx> +#include <vcl/image.hxx> class IconView final : public SvTreeListBox { @@ -57,6 +58,9 @@ public: /// returns string with encoded image for an entry OUString renderEntry(int pos, int dpix, int dpiy) const; + /// Update entry size based on image size + void UpdateEntrySize(const Image& pImage); + protected: virtual void CalcEntryHeight(SvTreeListEntry const* pEntry) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 84bbfdb88fd0..3c4ca0ee9969 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5705,13 +5705,10 @@ void SalInstanceIconView::set_image(int pos, VirtualDevice* pIcon) SvLBoxContextBmp* aItem = static_cast<SvLBoxContextBmp*>(aEntry->GetFirstItem(SvLBoxItemType::ContextBmp)); - Image aImage; - if (pIcon) - { - const Point aNull(0, 0); - const Size aSize = pIcon->GetOutputSize(); - aImage = Image(pIcon->GetBitmapEx(aNull, aSize)); - } + if (!pIcon) + return; + + Image aImage = createImage(*pIcon); if (aItem == nullptr) { aEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aImage, aImage, false)); @@ -5720,10 +5717,9 @@ void SalInstanceIconView::set_image(int pos, VirtualDevice* pIcon) { aItem->SetBitmap1(aImage); aItem->SetBitmap2(aImage); - } - - if (!m_xIconView->GetModel()->IsEnableInvalidate()) + m_xIconView->UpdateEntrySize(aImage); m_xIconView->ModelHasEntryInvalidated(aEntry); + } } void SalInstanceIconView::remove(int pos) diff --git a/vcl/source/treelist/iconview.cxx b/vcl/source/treelist/iconview.cxx index 34f213462911..533603338abb 100644 --- a/vcl/source/treelist/iconview.cxx +++ b/vcl/source/treelist/iconview.cxx @@ -54,6 +54,13 @@ Size IconView::GetEntrySize(const SvTreeListEntry& entry) const return { GetEntryWidth(), GetEntryHeight() }; } +void IconView::UpdateEntrySize(const Image& pImage) +{ + int spacing = nSpacing * 2; + SetEntryHeight(pImage.GetSizePixel().getHeight() + spacing); + SetEntryWidth(pImage.GetSizePixel().getWidth() + spacing); +} + void IconView::CalcEntryHeight(SvTreeListEntry const* pEntry) { int nHeight = nSpacing * 2; commit d30d6ab7a38f4e18ef0f749114722460e8b2b25b Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Fri Mar 7 07:13:59 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Mar 12 14:17:28 2025 +0100 uno: introduced command to copy slides problem: in online though kit process it was difficult to trigger the slidesorter clipboard to copy slides. Difficulty was caused by slidesorter using its own viewshell to copy and online triggering copy command on drawviewshell. It's more convenient to use a different command rather than jumping between viewshells in this case Change-Id: I347ad0044efa64a3e5dcd26aeb16fe5b8103bb12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182605 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 34f0d368b8f9..4725c2f961e9 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -368,6 +368,8 @@ #define SID_EXPAND_PAGE (SID_SD_START+343) #define SID_SUMMARY_PAGE (SID_SD_START+344) #define SID_LEAVE_ALL_GROUPS (SID_SD_START+345) +#define SID_COPY_SLIDE (SID_SD_START+346) +#define SID_PASTE_SLIDE (SID_SD_START+347) // FREE #define SID_SLIDE_MASTER_MODE TypedWhichId<SfxBoolItem>(SID_SD_START+348) // FREE diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index b0c655176b1b..2aee9b626abc 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2988,4 +2988,14 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState; ] + SID_COPY_SLIDE + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_PASTE_SLIDE + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] } diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index 5cb4bd732c42..96526e024d0d 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -4753,3 +4753,37 @@ SfxVoidItem AlignOnPage SID_ALIGN_PAGE ToolBoxConfig = TRUE, GroupId = SfxGroupId::Modify; ] + +SfxVoidItem CopySlide SID_COPY_SLIDE +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Edit; +] + +SfxVoidItem PasteSlide SID_PASTE_SLIDE +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Edit; +] diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 2c0b81bde2b2..5d7a90eacda2 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -55,6 +55,7 @@ #include <DrawDocShell.hxx> #include <sdpage.hxx> #include <sdtreelb.hxx> +#include <app.hrc> #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> #include <sfx2/request.hxx> @@ -170,6 +171,7 @@ void Clipboard::HandleSlotCall (SfxRequest& rRequest) break; case SID_COPY: + case SID_COPY_SLIDE: if (mrSlideSorter.GetModel().GetEditMode() != EditMode::MasterPage) { if(xFunc.is()) @@ -181,6 +183,7 @@ void Clipboard::HandleSlotCall (SfxRequest& rRequest) break; case SID_PASTE: + case SID_PASTE_SLIDE: // Prevent redraws while inserting pages from the clipboard // because the intermediate inconsistent state might lead to // a crash. diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 17482e36957f..7c749e318692 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -365,6 +365,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) break; case SID_PASTE: + case SID_PASTE_SLIDE: { SdTransferable* pTransferClip = SdModule::get()->pTransferClip; if( pTransferClip ) @@ -392,6 +393,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) case SID_CUT: case SID_COPY: case SID_DELETE: + case SID_COPY_SLIDE: mrSlideSorter.GetView().EndTextEditAllViews(); mrSlideSorter.GetController().GetClipboard().HandleSlotCall(rRequest); break; @@ -699,14 +701,16 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet) { SdTransferable* pTransferClip = SdModule::get()->pTransferClip; - if (rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT - || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT) + if (rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT + || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT + || rSet.GetItemState(SID_PASTE_SLIDE) == SfxItemState::DEFAULT) { // no own clipboard data? if ( !pTransferClip || !pTransferClip->GetDocShell().is() ) { rSet.DisableItem(SID_PASTE); rSet.DisableItem(SID_PASTE_SPECIAL); + rSet.DisableItem(SID_PASTE_SLIDE); } else { diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 820638e9c19b..27b5b159de81 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -192,6 +192,7 @@ #include <SlideSorterViewShell.hxx> #include <controller/SlideSorterController.hxx> #include <controller/SlsPageSelector.hxx> +#include <controller/SlsClipboard.hxx> #include <tools/GraphicSizeCheck.hxx> #include <theme/ThemeColorChanger.hxx> @@ -4254,6 +4255,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) Cancel(); break; + case SID_PASTE_SLIDE: + case SID_COPY_SLIDE: + { + sd::slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase()) + ->GetSlideSorter() + .GetController() + .FuSupport(rReq); + Cancel(); + rReq.Done(); + } + break; default: { SAL_WARN( "sd.ui", "Slot without function" ); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index a561bf46f411..8857bab914b2 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1069,6 +1069,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE_SPECIAL ); rSet.DisableItem( SID_PASTE_UNFORMATTED ); + rSet.DisableItem( SID_PASTE_SLIDE ); rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS ); rSet.DisableItem( SID_INSERT_FLD_DATE_FIX ); @@ -1613,6 +1614,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } } + if (!SdModule::get()->pTransferClip) + rSet.DisableItem(SID_PASTE_SLIDE); + GetModeSwitchingMenuState (rSet); } diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index c0e2dfbb4c73..8dcb14d2b1ee 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1382,6 +1382,7 @@ const std::map<std::u16string_view, KitUnoCommand>& GetKitUnoCommandList() { u"DistributeVertTop", { PayloadType::EnabledPayload, true } }, { u"AnimationEffects", { PayloadType::EnabledPayload, true } }, { u"ExecuteAnimationEffect", { PayloadType::EnabledPayload, true } }, + { u"PasteSlide", { PayloadType::EnabledPayload, true } }, { u"ParaLeftToRight", { PayloadType::ParaDirectionPayload, true } }, { u"ParaRightToLeft", { PayloadType::ParaDirectionPayload, true } }, commit 9cadba000168f360052a327a813acc8decffe62f Author: Rashesh <rashesh.pa...@collabora.com> AuthorDate: Sat Feb 15 18:15:54 2025 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Mar 12 13:54:47 2025 +0100 svdraw: append SdrCropViewHdl instead of prepending in crop mode Previously, enabling crop mode caused the crop handle (SdrCropViewHdl) to be added at the start of the handlers list. This change in order led to a shift in handler IDs, which Collabora Online relies on for identifying and managing handlers. This patch fixes the bug by appending the SdrCropViewHdl to the end of the list, ensuring that the IDs for the main crop handles remain consistent. Change-Id: If082d292e32e242648cf5d04e278880bd457efb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181705 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com> (cherry picked from commit 4daf1b96c52e8b399908bfeb6871482a6699422c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181775 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 82a312c77d9c..3a11aa0a0d49 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1156,9 +1156,26 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const aTranslate); } + basegfx::B2DPoint aPos; + aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate)); + aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0); + rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate)); + // get crop values const SdrGrafCropItem& rCrop = GetMergedItem(SDRATTR_GRAFCROP); - if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() ||rCrop.GetBottom()) { // decompose object transformation to have current translate and scale @@ -1206,35 +1223,11 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply; } - rTarget.AddHdl( - std::make_unique<SdrCropViewHdl>( - aMatrixForCropViewHdl, - GetGraphicObject().GetGraphic(), - fCropLeft, - fCropTop, - fCropRight, - fCropBottom)); + rTarget.AddHdl(std::make_unique<SdrCropViewHdl>( + aMatrixForCropViewHdl, GetGraphicObject().GetGraphic(), fCropLeft, fCropTop, + fCropRight, fCropBottom)); } } - - basegfx::B2DPoint aPos; - - aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate)); - aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0); - rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */