You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2013/03/12 16:08:42 UTC

svn commit: r1455569 - in /openoffice/branches/sidebar/main/svx: inc/svx/sidebar/ValueSetWithTextControl.hxx source/sidebar/tools/ValueSetWithTextControl.cxx

Author: orw
Date: Tue Mar 12 15:08:42 2013
New Revision: 1455569

URL: http://svn.apache.org/r1455569
Log:
#121420# - svx::sidebar::ValueSetWithTextControl - new method <ReplaceItemImages(..)>

Modified:
    openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ValueSetWithTextControl.hxx
    openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx

Modified: openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ValueSetWithTextControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ValueSetWithTextControl.hxx?rev=1455569&r1=1455568&r2=1455569&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ValueSetWithTextControl.hxx (original)
+++ openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ValueSetWithTextControl.hxx Tue Mar 12 15:08:42 2013
@@ -69,6 +69,12 @@ public:
         const XubString& rItemText,
         const XubString* pItemHelpText );
 
+    // replace item images for control type IMAGE_TEXT
+    void ReplaceItemImages(
+        const sal_uInt16 nItemId,
+        const Image& rItemImage,
+        const Image* pSelectedItemImage );
+
     // add item for control type TEXT_TEXT
     // if control type does not match TEXT_TEXT no item is added.
     // @param pItemHelpText

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx?rev=1455569&r1=1455568&r2=1455569&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/tools/ValueSetWithTextControl.cxx Tue Mar 12 15:08:42 2013
@@ -38,10 +38,12 @@ ValueSetWithTextControl::ValueSetWithTex
     SetColCount( 1 );
 }
 
+
 ValueSetWithTextControl::~ValueSetWithTextControl(void)
 {
 }
 
+
 void ValueSetWithTextControl::AddItem(
     const Image& rItemImage,
     const Image* pSelectedItemImage,
@@ -67,6 +69,7 @@ void ValueSetWithTextControl::AddItem(
                     (pItemHelpText != 0) ? *pItemHelpText : rItemText );
 }
 
+
 void ValueSetWithTextControl::AddItem(
     const XubString& rItemText,
     const XubString& rItemText2,
@@ -88,6 +91,30 @@ void ValueSetWithTextControl::AddItem(
                     (pItemHelpText != 0) ? *pItemHelpText : rItemText );
 }
 
+
+void ValueSetWithTextControl::ReplaceItemImages(
+    const sal_uInt16 nItemId,
+    const Image& rItemImage,
+    const Image* pSelectedItemImage )
+{
+    if ( meControlType != IMAGE_TEXT )
+    {
+        return;
+    }
+
+    if ( nItemId == 0 ||
+         nItemId > maItems.size() )
+    {
+        return;
+    }
+
+    maItems[nItemId-1].maItemImage = rItemImage;
+    maItems[nItemId-1].maSelectedItemImage = (pSelectedItemImage != 0)
+                                             ? *pSelectedItemImage
+                                             : rItemImage;
+}
+
+    
 void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt )
 {
     const Rectangle aRect = rUDEvt.GetRect();