Commits

Anonymous committed 5d52cdc

slidesorter1: #117012# Update preview when text editing ends.

  • Participants
  • Parent commits aa5b0a6

Comments (0)

Files changed (7)

File sd/source/ui/slidesorter/controller/SlideSorterController.cxx

 
 
 
+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 (

File sd/source/ui/slidesorter/controller/SlsListener.cxx

         {
             case SFX_HINT_DOCCHANGED:
                 mrController.CheckForMasterPageAssignment();
+                mrController.CheckForSlideTransitionAssignment();
                 break;
         }
     }
         case tools::EventMultiplexerEvent::EID_SHAPE_REMOVED:
             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;

File sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx

     VisibleAreaManager& GetVisibleAreaManager (void) const;
 
     void CheckForMasterPageAssignment (void);
+    void CheckForSlideTransitionAssignment (void);
 
 private:
     SlideSorter& mrSlideSorter;

File sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx

     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 };
     bool mbIsFocused : 1;
     bool mbIsCurrent : 1;
     bool mbIsMouseOver : 1;
+    bool mbHasTransition : 1;
 
     
     // Do not use the copy constructor operator.  It is not implemented.

File sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx

     Bitmap maMouseOverSelectedAndFocusedBackground;
     ::rtl::OUString msUnhideString;
     ButtonBar& mrButtonBar;
+    Size maSize;
 
     void PaintBackground (
         OutputDevice& rDevice,
         const Bitmap& rPreview,
         const BitmapEx& rOverlay,
         const OutputDevice* pReferenceDevice) const;
+    void InvalidateBitmaps (void);
 };
 
 } } } // end of namespace sd::slidesorter::view

File sd/source/ui/slidesorter/model/SlsPageDescriptor.cxx

       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;
+    }
 }
 
 
 
 
 
+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)

File sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx

       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.
 
 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();