summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-07-11 11:17:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-12 20:22:22 +0100
commit8056d92635dd1cb03798d4691611d2484bf680af (patch)
treec653df2bc20fadeb55c38408d2fb517a4866d247 /sd
parentdbec45e8136a6de7968d93b2fc891d7409133b13 (diff)
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
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx6
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx39
2 files changed, 31 insertions, 14 deletions
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
index 67de31c2101c..3f73b56d9c9f 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 9bf75e6148f2..c20acf90981a 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,