[Libreoffice-commits] .: 3 commits - sd/source

Joseph Powers jpowers at kemper.freedesktop.org
Sun May 22 22:53:09 PDT 2011


 sd/source/core/drawdoc4.cxx    |   34 +++++++++++++---------------------
 sd/source/core/typemap.cxx     |    3 +--
 sd/source/ui/view/viewshel.cxx |   30 ++++++++++--------------------
 3 files changed, 24 insertions(+), 43 deletions(-)

New commits:
commit 0b5ac43eb1e5ce5128b8442366bd509a90b0f087
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sun May 22 21:57:20 2011 -0700

    Remove List from ImpGetUndoStrings & ImpGetRedoStrings

diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 2570700..d819b11 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -325,7 +325,7 @@ void ViewShell::Activate(sal_Bool bIsMDIActivate)
     // Laut MI darf keiner GrabFocus rufen, der nicht genau weiss von
     // welchem Window der Focus gegrabt wird. Da Activate() vom SFX teilweise
     // asynchron verschickt wird, kann es sein, dass ein falsches Window
-    // den Focus hat 
+    // den Focus hat
 
     if (mpHorizontalRuler.get() != NULL)
         mpHorizontalRuler->SetActive(sal_True);
@@ -653,7 +653,7 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
                {
                 bConsumed = GetView()->getSmartTags().Command(rCEvt);
             }
-            
+
             if( !bConsumed && HasCurrentFunction())
             {
                 GetCurrentFunction()->Command(rCEvt);
@@ -806,14 +806,14 @@ void ViewShell::Resize (void)
 
     if (mpParentWindow == NULL)
         return;
-    
+
     // Make sure that the new size is not degenerate.
     const Size aSize (mpParentWindow->GetSizePixel());
     if (aSize.Width()==0 || aSize.Height()==0)
         return;
 
     // Remember the new position and size.
-    maViewPos = Point(0,0); 
+    maViewPos = Point(0,0);
     maViewSize = aSize;
 
     // Rearrange the UI elements to take care of the new position and size.
@@ -825,7 +825,7 @@ void ViewShell::Resize (void)
     if (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
         && IsMainViewShell())
     {
-        
+
     }
 
     ::sd::View* pView = GetView();
@@ -1074,22 +1074,17 @@ void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
         if(nCount)
         {
             // prepare list
-            List aStringList;
+            ::std::vector< String > aStringList;
             sal_uInt16 a;
 
             for( a = 0; a < nCount; a++)
             {
                 // generate one String in list per undo step
-                String* pInsertString = new String(pUndoManager->GetUndoActionComment(a));
-                aStringList.Insert(pInsertString, LIST_APPEND);
+                aStringList.push_back( String(pUndoManager->GetUndoActionComment(a)) );
             }
 
             // set item
             rSet.Put(SfxStringListItem(SID_GETUNDOSTRINGS, &aStringList));
-
-            // delete Strings again
-            for(a = 0; a < nCount; a++)
-                delete (String*)aStringList.GetObject(a);
         }
         else
         {
@@ -1109,22 +1104,17 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
         if(nCount)
         {
             // prepare list
-            List aStringList;
+            ::std::vector< String > aStringList;
             sal_uInt16 a;
 
             for( a = 0; a < nCount; a++)
             {
                 // generate one String in list per undo step
-                String* pInsertString = new String(pUndoManager->GetRedoActionComment(a));
-                aStringList.Insert(pInsertString, LIST_APPEND);
+                aStringList.push_back( String(pUndoManager->GetRedoActionComment(a)) );
             }
 
             // set item
             rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList));
-
-            // delete Strings again
-            for(a = 0; a < nCount; a++)
-                delete (String*)aStringList.GetObject(a);
         }
         else
         {
commit 2efb979f8b3717e716af5853270977c440179ae5
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sun May 22 21:49:25 2011 -0700

    Remove "#define OfaStringListItem" because OfaStringListItem isn't used.

diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx
index 6498aea..dc8249b 100644
--- a/sd/source/core/typemap.cxx
+++ b/sd/source/core/typemap.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -122,7 +122,6 @@
 #define SvxCellVerJustifyEnumItem	SfxUInt16Item
 #define SvxCellOrientationEnumItem	SfxUInt16Item
 #define SvxLanguage 				SfxUInt16Item
-#define OfaStringListItem           SfxStringListItem
 #define avmedia_MediaItem           ::avmedia::MediaItem
 #include <sfx2/tplpitem.hxx>
 #include <svl/ptitem.hxx>
commit 71cbab703725ffc8dbe86c405d6a48fc3ec44c34
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun May 8 15:39:52 2011 -0430

    Remove deprecated List in SdDrawDocument::RenameLayoutTemplate.
    
    Exchange for std::vector<StyleReplaceData>.

diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 9715630..48b138a 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1166,7 +1166,7 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
     aOldName.Erase(nPos + sizeof(SD_LT_SEPARATOR) - 1 );
     sal_uInt16 nLen = aOldName.Len();
 
-    List aReplList;
+    std::vector<StyleReplaceData> aReplList;
     SfxStyleSheetIterator aIter(mxStyleSheetPool.get(), SD_STYLE_FAMILY_MASTERPAGE);
     SfxStyleSheetBase* pSheet = aIter.First();
 
@@ -1180,12 +1180,12 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
             aSheetName.Erase(0, nLen - sizeof(SD_LT_SEPARATOR) + 1 );
             aSheetName.Insert(rNewName, 0);
 
-            StyleReplaceData* pReplData = new StyleReplaceData;
-            pReplData->nFamily	  = pSheet->GetFamily();
-            pReplData->nNewFamily = pSheet->GetFamily();
-            pReplData->aName	  = pSheet->GetName();
-            pReplData->aNewName   = aSheetName;
-            aReplList.Insert(pReplData, LIST_APPEND);
+            StyleReplaceData aReplData;
+            aReplData.nFamily	  = pSheet->GetFamily();
+            aReplData.nNewFamily = pSheet->GetFamily();
+            aReplData.aName	  = pSheet->GetName();
+            aReplData.aNewName   = aSheetName;
+            aReplList.push_back(aReplData);
 
             pSheet->SetName(aSheetName);
         }
@@ -1227,13 +1227,9 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
 
                             if (pOPO)
                             {
-                                StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First();
-
-                                while( pReplData )
-                                {
-                                    pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily );
-                                    pReplData = (StyleReplaceData*) aReplList.Next();
-                                }
+                                std::vector<StyleReplaceData>::iterator it;
+                                for (it = aReplList.begin(); it != aReplList.end(); ++it)
+                                    pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
                             }
                         }
                         break;
@@ -1275,13 +1271,9 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
 
                             if (pOPO)
                             {
-                                StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First();
-
-                                while( pReplData )
-                                {
-                                    pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily );
-                                    pReplData = (StyleReplaceData*) aReplList.Next();
-                                }
+                                std::vector<StyleReplaceData>::iterator it;
+                                for (it = aReplList.begin(); it != aReplList.end(); ++it)
+                                    pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
                             }
                         }
                         break;


More information about the Libreoffice-commits mailing list