renaissance1: #i107215# Fixed some minor compilation problems.

This commit is contained in:
Andre Fischer<Andre.W.Fischer
2010-01-28 13:00:30 +01:00
parent df407bc1d6
commit 2336af0eb4
15 changed files with 36 additions and 49 deletions

View File

@@ -271,12 +271,12 @@ double AnimationParametricFunction::operator() (const double nX)
{ {
const sal_Int32 nIndex0 (nX * maY.size()); const sal_Int32 nIndex0 (nX * maY.size());
const double nX0 (nIndex0 / double(maY.size()-1)); const double nX0 (nIndex0 / double(maY.size()-1));
const sal_Int32 nIndex1 (nIndex0 + 1); const sal_uInt32 nIndex1 (nIndex0 + 1);
const double nX1 (nIndex1 / double(maY.size()-1)); const double nX1 (nIndex1 / double(maY.size()-1));
if (nIndex0<=0) if (nIndex0<=0)
return maY[0]; return maY[0];
else if (nIndex0>=maY.size() || nIndex1>=maY.size()) else if (sal_uInt32(nIndex0)>=maY.size() || nIndex1>=maY.size())
return maY[maY.size()-1]; return maY[maY.size()-1];
const double nU ((nX-nX1) / (nX0 - nX1)); const double nU ((nX-nX1) / (nX0 - nX1));

View File

@@ -249,16 +249,14 @@ Animator::Animation::Animation (
const Animator::FinishFunctor& rFinishFunctor) const Animator::FinishFunctor& rFinishFunctor)
: maAnimation(rAnimation), : maAnimation(rAnimation),
maFinishFunctor(rFinishFunctor), maFinishFunctor(rFinishFunctor),
mnAnimationId(nId),
mnValue(0), mnValue(0),
mnEnd(nEnd), mnEnd(nEnd),
mnDelta(nDelta), mnDelta(nDelta),
mnAnimationId(nId),
mbIsExpired(false) mbIsExpired(false)
{ {
maAnimation(mnValue); maAnimation(mnValue);
mnValue = mnDelta; mnValue = mnDelta;
} }

View File

@@ -580,7 +580,6 @@ sal_Int8 Clipboard::ExecuteDrop (
|| ( nXOffset >= 2 && nYOffset >= 2 ); || ( nXOffset >= 2 && nYOffset >= 2 );
// Get insertion position and then turn off the insertion indicator. // Get insertion position and then turn off the insertion indicator.
view::ViewOverlay& rOverlay (mrSlideSorter.GetView().GetOverlay());
mrController.GetInsertionIndicatorHandler()->UpdatePosition(aEventModelPosition); mrController.GetInsertionIndicatorHandler()->UpdatePosition(aEventModelPosition);
USHORT nIndex = DetermineInsertPosition(*pDragTransferable); USHORT nIndex = DetermineInsertPosition(*pDragTransferable);
OSL_TRACE ("Clipboard::AcceptDrop() called for index %d", OSL_TRACE ("Clipboard::AcceptDrop() called for index %d",

View File

@@ -265,7 +265,6 @@ void FocusManager::ShowFocusIndicator (
{ {
// Scroll the focused page object into the visible area and repaint // Scroll the focused page object into the visible area and repaint
// it, so that the focus indicator becomes visible. // it, so that the focus indicator becomes visible.
view::SlideSorterView& rView (mrSlideSorter.GetView());
mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible ( mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
GetFocusedPageDescriptor()->GetBoundingBox()); GetFocusedPageDescriptor()->GetBoundingBox());
} }

View File

@@ -331,6 +331,9 @@ void Listener::Notify (
rSdrHint.GetPage(), rSdrHint.GetPage(),
true); true);
break; break;
default:
break;
} }
} }
else if (rHint.ISA(ViewShellHint)) else if (rHint.ISA(ViewShellHint))

View File

