diff options
author | Andre Fischer <af@openoffice.org> | 2010-02-12 13:58:24 +0100 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2010-02-12 13:58:24 +0100 |
commit | ab518ae9111d251a4e6267ae9f40836b8a7a3913 (patch) | |
tree | a283642af55ae4f76dbb28ab09fba62627257b01 /sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx | |
parent | 2336af0eb45bee98f98b0ac9a6988bfd0e6193e5 (diff) |
renaissance1: #i107215# Adaption to latest changes of the spec.
Diffstat (limited to 'sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx')
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx index 24cd3e0cdc86..be5c5066863a 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx @@ -39,11 +39,9 @@ namespace sd { namespace slidesorter { namespace view { -const sal_Int32 PageObjectLayouter::mnSelectionIndicatorOffset = 0; -const sal_Int32 PageObjectLayouter::mnSelectionIndicatorThickness = 3; -const sal_Int32 PageObjectLayouter::mnFocusIndicatorOffset = 3; const sal_Int32 PageObjectLayouter::mnPageNumberOffset = 9; -const sal_Int32 PageObjectLayouter::mnOuterBorderWidth = 5; +const sal_Int32 PageObjectLayouter::mnOuterBorderWidth = 6; +const sal_Int32 PageObjectLayouter::mnInfoAreaMinWidth = 26; const Size PageObjectLayouter::maButtonSize (32,32); const sal_Int32 PageObjectLayouter::mnButtonGap (5); @@ -51,23 +49,23 @@ const sal_Int32 PageObjectLayouter::mnButtonGap (5); PageObjectLayouter::PageObjectLayouter ( const Size& rPageObjectWindowSize, const Size& rPageSize, - const ::boost::shared_ptr< ::Window>& rpWindow, - const int nPageCount) + const SharedSdWindow& rpWindow, + const sal_Int32 nPageCount) : mpWindow(rpWindow), maPageObjectSize(rPageObjectWindowSize.Width(), rPageObjectWindowSize.Height()), mnModelToWindowScale(1), maPageObjectBoundingBox(), maPageNumberAreaBoundingBox(), maPreviewBoundingBox(), - maFocusIndicatorBoundingBox(), - maSelectionIndicatorBoundingBox(), maTransitionEffectBoundingBox(), maButtonAreaBoundingBox(), maTransitionEffectIcon(IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)) { const Size aPageNumberAreaSize (GetPageNumberAreaSize(nPageCount)); - const int nMaximumBorderWidth (mnSelectionIndicatorOffset + mnOuterBorderWidth); + const int nMaximumBorderWidth (mnOuterBorderWidth); + + // Set up some bounding boxes relative to the page object origin. maPageNumberAreaBoundingBox = Rectangle( mnPageNumberOffset, @@ -78,21 +76,9 @@ PageObjectLayouter::PageObjectLayouter ( maPreviewBoundingBox = CalculatePreviewBoundingBox( maPageObjectSize, Size(rPageSize.Width(), rPageSize.Height()), - aPageNumberAreaSize); + ::std::min(aPageNumberAreaSize.Width(), mnInfoAreaMinWidth)); maPageObjectBoundingBox = Rectangle(Point(0,0), maPageObjectSize); - maFocusIndicatorBoundingBox = maPreviewBoundingBox; - maFocusIndicatorBoundingBox.Left() -= mnFocusIndicatorOffset; - maFocusIndicatorBoundingBox.Top() -= mnFocusIndicatorOffset; - maFocusIndicatorBoundingBox.Right() += mnFocusIndicatorOffset; - maFocusIndicatorBoundingBox.Bottom() += mnFocusIndicatorOffset; - - maSelectionIndicatorBoundingBox = maPreviewBoundingBox; - maSelectionIndicatorBoundingBox.Left() -= mnSelectionIndicatorOffset; - maSelectionIndicatorBoundingBox.Top() -= mnSelectionIndicatorOffset; - maSelectionIndicatorBoundingBox.Right() += mnSelectionIndicatorOffset; - maSelectionIndicatorBoundingBox.Bottom() += mnSelectionIndicatorOffset; - const Size aIconSize (maTransitionEffectIcon.GetSizePixel()); const int nLeft (maPreviewBoundingBox.Left() - mnPageNumberOffset - aIconSize.Width() - nMaximumBorderWidth); @@ -113,16 +99,23 @@ PageObjectLayouter::PageObjectLayouter ( +PageObjectLayouter::~PageObjectLayouter(void) +{ +} + + + + Rectangle PageObjectLayouter::CalculatePreviewBoundingBox ( Size& rPageObjectSize, const Size& rPageSize, - const Size& rPageNumberAreaSize) + const sal_Int32 nInfoAreaWidth) { - const int nMaximumBorderWidth (mnSelectionIndicatorOffset + mnOuterBorderWidth); + const int nMaximumBorderWidth (mnOuterBorderWidth); const int nLeftAreaWidth ( 2*mnPageNumberOffset + ::std::max( - rPageNumberAreaSize.Width(), + nInfoAreaWidth, maTransitionEffectIcon.GetSizePixel().Width())); int nPreviewWidth; int nPreviewHeight; @@ -178,12 +171,6 @@ Rectangle PageObjectLayouter::GetBoundingBox ( const CoordinateSystem eCoordinateSystem, const sal_Int32 nIndex) { - if ( ! rpPageDescriptor) - { - OSL_ASSERT(rpPageDescriptor); - return Rectangle(); - } - Rectangle aBoundingBox; switch (ePart) { @@ -196,14 +183,6 @@ Rectangle PageObjectLayouter::GetBoundingBox ( aBoundingBox = maPreviewBoundingBox; break; - case FocusIndicator: - aBoundingBox = maFocusIndicatorBoundingBox; - break; - - case SelectionIndicator: - aBoundingBox = maSelectionIndicatorBoundingBox; - break; - case PageNumber: aBoundingBox = maPageNumberAreaBoundingBox; break; @@ -230,7 +209,7 @@ Rectangle PageObjectLayouter::GetBoundingBox ( break; } - Point aLocation (rpPageDescriptor->GetLocation()); + Point aLocation (rpPageDescriptor ? rpPageDescriptor->GetLocation() : Point(0,0)); if (eCoordinateSystem == ScreenCoordinateSystem) aLocation += mpWindow->GetMapMode().GetOrigin(); |