summaryrefslogtreecommitdiff
path: root/sd/source/ui/animations/CustomAnimationList.cxx
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-03-09 22:21:25 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-03-10 08:29:33 +0000
commitb3a28e359a527a307edf843e8590c2a73591cfe3 (patch)
tree389a6599fe1d0acef812cf7bccb7307a5854662f /sd/source/ui/animations/CustomAnimationList.cxx
parentd2aec5d4f804f543fa83356ec18feeb6d76b5a16 (diff)
tdf#87812: SIDEBAR: More animation information in list control
Added Effect Category in second line of list item. Changed variable names according to conventions. Change-Id: I611f3cd377eb5865f125c76c145266571b6d4985 Reviewed-on: https://gerrit.libreoffice.org/23095 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sd/source/ui/animations/CustomAnimationList.cxx')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx40
1 files changed, 25 insertions, 15 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 2ef0644e395c..dcbefcaf8b49 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -214,8 +214,8 @@ public:
const SvViewDataEntry* pView,const SvTreeListEntry& rEntry) override;
private:
VclPtr<CustomAnimationList> mpParent;
- OUString maDescription;
- OUString effectName;
+ OUString msDescription;
+ OUString msEffectName;
CustomAnimationEffectPtr mpEffect;
const CustomAnimationPresets* mpCustomAnimationPresets;
const long nIconWidth = 19;
@@ -225,16 +225,26 @@ private:
CustomAnimationListEntryItem::CustomAnimationListEntryItem( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& aDescription, CustomAnimationEffectPtr pEffect, CustomAnimationList* pParent )
: SvLBoxString( pEntry, nFlags, aDescription )
, mpParent( pParent )
-, maDescription( aDescription )
-, effectName( OUString() )
+, msDescription( aDescription )
+, msEffectName( OUString() )
, mpEffect(pEffect)
, mpCustomAnimationPresets(&CustomAnimationPresets::getCustomAnimationPresets())
{
- effectName = mpCustomAnimationPresets->getUINameForPresetId(mpEffect->getPresetId());
+ switch(mpEffect->getPresetClass())
+ {
+ case EffectPresetClass::ENTRANCE:
+ msEffectName = SD_RESSTR(STR_CUSTOMANIMATION_ENTRANCE); break;
+ case EffectPresetClass::EXIT:
+ msEffectName = SD_RESSTR(STR_CUSTOMANIMATION_EXIT); break;
+ case EffectPresetClass::EMPHASIS:
+ msEffectName = SD_RESSTR(STR_CUSTOMANIMATION_EMPHASIS); break;
+ case EffectPresetClass::MOTIONPATH:
+ msEffectName = SD_RESSTR(STR_CUSTOMANIMATION_MOTION_PATHS); break;
+ }
+ msEffectName = msEffectName.replaceFirst( "%1" , mpCustomAnimationPresets->getUINameForPresetId(mpEffect->getPresetId()));
}
-
CustomAnimationListEntryItem::~CustomAnimationListEntryItem()
{
}
@@ -245,9 +255,9 @@ void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvTreeLis
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- long width = pView->GetTextWidth( maDescription ) + nIconWidth;
- if( width < (pView->GetTextWidth( effectName ) + 2*nIconWidth))
- width = pView->GetTextWidth( effectName ) + 2*nIconWidth;
+ long width = pView->GetTextWidth( msDescription ) + nIconWidth;
+ if( width < (pView->GetTextWidth( msEffectName ) + 2*nIconWidth))
+ width = pView->GetTextWidth( msEffectName ) + 2*nIconWidth;
Size aSize( width, pView->GetTextHeight() );
if( aSize.Height() < nItemMinHeight )
@@ -281,7 +291,7 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
aPos.X() += nIconWidth;
- rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(maDescription, rDev.GetOutputSizePixel().Width() - aPos.X()));
+ rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msDescription, rDev.GetOutputSizePixel().Width() - aPos.X()));
aPos.Y() += nIconWidth;
@@ -325,7 +335,7 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev,
aPos.X() += nIconWidth;
aPos.Y() += (aSize.Height()/2 - rDev.GetTextHeight()) >> 1;
- rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(effectName, rDev.GetOutputSizePixel().Width() - aPos.X()));
+ rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rDev.GetOutputSizePixel().Width() - aPos.X()));
}
SvLBoxItem* CustomAnimationListEntryItem::Create() const
@@ -375,12 +385,12 @@ public:
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
private:
- OUString maDescription;
+ OUString msDescription;
const long nIconWidth = 19;
};
CustomAnimationTriggerEntryItem::CustomAnimationTriggerEntryItem( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& aDescription )
-: SvLBoxString( pEntry, nFlags, aDescription ), maDescription( aDescription )
+: SvLBoxString( pEntry, nFlags, aDescription ), msDescription( aDescription )
{
}
@@ -393,7 +403,7 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvTree
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- Size aSize(pView->GetTextWidth( maDescription ) + 2 * nIconWidth, pView->GetTextHeight() );
+ Size aSize(pView->GetTextWidth( msDescription ) + 2 * nIconWidth, pView->GetTextHeight() );
if( aSize.Height() < nIconWidth )
aSize.Height() = nIconWidth;
pViewData->maSize = aSize;
@@ -433,7 +443,7 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD
aOutRect.Top() += nVertBorder;
aOutRect.Bottom() -= nVertBorder;
- rRenderContext.DrawText(aOutRect, rRenderContext.GetEllipsisString(maDescription, aOutRect.GetWidth()));
+ rRenderContext.DrawText(aOutRect, rRenderContext.GetEllipsisString(msDescription, aOutRect.GetWidth()));
rRenderContext.Pop();
}