Author: arielch
Date: Thu Dec  6 13:27:43 2012
New Revision: 1417846

URL: http://svn.apache.org/viewvc?rev=1417846&view=rev
Log:
#i121442# - Allow redrawing a single status bar item

A StatusbarController that draws its status bar item may need to trigger
a repainting of its item when the feature state changes. Currently, the
only way to trigger this redraw is by changing the item text or the item
data, so that the vcl implementation calls ImplDrawItem; this is rather
implementation-specific.

Modified:
    openoffice/trunk/main/vcl/inc/vcl/status.hxx
    openoffice/trunk/main/vcl/source/window/status.cxx

Modified: openoffice/trunk/main/vcl/inc/vcl/status.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/status.hxx?rev=1417846&r1=1417845&r2=1417846&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/status.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/status.hxx Thu Dec  6 13:27:43 2012
@@ -147,6 +147,8 @@ public:
        void                            HideItems();
        sal_Bool                                AreItemsVisible() const { 
return mbVisibleItems; }
 
+    void                RedrawItem( sal_uInt16 nItemId );
+
        void                            CopyItems( const StatusBar& rStatusBar 
);
        void                            Clear();
 

Modified: openoffice/trunk/main/vcl/source/window/status.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/window/status.cxx?rev=1417846&r1=1417845&r2=1417846&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/window/status.cxx (original)
+++ openoffice/trunk/main/vcl/source/window/status.cxx Thu Dec  6 13:27:43 2012
@@ -1439,6 +1439,25 @@ void StatusBar::SetItemData( sal_uInt16 
        }
 }
 
+void StatusBar::RedrawItem( sal_uInt16 nItemId )
+{
+    if ( mbFormat )
+        return;
+
+    sal_uInt16 nPos = GetItemPos( nItemId );
+    if ( nPos == STATUSBAR_ITEM_NOTFOUND )
+        return;
+
+    ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+    if ( pItem && (pItem->mnBits & SIB_USERDRAW) &&
+         pItem->mbVisible && ImplIsItemUpdate() )
+    {
+        Update();
+        ImplDrawItem( sal_True, nPos, sal_False, sal_False );
+        Flush();
+    }
+}
+
 // -----------------------------------------------------------------------
 
 void* StatusBar::GetItemData( sal_uInt16 nItemId ) const


Reply via email to