Resolves: #i123497# corrected modify implementations for bitmap...

lineend and color

(cherry picked from commit 03fa6020a862b1b6faf69f33274022cb871e8f4b)

Conflicts:
	cui/source/tabpages/tpbitmap.cxx
	cui/source/tabpages/tpcolor.cxx
	cui/source/tabpages/tplneend.cxx

Change-Id: Ib99e8f0a59fb611972133bab1e864d59d019457b
This commit is contained in:
Armin Le Grand
2013-10-25 16:22:15 +00:00
committed by Caolán McNamara
parent 2c6b6ba446
commit 518d3592e6
3 changed files with 28 additions and 13 deletions

View File

@@ -685,9 +685,12 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
bLoop = sal_False;
const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx());
const XBitmapEntry aEntry(Graphic(aBitmapEx), aName);
m_pLbBitmaps->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), aEntry, nPos );
// #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
XBitmapEntry* pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName);
delete pBitmapList->Replace(pEntry, nPos);
m_pLbBitmaps->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos );
m_pLbBitmaps->SelectEntryPos( nPos );
*pnBitmapListState |= CT_MODIFIED;

View File

@@ -794,13 +794,15 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
if (eCM != CM_RGB)
ConvertColorValues (aTmpColor, CM_RGB);
const XColorEntry aEntry(aTmpColor, aName);
// #123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
XColorEntry* pEntry = new XColorEntry(aTmpColor, aName);
delete pColorList->Replace(pEntry, nPos);
m_pLbColor->Modify( aEntry, nPos );
m_pLbColor->Modify( *pEntry, nPos );
m_pLbColor->SelectEntryPos( nPos );
m_pValSetColorList->SetItemColor( nPos + 1, aEntry.GetColor() );
m_pValSetColorList->SetItemText( nPos + 1, aEntry.GetName() );
m_pValSetColorList->SetItemColor( nPos + 1, pEntry->GetColor() );
m_pValSetColorList->SetItemText( nPos + 1, pEntry->GetName() );
m_pEdtName->SetText( aName );
m_pCtlPreviewOld->Invalidate();

View File

@@ -358,18 +358,28 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
// if not existing, enter the entry
if( bDifferent )
{
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
const XLineEndEntry* pOldEntry = pLineEndList->GetLineEnd( nPos );
m_pEdtName->SetText( aName );
if(pOldEntry)
{
// #123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
XLineEndEntry* pEntry = new XLineEndEntry(pOldEntry->GetLineEnd(), aName);
delete pLineEndList->Replace(pEntry, nPos);
const XLineEndEntry aEntry(pEntry->GetLineEnd(), aName);
m_pEdtName->SetText( aName );
m_pLbLineEnds->Modify( aEntry, nPos, pLineEndList->GetUiBitmap( nPos ) );
m_pLbLineEnds->SelectEntryPos( nPos );
m_pLbLineEnds->Modify( *pEntry, nPos, pLineEndList->GetUiBitmap( nPos ) );
m_pLbLineEnds->SelectEntryPos( nPos );
*pnLineEndListState |= CT_MODIFIED;
// Flag fuer modifiziert setzen
*pnLineEndListState |= CT_MODIFIED;
*pPageType = 3;
*pPageType = 3;
}
else
{
OSL_ENSURE(false, "LineEnd to be modified not existing (!)");
}
}
}
return( 0L );