sd/source/ui/docshell/docshel2.cxx |   45 ++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 20 deletions(-)

New commits:
commit ae6f696b0e71d0ad453dc3c4dea48d7c60c4e0b6
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Mon Mar 3 20:09:12 2025 +0100
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Tue Mar 4 21:19:12 2025 +0100

    tdf#93357 - Display first page as thumbnail in the recent documents view
    
    Display first page as thumbnail in the recent documents view for draw
    and impress documents.
    
    Change-Id: Ia69b338b68d5b2a47349b113d4f4f47ee1f1b08f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182479
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/sd/source/ui/docshell/docshel2.cxx 
b/sd/source/ui/docshell/docshel2.cxx
index 6a3ea2edfda1..f5489f20392d 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -59,34 +59,39 @@ void DrawDocShell::Draw(OutputDevice* pOut, const 
JobSetup&, sal_uInt16 nAspect,
     pView->SetPageVisible(false);
     pView->SetGlueVisible(false);
 
+    // tdf#93357 - display first page as thumbnail in the recent documents view
     SdPage* pSelectedPage = nullptr;
-
-    const std::vector<std::unique_ptr<sd::FrameView>> &rViews = 
mpDoc->GetFrameViewList();
-    if( !rViews.empty() )
+    if (nAspect == ASPECT_THUMBNAIL && pOut->GetOutDevType() == OUTDEV_VIRDEV)
+        pSelectedPage = mpDoc->GetSdPage(0, PageKind::Standard);
+    else
     {
-        sd::FrameView* pFrameView = rViews[0].get();
-        if( pFrameView->GetPageKind() == PageKind::Standard )
+        const std::vector<std::unique_ptr<sd::FrameView>> &rViews = 
mpDoc->GetFrameViewList();
+        if( !rViews.empty() )
         {
-            sal_uInt16 nSelectedPage = pFrameView->GetSelectedPage();
-            pSelectedPage = mpDoc->GetSdPage(nSelectedPage, 
PageKind::Standard);
+            sd::FrameView* pFrameView = rViews[0].get();
+            if( pFrameView->GetPageKind() == PageKind::Standard )
+            {
+                sal_uInt16 nSelectedPage = pFrameView->GetSelectedPage();
+                pSelectedPage = mpDoc->GetSdPage(nSelectedPage, 
PageKind::Standard);
+            }
         }
-    }
-
-    if( nullptr == pSelectedPage )
-    {
-        SdPage* pPage = nullptr;
-        sal_uInt16 nPageCnt = mpDoc->GetSdPageCount(PageKind::Standard);
 
-        for (sal_uInt16 i = 0; i < nPageCnt; i++)
+        if( nullptr == pSelectedPage )
         {
-            pPage = mpDoc->GetSdPage(i, PageKind::Standard);
+            SdPage* pPage = nullptr;
+            sal_uInt16 nPageCnt = mpDoc->GetSdPageCount(PageKind::Standard);
 
-            if ( pPage->IsSelected() )
-                pSelectedPage = pPage;
-        }
+            for (sal_uInt16 i = 0; i < nPageCnt; i++)
+            {
+                pPage = mpDoc->GetSdPage(i, PageKind::Standard);
 
-        if( nullptr == pSelectedPage )
-            pSelectedPage = mpDoc->GetSdPage(0, PageKind::Standard);
+                if ( pPage->IsSelected() )
+                    pSelectedPage = pPage;
+            }
+
+            if( nullptr == pSelectedPage )
+                pSelectedPage = mpDoc->GetSdPage(0, PageKind::Standard);
+        }
     }
 
     ::tools::Rectangle aVisArea = GetVisArea(nAspect);

Reply via email to