@@ -58,8 +58,10 @@ ScrollBarManager::ScrollBarManager (SlideSorter& rSlideSorter)
mnHorizontalScrollFactor (0.1), mnHorizontalScrollFactor (0.1),
mnVerticalScrollFactor (0.1), mnVerticalScrollFactor (0.1),
mpScrollBarFiller(mrSlideSorter.GetScrollBarFiller()), mpScrollBarFiller(mrSlideSorter.GetScrollBarFiller()),
mpContentWindow(mrSlideSorter.GetContentWindow()), maAutoScrollTimer(),
maAutoScrollOffset(0,0),
mbIsAutoScrollActive(false), mbIsAutoScrollActive(false),
mpContentWindow(mrSlideSorter.GetContentWindow()),
maAutoScrollFunctor() maAutoScrollFunctor()
{ {
// Hide the scroll bars by default to prevent display errors while // Hide the scroll bars by default to prevent display errors while

View File

@@ -653,7 +653,6 @@ void SelectionFunction::StartDrag (const Point& rMousePosition)
if (mbPageHit if (mbPageHit
&& ! mrSlideSorter.GetProperties()->IsUIReadOnly()) && ! mrSlideSorter.GetProperties()->IsUIReadOnly())
{ {
view::ViewOverlay& rOverlay (mrSlideSorter.GetView().GetOverlay());
mpSubstitutionHandler->Start(rMousePosition); mpSubstitutionHandler->Start(rMousePosition);
mbPageHit = false; mbPageHit = false;
mpWindow->ReleaseMouse(); mpWindow->ReleaseMouse();
@@ -839,6 +838,8 @@ sal_uInt32 SelectionFunction::EncodeKeyEvent (
const EventDescriptor& rDescriptor, const EventDescriptor& rDescriptor,
const KeyEvent& rEvent) const const KeyEvent& rEvent) const
{ {
(void)rDescriptor;
// Initialize as key event. // Initialize as key event.
sal_uInt32 nEventCode (KEY_EVENT); sal_uInt32 nEventCode (KEY_EVENT);

View File

@@ -289,7 +289,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const
const sal_Int32 nCount (maPageDescriptors.size()); const sal_Int32 nCount (maPageDescriptors.size());
for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex) for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex)
{ {
SharedPageDescriptor pDescriptor (maPageDescriptors[nIndex]); pDescriptor = maPageDescriptors[nIndex];
// Make sure that the descriptor exists. Without it the given slide // Make sure that the descriptor exists. Without it the given slide
// can not be found. // can not be found.

View File

@@ -238,7 +238,6 @@ SlideSorter::~SlideSorter (void)
mpHorizontalScrollBar.reset(); mpHorizontalScrollBar.reset();
mpVerticalScrollBar.reset(); mpVerticalScrollBar.reset();
mpScrollBarBox.reset(); mpScrollBarBox.reset();
const int nCount (mpContentWindow.use_count());
OSL_ASSERT(mpContentWindow.unique()); OSL_ASSERT(mpContentWindow.unique());
OSL_ASSERT(mpContentWindow.use_count()==1); OSL_ASSERT(mpContentWindow.use_count()==1);
mpContentWindow.reset(); mpContentWindow.reset();

View File

@@ -92,7 +92,6 @@ using namespace ::drawinglayer::primitive2d;
using ::sd::slidesorter::controller::Animator; using ::sd::slidesorter::controller::Animator;
using ::sd::slidesorter::controller::AnimationFunction; using ::sd::slidesorter::controller::AnimationFunction;
//#define VERBOSE
namespace sd { namespace slidesorter { namespace view { namespace sd { namespace slidesorter { namespace view {
@@ -218,11 +217,11 @@ public:
const Color aBackgroundColor, const Color aBackgroundColor,
const bool bIsAnimated) const bool bIsAnimated)
: mpAnimator(rpAnimator), : mpAnimator(rpAnimator),
mnAnimationId(controller::Animator::NotAnAnimationId),
maBackgroundColor(aBackgroundColor), maBackgroundColor(aBackgroundColor),
maSpheres(), maSpheres(),
mpInvalidator(), mpInvalidator(),
mpWindow(rpWindow) mpWindow(rpWindow),
mnAnimationId(controller::Animator::NotAnAnimationId)
{ {
if (bIsAnimated) if (bIsAnimated)
{ {
@@ -753,7 +752,7 @@ Rectangle SlideSorterView::GetModelArea (void)
} }
static sal_Int32 nPaintIndex = 0;
void SlideSorterView::CompleteRedraw ( void SlideSorterView::CompleteRedraw (
OutputDevice* pDevice, OutputDevice* pDevice,
@@ -771,28 +770,12 @@ void SlideSorterView::CompleteRedraw (
if (mnLockRedrawSmph == 0) if (mnLockRedrawSmph == 0)
{ {
#ifdef VERBOSE
OSL_TRACE("%5d CompleteRedraw %d %d %d %d",
nPaintIndex++,
rPaintArea.GetBoundRect().Left(),
rPaintArea.GetBoundRect().Top(),
rPaintArea.GetBoundRect().GetWidth(),
rPaintArea.GetBoundRect().GetHeight());
#endif
mrSlideSorter.GetContentWindow()->IncrementLockCount(); mrSlideSorter.GetContentWindow()->IncrementLockCount();
mpLayeredDevice->Repaint(rPaintArea); mpLayeredDevice->Repaint(rPaintArea);
mrSlideSorter.GetContentWindow()->DecrementLockCount(); mrSlideSorter.GetContentWindow()->DecrementLockCount();
#ifdef VERBOSE
OSL_TRACE("CompleteRedraw done");
#endif
} }
else else
{ {
#ifdef VERBOSE
OSL_TRACE("%5d CompleteRedraw while locked", nPaintIndex++);
#endif
View::CompleteRedraw(pDevice, rPaintArea, pRedirector); View::CompleteRedraw(pDevice, rPaintArea, pRedirector);
} }
} }
@@ -974,6 +957,10 @@ bool SlideSorterView::SetState (
case PageDescriptor::ST_Excluded: case PageDescriptor::ST_Excluded:
AddVisualStateAnimation(rpDescriptor); AddVisualStateAnimation(rpDescriptor);
break; break;
case PageDescriptor::ST_WasSelected:
// Ignore.
break;
} }
// Fade in or out the buttons. // Fade in or out the buttons.

View File

@@ -132,7 +132,7 @@ void LayeredDevice::Invalidate (
const Rectangle& rInvalidationArea, const Rectangle& rInvalidationArea,
const sal_Int32 nLayer) const sal_Int32 nLayer)
{ {
if (nLayer<0 || nLayer>=maLayers.size()) if (nLayer<0 || sal_uInt32(nLayer)>=maLayers.size())
{ {
OSL_ASSERT(nLayer>=0 && nLayer<maLayers.size()); OSL_ASSERT(nLayer>=0 && nLayer<maLayers.size());
return; return;
@@ -146,7 +146,7 @@ void LayeredDevice::Invalidate (
void LayeredDevice::InvalidateAllLayers (const Rectangle& rInvalidationArea) void LayeredDevice::InvalidateAllLayers (const Rectangle& rInvalidationArea)
{ {
for (sal_Int32 nLayer=0; nLayer<maLayers.size(); ++nLayer) for (sal_uInt32 nLayer=0; nLayer<maLayers.size(); ++nLayer)
maLayers[nLayer].Invalidate(rInvalidationArea); maLayers[nLayer].Invalidate(rInvalidationArea);
} }
@@ -168,7 +168,7 @@ void LayeredDevice::RegisterPainter (
return; return;
} }
if (nLayer >= maLayers.size()) if (sal_uInt32(nLayer) >= maLayers.size())
maLayers.resize(nLayer+1); maLayers.resize(nLayer+1);
maLayers[nLayer].AddPainter(rpPainter); maLayers[nLayer].AddPainter(rpPainter);
if (nLayer == 0) if (nLayer == 0)
@@ -190,7 +190,7 @@ void LayeredDevice::RemovePainter (
OSL_ASSERT(rpPainter); OSL_ASSERT(rpPainter);
return; return;
} }
if (nLayer<0 || nLayer>=maLayers.size()) if (nLayer<0 || sal_uInt32(nLayer)>=maLayers.size())
{ {
OSL_ASSERT(nLayer>=0 && nLayer<maLayers.size()); OSL_ASSERT(nLayer>=0 && nLayer<maLayers.size());
return; return;
@@ -210,7 +210,9 @@ void LayeredDevice::RemovePainter (
bool LayeredDevice::HasPainter (const sal_Int32 nLayer) bool LayeredDevice::HasPainter (const sal_Int32 nLayer)
{ {
return maLayers.size()>nLayer && maLayers[nLayer].HasPainter(); return nLayer>=0
&& sal_uInt32(nLayer)<maLayers.size()
&& maLayers[nLayer].HasPainter();
} }

View File

@@ -379,8 +379,8 @@ Rectangle Layouter::GetPageObjectBox (
const sal_Int32 nIndex, const sal_Int32 nIndex,
const bool bIncludeBorderAndGap) const const bool bIncludeBorderAndGap) const
{ {
int nColumn = nIndex % mnColumnCount; const sal_Int32 nRow (GetRow(nIndex));
int nRow = nIndex / mnColumnCount; const sal_Int32 nColumn (GetColumn(nIndex));
Rectangle aBoundingBox( Rectangle aBoundingBox(
Point (mnLeftBorder Point (mnLeftBorder
+ nColumn * maPageObjectSize.Width() + nColumn * maPageObjectSize.Width()
@@ -391,8 +391,6 @@ Rectangle Layouter::GetPageObjectBox (
maPageObjectSize); maPageObjectSize);
if (bIncludeBorderAndGap) if (bIncludeBorderAndGap)
{ {
const sal_Int32 nRow (GetRow(nIndex));
const sal_Int32 nColumn (GetColumn(nIndex));
if (nColumn == 0) if (nColumn == 0)
aBoundingBox.Left() = 0; aBoundingBox.Left() = 0;
else else

View File

@@ -237,8 +237,6 @@ Rectangle PageObjectLayouter::GetBoundingBox (
return Rectangle( return Rectangle(
aBoundingBox.TopLeft() + aLocation, aBoundingBox.TopLeft() + aLocation,
aBoundingBox.BottomRight() + aLocation); aBoundingBox.BottomRight() + aLocation);
return aBoundingBox;
} }

View File

@@ -221,7 +221,7 @@ void PageObjectPainter::PaintBackground (
const ColorData nColor (GetColorForVisualState(rpDescriptor)); const ColorData nColor (GetColorForVisualState(rpDescriptor));
rDevice.SetFillColor(Color(nColor & 0x00ffffff)); rDevice.SetFillColor(Color(nColor & 0x00ffffff));
const double nTransparency (COLORDATA_TRANSPARENCY(nColor)/255.0); double nTransparency (COLORDATA_TRANSPARENCY(nColor)/255.0);
rDevice.DrawTransparent( rDevice.DrawTransparent(
::basegfx::B2DPolyPolygon( ::basegfx::B2DPolyPolygon(
::basegfx::tools::createPolygonFromRect( ::basegfx::tools::createPolygonFromRect(
@@ -233,7 +233,7 @@ void PageObjectPainter::PaintBackground (
if (rpDescriptor->HasState(model::PageDescriptor::ST_MouseOver)) if (rpDescriptor->HasState(model::PageDescriptor::ST_MouseOver))
{ {
rDevice.SetFillColor(Color(MouseOverColor & 0x00ffffff)); rDevice.SetFillColor(Color(MouseOverColor & 0x00ffffff));
double nTransparency (COLORDATA_TRANSPARENCY(MouseOverColor)/255.0); nTransparency = COLORDATA_TRANSPARENCY(MouseOverColor)/255.0;
nTransparency *= 1-rpDescriptor->GetVisualState().GetVisualStateBlend(); nTransparency *= 1-rpDescriptor->GetVisualState().GetVisualStateBlend();
rDevice.DrawTransparent( rDevice.DrawTransparent(
::basegfx::B2DPolyPolygon( ::basegfx::B2DPolyPolygon(

View File

@@ -518,12 +518,13 @@ void SelectionRectangleOverlay::Paint (
::std::min(maAnchor.Y(), maSecondCorner.Y()), ::std::min(maAnchor.Y(), maSecondCorner.Y()),
::std::max(maAnchor.X(), maSecondCorner.X()), ::std::max(maAnchor.X(), maSecondCorner.X()),
::std::max(maAnchor.Y(), maSecondCorner.Y())); ::std::max(maAnchor.Y(), maSecondCorner.Y()));
rDevice.DrawTransparent( if (rRepaintArea.IsOver(aBox))
rDevice.DrawTransparent(
::basegfx::B2DPolyPolygon( ::basegfx::B2DPolyPolygon(
::basegfx::tools::createPolygonFromRect( ::basegfx::tools::createPolygonFromRect(
::basegfx::B2DRectangle(aBox.Left(), aBox.Top(), aBox.Right(), aBox.Bottom()), ::basegfx::B2DRectangle(aBox.Left(), aBox.Top(), aBox.Right(), aBox.Bottom()),
5.0/aBox.GetWidth(), 5.0/aBox.GetWidth(),
5.0/aBox.GetHeight())), 5.0/aBox.GetHeight())),
0.5); 0.5);
} }