sc/source/ui/view/viewfun5.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a616d6f20f95735d4db4af1c102b40c9c98c2080
Author:     Mike Kaganski <[email protected]>
AuthorDate: Tue Dec 23 13:16:38 2025 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Tue Dec 23 15:01:53 2025 +0100

    tdf#127675: SfxObjectShell::DoLoad takes ownership of the passed medium
    
    Implementation defect from commit ba49c9249fcfec8891ef7d53dc8c9db1715df020
    (tdf#127675 Treat Biff12 when pasting, 2025-11-16).
    
    I don't know how to produce a unit test for this...
    
    Change-Id: I82a5f1c7cbd1e9d0cc32f8a9c5d62bade2911afc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196161
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index f1ec43c55fb2..d294979cb389 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -343,11 +343,11 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId 
nFormatId,
                 ScDocShellRef pClipShell(new ScDocShell(SfxModelFlags::NONE, 
SCDOCMODE_CLIP));
                 SCTAB nSrcTab = 0;
                 pClipShell->GetDocument().ResetClip(&rDoc, nSrcTab);
-                SfxMedium aMed;
-                aMed.GetItemSet().Put(SfxUnoAnyItem(SID_INPUTSTREAM, 
uno::Any(xStm)));
-                aMed.SetFilter(pFilter);
+                auto pMed = std::make_unique<SfxMedium>();
+                pMed->GetItemSet().Put(SfxUnoAnyItem(SID_INPUTSTREAM, 
uno::Any(xStm)));
+                pMed->SetFilter(pFilter);
 
-                if (pClipShell->DoLoad(&aMed))
+                if (pClipShell->DoLoad(pMed.release()))
                 {
                     PasteFromExcelClip(pClipShell->GetDocument(), nSrcTab, 
nPosX, nPosY, pLogicPos,
                                        bAllowDialogs);

Reply via email to