summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-17 19:39:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-20 18:01:17 +0200
commit2140dea1413c9ef8e6e35409a15b0a3ea7149e67 (patch)
treef2f28dfda11cdd4dc982299669be56ec81fc0aab /sd
parent259d01a34d27df2fbfd11c3bf6fe9dc508ff6ac2 (diff)
split width/height to allow intercept of how width is calculated
in order to possibly get width on demand Change-Id: I1e6fcb6849705f2b166821516ebe72b179e00ee7 Reviewed-on: https://gerrit.libreoffice.org/72513 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index e6cfb0c1d98f..c0b2086abac7 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -270,7 +270,8 @@ void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvTreeLis
Size aSize( width, pView->GetTextHeight() );
if( aSize.Height() < nItemMinHeight )
aSize.setHeight( nItemMinHeight );
- pViewData->maSize = aSize;
+ pViewData->mnWidth = aSize.Width();
+ pViewData->mnHeight = aSize.Height();
}
void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext,
@@ -280,7 +281,7 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
const SvViewDataItem* pViewData = mpParent->GetViewDataItem(&rEntry, this);
Point aPos(rPos);
- Size aSize(pViewData->maSize);
+ int nItemHeight = pViewData->mnHeight;
sal_Int16 nNodeType = mpEffect->getNodeType();
if (nNodeType == EffectNodeType::ON_CLICK )
@@ -336,12 +337,12 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
{
Image aImage(StockImage::Yes, sImage);
Point aImagePos(aPos);
- aImagePos.AdjustY((aSize.Height()/2 - aImage.GetSizePixel().Height()) >> 1 );
+ aImagePos.AdjustY((nItemHeight/2 - aImage.GetSizePixel().Height()) >> 1 );
rRenderContext.DrawImage(aImagePos, aImage);
}
aPos.AdjustX(nIconWidth );
- aPos.AdjustY((aSize.Height()/2 - rDev.GetTextHeight()) >> 1 );
+ aPos.AdjustY((nItemHeight/2 - rDev.GetTextHeight()) >> 1 );
rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rDev.GetOutputSizePixel().Width() - aPos.X()));
}
@@ -400,7 +401,8 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvTree
Size aSize(pView->GetTextWidth( msDescription ) + 2 * nIconWidth, pView->GetTextHeight() );
if( aSize.Height() < nIconWidth )
aSize.setHeight( nIconWidth );
- pViewData->maSize = aSize;
+ pViewData->mnWidth = aSize.Width();
+ pViewData->mnHeight = aSize.Height();
}
void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext,