Kaydet (Commit) 0dac111a authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

store the paint rect in the SvViewDataEntry for SvTreeListBox

SvViewDataEntry is provided to the item when painting. If we send
the whole rect to the item, it can make better decisions when
painting. Extending or changing the method contract would be too
risky so send this information this way.

Change-Id: I985680a8d053990d992d77e4310853321c0de787
üst 68d06f69
...@@ -52,6 +52,7 @@ class SVT_DLLPUBLIC SvViewDataEntry ...@@ -52,6 +52,7 @@ class SVT_DLLPUBLIC SvViewDataEntry
bool mbFocused:1; bool mbFocused:1;
bool mbCursored:1; bool mbCursored:1;
bool mbSelectable:1; bool mbSelectable:1;
Rectangle maPaintRectangle;
public: public:
SvViewDataEntry(); SvViewDataEntry();
...@@ -74,6 +75,10 @@ public: ...@@ -74,6 +75,10 @@ public:
const SvViewDataItem* GetItem(size_t nPos) const; const SvViewDataItem* GetItem(size_t nPos) const;
SvViewDataItem* GetItem(size_t nPos); SvViewDataItem* GetItem(size_t nPos);
void SetPaintRectangle(Rectangle aRectangle);
Rectangle GetPaintRectangle() const;
}; };
#endif #endif
......
...@@ -3045,6 +3045,8 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT ...@@ -3045,6 +3045,8 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
// draw item // draw item
// center vertically // center vertically
aEntryPos.Y() += ( nTempEntryHeight - aSize.Height() ) / 2; aEntryPos.Y() += ( nTempEntryHeight - aSize.Height() ) / 2;
pViewDataEntry->SetPaintRectangle(aRect);
pItem->Paint(aEntryPos, *this, pViewDataEntry, pEntry); pItem->Paint(aEntryPos, *this, pViewDataEntry, pEntry);
// division line between tabs // division line between tabs
......
...@@ -26,7 +26,8 @@ SvViewDataEntry::SvViewDataEntry() : ...@@ -26,7 +26,8 @@ SvViewDataEntry::SvViewDataEntry() :
mbExpanded(false), mbExpanded(false),
mbFocused(false), mbFocused(false),
mbCursored(false), mbCursored(false),
mbSelectable(true) mbSelectable(true),
maPaintRectangle()
{ {
} }
...@@ -37,7 +38,8 @@ SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) : ...@@ -37,7 +38,8 @@ SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) :
mbExpanded(rData.mbExpanded), mbExpanded(rData.mbExpanded),
mbFocused(false), mbFocused(false),
mbCursored(rData.mbCursored), mbCursored(rData.mbCursored),
mbSelectable(rData.mbSelectable) mbSelectable(rData.mbSelectable),
maPaintRectangle(rData.maPaintRectangle)
{ {
} }
...@@ -48,12 +50,6 @@ SvViewDataEntry::~SvViewDataEntry() ...@@ -48,12 +50,6 @@ SvViewDataEntry::~SvViewDataEntry()
#endif #endif
} }
void SvViewDataEntry::SetFocus( bool bFocus ) void SvViewDataEntry::SetFocus( bool bFocus )
{ {
mbFocused = bFocus; mbFocused = bFocus;
...@@ -95,4 +91,14 @@ SvViewDataItem* SvViewDataEntry::GetItem(size_t nPos) ...@@ -95,4 +91,14 @@ SvViewDataItem* SvViewDataEntry::GetItem(size_t nPos)
return &maItems[nPos]; return &maItems[nPos];
} }
void SvViewDataEntry::SetPaintRectangle(Rectangle aRectangle)
{
maPaintRectangle = aRectangle;
}
Rectangle SvViewDataEntry::GetPaintRectangle() const
{
return maPaintRectangle;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment