sd/source/ui/animations/CustomAnimation.hrc     |    4 ++
 sd/source/ui/animations/CustomAnimation.src     |   21 ++++++++++++
 sd/source/ui/animations/CustomAnimationList.cxx |   40 +++++++++++++++---------
 3 files changed, 50 insertions(+), 15 deletions(-)

New commits:
commit b3a28e359a527a307edf843e8590c2a73591cfe3
Author: Akshay Deep <akshaydeepi...@gmail.com>
Date:   Wed Mar 9 22:21:25 2016 +0530

    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.mehrbr...@cib.de>
    Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sd/source/ui/animations/CustomAnimation.hrc 
b/sd/source/ui/animations/CustomAnimation.hrc
index 495d5c1..0348eed 100644
--- a/sd/source/ui/animations/CustomAnimation.hrc
+++ b/sd/source/ui/animations/CustomAnimation.hrc
@@ -82,6 +82,10 @@
 #define STR_CUSTOMANIMATION_LIST_HELPTEXT               
RID_CUSTOMANIMATION_START+36
 #define STR_CUSTOMANIMATION_USERPATH                    
RID_CUSTOMANIMATION_START+37
 #define STR_SLIDETRANSITION_NONE                        
RID_CUSTOMANIMATION_START+38
+#define STR_CUSTOMANIMATION_ENTRANCE                    
RID_CUSTOMANIMATION_START+39
+#define STR_CUSTOMANIMATION_EMPHASIS                    
RID_CUSTOMANIMATION_START+40
+#define STR_CUSTOMANIMATION_EXIT                        
RID_CUSTOMANIMATION_START+41
+#define STR_CUSTOMANIMATION_MOTION_PATHS                
RID_CUSTOMANIMATION_START+42
 
 #define CM_WITH_CLICK               1
 #define CM_WITH_PREVIOUS            2
diff --git a/sd/source/ui/animations/CustomAnimation.src 
b/sd/source/ui/animations/CustomAnimation.src
index 24e6ac2..3d13175 100644
--- a/sd/source/ui/animations/CustomAnimation.src
+++ b/sd/source/ui/animations/CustomAnimation.src
@@ -389,6 +389,27 @@ String STR_CUSTOMANIMATION_USERPATH
     Text [ en-US ] = "User paths";
 };
 
+String STR_CUSTOMANIMATION_ENTRANCE
+{
+    Text [ en-US ] = "Entrance: %1";
+};
+
+String STR_CUSTOMANIMATION_EMPHASIS
+{
+    Text [ en-US ] = "Emphasis: %1";
+};
+
+String STR_CUSTOMANIMATION_EXIT
+{
+    Text [ en-US ] = "Exit: %1";
+};
+
+String STR_CUSTOMANIMATION_MOTION_PATHS
+{
+    Text [ en-US ] = "Motion Paths: %1";
+};
+
+
 String STR_SLIDETRANSITION_NONE
 {
     Text [ en-US ] = "None";
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx 
b/sd/source/ui/animations/CustomAnimationList.cxx
index 2ef0644..dcbefca 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();
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to