diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-07-15 21:59:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-15 22:03:48 +0100 |
commit | aa3eeb28bcba10d603c15ee850620bed638514f5 (patch) | |
tree | 7c3e84597ca40b733aa157a10a2b7a5352c2654f /svtools/source/contnr | |
parent | facd391b7fc46b330e4cbda25c33abed5e47604e (diff) |
Resolves: fdo#37279 and #i78701# startEditingAtNode does nothing
inherit class UnoTreeListItem from SvLBoxString instead of SvLBoxItem so that
it really isa SvLBoxString and can be edited with startEditingAtNode
a) remove the unused SvLBoxEntry argument to SvLBoxString's SetText
b) used rtl::OUString instead of XubString
c) rename aStr to maText
d) inherit UnoTreeListItem from SvLBoxString and drop its maText in
favour of that of SvLBoxEntry
Change-Id: Id78f43ae5be8cd6f581e6c2fd2bd6f46de9144ba
Diffstat (limited to 'svtools/source/contnr')
-rw-r--r-- | svtools/source/contnr/svlbitm.cxx | 20 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 7 |
3 files changed, 12 insertions, 19 deletions
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index f3a669fdc26f..509654adac96 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -197,11 +197,11 @@ sal_Bool SvLBoxButtonData::IsRadio() { DBG_NAME(SvLBoxString); -SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) : - SvLBoxItem( pEntry, nFlags ) +SvLBoxString::SvLBoxString(SvLBoxEntry* pEntry, sal_uInt16 nFlags, const rtl::OUString& rStr) + : SvLBoxItem(pEntry, nFlags) { DBG_CTOR(SvLBoxString,0); - SetText( pEntry, rStr ); + SetText(rStr); } SvLBoxString::SvLBoxString() : SvLBoxItem() @@ -229,10 +229,10 @@ void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE; if ( rDev.IsEntryMnemonicsEnabled() ) nStyle |= TEXT_DRAW_MNEMONIC; - rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle); + rDev.DrawText(Rectangle(rPos, GetSize(&rDev,_pEntry)), maText, nStyle); } else - rDev.DrawText( rPos, aStr); + rDev.DrawText(rPos, maText); } @@ -245,13 +245,7 @@ SvLBoxItem* SvLBoxString::Create() const void SvLBoxString::Clone( SvLBoxItem* pSource ) { DBG_CHKTHIS(SvLBoxString,0); - aStr = ((SvLBoxString*)pSource)->aStr; -} - -void SvLBoxString::SetText( SvLBoxEntry*, const XubString& rStr ) -{ - DBG_CHKTHIS(SvLBoxString,0); - aStr = rStr; + maText = ((SvLBoxString*)pSource)->maText; } void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, @@ -260,7 +254,7 @@ void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, DBG_CHKTHIS(SvLBoxString,0); if( !pViewData ) pViewData = pView->GetViewDataItem( pEntry, this ); - pViewData->aSize = Size(pView->GetTextWidth( aStr ), pView->GetTextHeight()); + pViewData->aSize = Size(pView->GetTextWidth(maText), pView->GetTextHeight()); } // *************************************************************** diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index ad019f4c9202..13850f2b4c57 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -341,7 +341,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal aTemp = rtl::OUString(pCurToken, nCurTokenLen); else aTemp.Erase(); // delete all columns without a token - ((SvLBoxString*)pStr)->SetText( pEntry, aTemp ); + ((SvLBoxString*)pStr)->SetText( aTemp ); pCurToken = pNextToken; pNextToken = GetToken( pCurToken, nCurTokenLen ); } @@ -350,7 +350,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal if( !nCol ) { aTemp = rtl::OUString(pCurToken, nCurTokenLen); - ((SvLBoxString*)pStr)->SetText( pEntry, aTemp ); + ((SvLBoxString*)pStr)->SetText( aTemp ); if( !pNextToken ) break; pCurToken = pNextToken; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 7e6475e4571f..9cb396631060 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -339,8 +339,7 @@ String SvTreeListBox::SearchEntryText( SvLBoxEntry* pEntry ) const while( nCur < nCount ) { pItem = pEntry->GetItem( nCur ); - if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING && - static_cast<SvLBoxString*>( pItem )->GetText().Len() > 0 ) + if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING && !static_cast<SvLBoxString*>( pItem )->GetText().isEmpty() ) { sRet = static_cast<SvLBoxString*>( pItem )->GetText(); break; @@ -447,7 +446,7 @@ void SvTreeListBox::SetEntryText( SvLBoxEntry* pEntry, const XubString& aStr) DBG_CHKTHIS(SvTreeListBox,0); SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); DBG_ASSERT(pItem,"SetText:Item not found"); - pItem->SetText( pEntry, aStr ); + pItem->SetText( aStr ); pItem->InitViewData( this, pEntry, 0 ); GetModel()->InvalidateEntry( pEntry ); } @@ -1345,7 +1344,7 @@ void SvTreeListBox::EditedText( const XubString& rStr ) { if( EditedEntry( pEdEntry, rStr ) ) { - ((SvLBoxString*)pEdItem)->SetText( pEdEntry, rStr ); + ((SvLBoxString*)pEdItem)->SetText( rStr ); pModel->InvalidateEntry( pEdEntry ); } if( GetSelectionCount() == 0 ) |