diff options
author | mst <mst@openoffice.org> | 2011-09-17 22:42:57 +0000 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-11-29 17:57:32 +0100 |
commit | f215333002882872129066828228d3343a903331 (patch) | |
tree | 61fd5bc793be5e7ff37c92bc94b2ec56acda9832 /sd/source | |
parent | 5b6487aa8ce1406efb8e29de28a9ecd1c3d06cf2 (diff) |
slidesorter1: #117012# Update preview when text editing ends.
* found as LGPLv3-only fix at svn rev 1172129 (http://svn.apache.org/viewvc?view=revision&revision=1172129)
Diffstat (limited to 'sd/source')
7 files changed, 82 insertions, 5 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index ab0493156dd2..0d9f576327d3 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -1090,6 +1090,26 @@ void SlideSorterController::CheckForMasterPageAssignment (void) +void SlideSorterController::CheckForSlideTransitionAssignment (void) +{ + if (mrModel.GetPageCount()%2==0) + return; + PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(mrModel)); + while (aAllPages.HasMoreElements()) + { + SharedPageDescriptor pDescriptor (aAllPages.GetNextElement()); + if (pDescriptor->UpdateTransitionFlag()) + { + mrView.GetPreviewCache()->InvalidatePreviewBitmap ( + pDescriptor->GetPage(), + true); + } + } +} + + + + //===== SlideSorterController::ModelChangeLock ================================ SlideSorterController::ModelChangeLock::ModelChangeLock ( diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx index ff3ec3c21c4b..af2bf1df3928 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.cxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx @@ -363,6 +363,7 @@ void Listener::Notify ( { case SFX_HINT_DOCCHANGED: mrController.CheckForMasterPageAssignment(); + mrController.CheckForSlideTransitionAssignment(); break; } } @@ -423,6 +424,14 @@ IMPL_LINK(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent HandleShapeModification(static_cast<const SdrPage*>(pEvent->mpUserData)); break; + case tools::EventMultiplexerEvent::EID_END_TEXT_EDIT: + if (pEvent->mpUserData != NULL) + { + const SdrObject* pObject = static_cast<const SdrObject*>(pEvent->mpUserData); + HandleShapeModification(pObject->GetPage()); + } + break; + default: break; } diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx index 6ea8d8b94c39..e962623be4ed 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx @@ -236,6 +236,7 @@ public: VisibleAreaManager& GetVisibleAreaManager (void) const; void CheckForMasterPageAssignment (void); + void CheckForSlideTransitionAssignment (void); private: SlideSorter& mrSlideSorter; diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx index ab699d729356..7f3bd43bbab6 100644 --- a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx +++ b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx @@ -100,6 +100,7 @@ public: void SetPageIndex (const sal_Int32 nIndex); bool UpdateMasterPage (void); + bool UpdateTransitionFlag (void); enum State { ST_Visible, ST_Selected, ST_WasSelected, ST_Focused, ST_MouseOver, ST_Current, ST_Excluded }; @@ -149,6 +150,7 @@ private: bool mbIsFocused : 1; bool mbIsCurrent : 1; bool mbIsMouseOver : 1; + bool mbHasTransition : 1; // Do not use the copy constructor operator. It is not implemented. diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx index 0f255792b954..51c7157538c4 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx @@ -98,6 +98,7 @@ private: Bitmap maMouseOverSelectedAndFocusedBackground; ::rtl::OUString msUnhideString; ButtonBar& mrButtonBar; + Size maSize; void PaintBackground ( OutputDevice& rDevice, @@ -132,6 +133,7 @@ private: const Bitmap& rPreview, const BitmapEx& rOverlay, const OutputDevice* pReferenceDevice) const; + void InvalidateBitmaps (void); }; } } } // end of namespace sd::slidesorter::view diff --git a/sd/source/ui/slidesorter/model/SlsPageDescriptor.cxx b/sd/source/ui/slidesorter/model/SlsPageDescriptor.cxx index 6c7d7fd97f33..8d6d4076f107 100644 --- a/sd/source/ui/slidesorter/model/SlsPageDescriptor.cxx +++ b/sd/source/ui/slidesorter/model/SlsPageDescriptor.cxx @@ -58,12 +58,18 @@ PageDescriptor::PageDescriptor ( mbIsVisible(false), mbIsFocused(false), mbIsCurrent(false), - mbIsMouseOver(false) + mbIsMouseOver(false), + mbHasTransition(false) { OSL_ASSERT(mpPage); OSL_ASSERT(mpPage == SdPage::getImplementation(rxPage)); - if (mpPage!=NULL && mpPage->TRG_HasMasterPage()) - mpMasterPage = &mpPage->TRG_GetMasterPage(); + if (mpPage != NULL) + { + if (mpPage->TRG_HasMasterPage()) + mpMasterPage = &mpPage->TRG_GetMasterPage(); + if (mpPage->getTransitionType() > 0) + mbHasTransition = true; + } } @@ -126,6 +132,23 @@ bool PageDescriptor::UpdateMasterPage (void) +bool PageDescriptor::UpdateTransitionFlag (void) +{ + bool bHasSlideTransition (false); + if (mpPage != NULL) + bHasSlideTransition = mpPage->getTransitionType() > 0; + if (bHasSlideTransition != mbHasTransition) + { + mbHasTransition = bHasSlideTransition; + return true; + } + else + return false; +} + + + + bool PageDescriptor::HasState (const State eState) const { switch (eState) diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx index 80f34e5ea8c4..40fed6929b8f 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx @@ -113,7 +113,8 @@ PageObjectPainter::PageObjectPainter ( maMouseOverBackground(), maMouseOverFocusedBackground(), msUnhideString(mpTheme->GetString(Theme::String_Unhide)), - mrButtonBar(rSlideSorter.GetView().GetButtonBar()) + mrButtonBar(rSlideSorter.GetView().GetButtonBar()), + maSize() { // Replace the color (not the alpha values) in the focus border with a // color derived from the current selection color. @@ -166,7 +167,26 @@ void PageObjectPainter::PaintPageObject ( void PageObjectPainter::NotifyResize (const bool bForce) { - (void)bForce; + if (bForce || ! mpPageObjectLayouter) + InvalidateBitmaps(); + else + { + const Size aSize (mpPageObjectLayouter->GetSize( + PageObjectLayouter::FocusIndicator, + PageObjectLayouter::WindowCoordinateSystem)); + if ( maSize!=aSize) + { + maSize = aSize; + InvalidateBitmaps(); + } + } +} + + + + +void PageObjectPainter::InvalidateBitmaps (void) +{ maNormalBackground.SetEmpty(); maSelectionBackground.SetEmpty(); maFocusedSelectionBackground.SetEmpty(); |