incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1360139 - in /incubator/ooo/trunk/main/sd/source/ui/slidesorter: inc/view/SlsPageObjectPainter.hxx view/SlsPageObjectPainter.cxx
Date Wed, 11 Jul 2012 12:17:48 GMT
Author: af
Date: Wed Jul 11 12:17:48 2012
New Revision: 1360139

URL: http://svn.apache.org/viewvc?rev=1360139&view=rev
Log:
#i118813# Update slide sorter after page format is modified.

Modified:
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx?rev=1360139&r1=1360138&r2=1360139&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx Wed
Jul 11 12:17:48 2012
@@ -129,6 +129,12 @@ private:
         const BitmapEx& rOverlay,
         const OutputDevice* pReferenceDevice) const;
     void InvalidateBitmaps (void);
+
+    /** Update the local pointer to the page object layouter to the
+        one owned by the general layouter.
+        Return <TRUE/> when after the call we have a valid page object layouter.
+    */
+    bool UpdatePageObjectLayouter (void);
 };
 
 } } } // end of namespace sd::slidesorter::view

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx?rev=1360139&r1=1360138&r2=1360139&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx Wed Jul
11 12:17:48 2012
@@ -135,27 +135,38 @@ void PageObjectPainter::PaintPageObject 
     OutputDevice& rDevice,
     const model::SharedPageDescriptor& rpDescriptor)
 {
+    if (UpdatePageObjectLayouter())
+    {
+        // Turn off antialiasing to avoid the bitmaps from being
+        // shifted by fractions of a pixel and thus show blurry edges.
+        const sal_uInt16 nSavedAntialiasingMode (rDevice.GetAntialiasing());
+        rDevice.SetAntialiasing(nSavedAntialiasingMode & ~ANTIALIASING_ENABLE_B2DDRAW);
+
+        PaintBackground(rDevice, rpDescriptor);
+        PaintPreview(rDevice, rpDescriptor);
+        PaintPageNumber(rDevice, rpDescriptor);
+        PaintTransitionEffect(rDevice, rpDescriptor);
+        mrButtonBar.Paint(rDevice, rpDescriptor);
+
+        rDevice.SetAntialiasing(nSavedAntialiasingMode);
+    }
+}
+
+
+
+
+bool PageObjectPainter::UpdatePageObjectLayouter (void)
+{
     // The page object layouter is quite volatile. It may have been replaced
     // since the last call.  Update it now.
     mpPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
     if ( ! mpPageObjectLayouter)
     {
         OSL_ASSERT(mpPageObjectLayouter);
-        return;
+        return false;
     }
-
-    // Turn off antialiasing to avoid the bitmaps from being shifted by
-    // fractions of a pixel and thus show blurry edges.
-    const sal_uInt16 nSavedAntialiasingMode (rDevice.GetAntialiasing());
-    rDevice.SetAntialiasing(nSavedAntialiasingMode & ~ANTIALIASING_ENABLE_B2DDRAW);
-
-    PaintBackground(rDevice, rpDescriptor);
-    PaintPreview(rDevice, rpDescriptor);
-    PaintPageNumber(rDevice, rpDescriptor);
-    PaintTransitionEffect(rDevice, rpDescriptor);
-    mrButtonBar.Paint(rDevice, rpDescriptor);
-
-    rDevice.SetAntialiasing(nSavedAntialiasingMode);
+    else
+        return true;
 }
 
 
@@ -165,7 +176,7 @@ void PageObjectPainter::NotifyResize (co
 {
     if (bForce || ! mpPageObjectLayouter)
         InvalidateBitmaps();
-    else
+    else if (UpdatePageObjectLayouter())
     {
         const Size aSize (mpPageObjectLayouter->GetSize(
                 PageObjectLayouter::FocusIndicator,



Mime
View raw message