[Libreoffice-commits] core.git: Branch 'aoo/trunk' - cui/source

Armin Le Grand alg at apache.org
Fri Oct 25 11:08:09 PDT 2013


 cui/source/tabpages/tpbitmap.cxx |    7 +++++--
 cui/source/tabpages/tpcolor.cxx  |   10 ++++++----
 cui/source/tabpages/tplneend.cxx |   25 +++++++++++++++++--------
 3 files changed, 28 insertions(+), 14 deletions(-)

New commits:
commit 03fa6020a862b1b6faf69f33274022cb871e8f4b
Author: Armin Le Grand <alg at apache.org>
Date:   Fri Oct 25 16:22:15 2013 +0000

    i123497 corrected modify implementations for bitmap, lineend and color

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 17b0d7e..1c86921 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -756,9 +756,12 @@ IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
                 bLoop = sal_False;
 
                 const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx());
-                const XBitmapEntry aEntry(Graphic(aBitmapEx), aName);
 
-                aLbBitmaps.Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), aEntry, nPos );
+                // #123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
+                XBitmapEntry* pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName);
+                delete maBitmapList->Replace(pEntry, nPos);
+
+                aLbBitmaps.Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos );
                 aLbBitmaps.SelectEntryPos( nPos );
 
                 // Flag fuer modifiziert setzen
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index d94816c..e9763e0 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -631,13 +631,15 @@ IMPL_LINK( SvxColorTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
             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 maColorTab->Replace(pEntry, nPos);
 
-            aLbColor.Modify( aEntry, nPos );
+            aLbColor.Modify( *pEntry, nPos );
             aLbColor.SelectEntryPos( nPos );
 
-            aValSetColorTable.SetItemColor( nPos + 1, aEntry.GetColor() );
-            aValSetColorTable.SetItemText( nPos + 1, aEntry.GetName() );
+            aValSetColorTable.SetItemColor( nPos + 1, pEntry->GetColor() );
+            aValSetColorTable.SetItemText( nPos + 1, pEntry->GetName() );
             aEdtName.SetText( aName );
 
             aCtlPreviewOld.Invalidate();
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 0059e87..8114d16 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -402,19 +402,28 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
         // Wenn nicht vorhanden, wird Eintrag aufgenommen
         if( bDifferent )
         {
-            const XLineEndEntry* pEntry = maLineEndList->GetLineEnd( nPos );
+            const XLineEndEntry* pOldEntry = maLineEndList->GetLineEnd( nPos );
 
-            aEdtName.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 maLineEndList->Replace(pEntry, nPos);
 
-            const XLineEndEntry aEntry(pEntry->GetLineEnd(), aName);
+                aEdtName.SetText( aName );
 
-            aLbLineEnds.Modify( aEntry, nPos, maLineEndList->GetUiBitmap( nPos ) );
-            aLbLineEnds.SelectEntryPos( nPos );
+                aLbLineEnds.Modify( *pEntry, nPos, maLineEndList->GetUiBitmap( nPos ) );
+                aLbLineEnds.SelectEntryPos( nPos );
 
-            // Flag fuer modifiziert setzen
-            *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