[Libreoffice-commits] core.git: sd/source

Andre Fischer af at apache.org
Sun May 12 12:22:55 PDT 2013


 sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx |    6 ++
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx     |   39 ++++++++-----
 2 files changed, 31 insertions(+), 14 deletions(-)

New commits:
commit 8056d92635dd1cb03798d4691611d2484bf680af
Author: Andre Fischer <af at apache.org>
Date:   Wed Jul 11 11:17:48 2012 +0000

    Resolves: #i118813# Update slide sorter after page format is modified
    
    (cherry picked from commit b8f5370aeea74b68333885450f7ec34918c1d8c8)
    
    Conflicts:
    	sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
    
    Change-Id: I42553defdce1636190e8c5c226774135e179e25d

diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
index 67de31c..3f73b56 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
@@ -122,6 +122,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
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 9bf75e6..c20acf9 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -82,26 +82,37 @@ 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);
+
+        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);
-
-    rDevice.SetAntialiasing(nSavedAntialiasingMode);
+    else
+        return true;
 }
 
 
@@ -112,7 +123,7 @@ void PageObjectPainter::NotifyResize (const bool bForce)
     mpPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
     if (bForce || ! mpPageObjectLayouter)
         InvalidateBitmaps();
-    else
+    else if (UpdatePageObjectLayouter())
     {
         const Size aSize (mpPageObjectLayouter->GetSize(
                 PageObjectLayouter::FocusIndicator,


More information about the Libreoffice-commits mailing list