Kaydet (Commit) f2153330 authored tarafından mst's avatar mst Kaydeden (comit) Thorsten Behrens

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)
üst 5b6487aa
......@@ -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 (
......
......@@ -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;
}
......
......@@ -236,6 +236,7 @@ public:
VisibleAreaManager& GetVisibleAreaManager (void) const;
void CheckForMasterPageAssignment (void);
void CheckForSlideTransitionAssignment (void);
private:
SlideSorter& mrSlideSorter;
......
......@@ -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.
......
......@@ -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
......
......@@ -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)
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment