[Libreoffice-commits] core.git: cui/source
Armin Le Grand
alg at apache.org
Mon Oct 28 07:08:36 PDT 2013
cui/source/tabpages/tpbitmap.cxx | 7 +++++--
cui/source/tabpages/tpcolor.cxx | 10 ++++++----
cui/source/tabpages/tplneend.cxx | 24 +++++++++++++++++-------
3 files changed, 28 insertions(+), 13 deletions(-)
New commits:
commit 518d3592e69aee30f19cd8cbdfef73131cb43c22
Author: Armin Le Grand <alg at apache.org>
Date: Fri Oct 25 16:22:15 2013 +0000
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
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 6aff2bc..17e89cb 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -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;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index bdb78a2..379e3da 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -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();
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 570eca9..ecaae0a 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -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 );
More information about the Libreoffice-commits
mailing list