Author: jsc
Date: Fri Jun 22 13:30:43 2012
New Revision: 1352878

URL: http://svn.apache.org/viewvc?rev=1352878&view=rev
Log:
#120030# apply reviewed patch to optimize thumbnail creation/painting

Modified:
    incubator/ooo/trunk/main/sfx2/inc/sfx2/objsh.hxx
    incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx
    incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx

Modified: incubator/ooo/trunk/main/sfx2/inc/sfx2/objsh.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/inc/sfx2/objsh.hxx?rev=1352878&r1=1352877&r2=1352878&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/inc/sfx2/objsh.hxx (original)
+++ incubator/ooo/trunk/main/sfx2/inc/sfx2/objsh.hxx Fri Jun 22 13:30:43 2012
@@ -203,6 +203,7 @@ private:
        SfxObjectCreateMode             eCreateMode;            // Zweck des 
Objekts
        sal_Bool                                        bHasName :1,            
// sal_True := bestehendes Objekt, sal_False := es ist ein neues Objekt
                                 bIsTmp :1;          // temp. Storage
+        sal_Bool               bIsInGenerateThumbnail; //optimize thumbnail 
generate and store procedure to improve odt saving performance, i120030
 
 private:
 //#if 0 // _SOLAR__PRIVATE
@@ -439,6 +440,8 @@ public:
                                                                        
sal_Bool bIsTemplate,
                                                                        const 
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream );
 
+       sal_Bool                                        
IsInGenerateAndStoreThumbnail() const {return 
bIsInGenerateThumbnail;}//optimize thumbnail generate and store procedure to 
improve odt saving performance, i120030
+
        // Transfer IFace
        void                        AbortImport();
        sal_Bool                    IsAbortingImport() const;

Modified: incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx?rev=1352878&r1=1352877&r2=1352878&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/doc/objstor.cxx Fri Jun 22 13:30:43 
2012
@@ -3692,6 +3692,8 @@ sal_Bool SfxObjectShell::GenerateAndStor
                                                     const uno::Reference< 
embed::XStorage >& xStor )
 {
     RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033) 
SfxObjectShell::GenerateAndStoreThumbnail" );
+       
+    bIsInGenerateThumbnail = sal_True;//optimize thumbnail generate and store 
procedure to improve odt saving performance, i120030
 
     sal_Bool bResult = sal_False;
 
@@ -3716,6 +3718,8 @@ sal_Bool SfxObjectShell::GenerateAndStor
     catch( uno::Exception& )
     {
     }
+       
+    bIsInGenerateThumbnail = sal_False;//optimize thumbnail generate and store 
procedure to improve odt saving performance, i120030
 
     return bResult;
 }

Modified: incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx?rev=1352878&r1=1352877&r2=1352878&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/layout/paintfrm.cxx Fri Jun 22 
13:30:43 2012
@@ -3522,6 +3522,20 @@ void MA_FASTCALL lcl_PaintLowerBorders( 
 
 void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
 {
+       //begin:optimize thumbnail generate and store procedure to improve odt 
saving performance, i120030
+       ViewShell *pShell = getRootFrm()->GetCurrShell();
+       if (pShell && pShell->GetDoc() && pShell->GetDoc()->GetDocShell())
+       {
+               sal_Bool bInGenerateThumbnail = 
pShell->GetDoc()->GetDocShell()->IsInGenerateAndStoreThumbnail();
+               if (bInGenerateThumbnail)
+               {
+                       SwRect aVisRect = pShell->VisArea();
+                       if (!aVisRect.IsOver(Frm()))
+                               return;
+               }
+       }
+       //end:i120030
+
     //wegen der Ueberlappung von Rahmen und Zeichenobjekten muessen die
        //Flys ihre Umrandung (und die der Innenliegenden) direkt ausgeben.
        //z.B. #33066#


Reply via email to