[Libreoffice-commits] .: sfx2/inc sfx2/source svx/inc svx/source

Joseph Powers jpowers at kemper.freedesktop.org
Sat Jan 1 11:00:01 PST 2011


 sfx2/inc/sfx2/dinfdlg.hxx      |    9 ++++-----
 sfx2/inc/sfx2/frame.hxx        |    5 +++--
 sfx2/source/dialog/dinfdlg.cxx |   24 +++---------------------
 sfx2/source/view/frame.cxx     |   12 ++++++------
 svx/inc/imapdlg.hxx            |    3 ++-
 svx/inc/svx/svxdlg.hxx         |   12 +++++++-----
 svx/source/dialog/hyprlink.cxx |   14 +++++++-------
 svx/source/dialog/imapdlg.cxx  |   21 ++++++++++-----------
 svx/source/dialog/imapwnd.cxx  |   21 +++++++++------------
 9 files changed, 51 insertions(+), 70 deletions(-)

New commits:
commit bbf42a4b013d2fa6c1814e681d07b75cc537df1b
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sat Jan 1 10:53:48 2011 -0800

    Remove DECLARE_LIST( TargetList, String* )

diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 1ec5f08..cc7687a 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -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
@@ -254,7 +254,6 @@ public:
 
 // class SfxInternetPage -------------------------------------------------
 
-class TargetList;
 namespace sfx2
 {
     class FileDialogHelper;
@@ -386,13 +385,13 @@ class CustomPropertiesDurationField : public Edit
     com::sun::star::util::Duration  m_aDuration;
 protected:
     virtual void    RequestHelp(const HelpEvent& rEvt);
-public:    
+public:
     CustomPropertiesDurationField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine );
     ~CustomPropertiesDurationField();
 
     void SetDuration( const com::sun::star::util::Duration& rDuration );
     const com::sun::star::util::Duration& GetDuration() const { return m_aDuration; }
-};    
+};
 
 class CustomPropertiesEditButton : public PushButton
 {
@@ -403,7 +402,7 @@ public:
     ~CustomPropertiesEditButton();
 
     DECL_LINK(ClickHdl, PushButton*);
-};    
+};
 
 class CustomPropertiesRemoveButton : public ImageButton
 {
diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx
index ab07c98..3ff0ab5 100644
--- a/sfx2/inc/sfx2/frame.hxx
+++ b/sfx2/inc/sfx2/frame.hxx
@@ -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
@@ -70,6 +70,7 @@ namespace com
 #include <tools/list.hxx>
 #include <svl/poolitem.hxx>
 #include <comphelper/namedvaluecollection.hxx>
+#include <vector>
 
 class SvBorder;
 class SfxWorkWindow;
@@ -94,7 +95,7 @@ class SystemWindow;
 typedef SfxFrame* SfxFramePtr;
 class SfxFrameArr_Impl;
 
-DECLARE_LIST( TargetList, String* )
+typedef ::std::vector< String* > TargetList;
 
 #define SFXFRAME_HASTITLE     0x0001
 
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 1f238b3..9e404e8 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -403,7 +403,6 @@ void SfxDocumentInfoItem::UpdateDocumentInfo(
         i_xDocProps->setAutoloadURL(::rtl::OUString());
     }
     i_xDocProps->setDefaultTarget(getDefaultTarget());
-//    i_xDocProps->setTemplateName(getTemplateName());
     i_xDocProps->setAuthor(getAuthor());
     i_xDocProps->setCreationDate(getCreationDate());
     i_xDocProps->setModifiedBy(getModifiedBy());
@@ -978,20 +977,6 @@ BOOL SfxDocumentPage::FillItemSet( SfxItemSet& rSet )
             SfxDocumentInfoItem* pInfoItem = (SfxDocumentInfoItem*)pItem;
             BOOL bUseData = ( STATE_CHECK == aUseUserDataCB.GetState() );
             pInfoItem->SetUseUserData( bUseData );
-/*
-            if ( !bUseData )
-            {
-                // "Benutzerdaten verwenden" ausgeschaltet ->
-                // den Benutzer aus den Stamps l"oschen
-                String aEmptyUser;
-                aInfo.SetCreated(
-                    SfxStamp( aEmptyUser, aInfo.GetCreated().GetTime() ) );
-                aInfo.SetChanged(
-                    SfxStamp( aEmptyUser, aInfo.GetChanged().GetTime() ) );
-                aInfo.SetPrinted(
-                    SfxStamp( aEmptyUser, aInfo.GetPrinted().GetTime() ) );
-            }
-*/
             rSet.Put( SfxDocumentInfoItem( *pInfoItem ) );
             bRet = TRUE;
         }
@@ -1127,12 +1112,10 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
     aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(),
         pInfoItem->getCreationDate(), aLocaleWrapper ) );
     util::DateTime aTime( pInfoItem->getModificationDate() );
-//	if ( aTime.IsValid() )
     if ( aTime.Month > 0 )
         aChangeValFt.SetText( ConvertDateTime_Impl(
             pInfoItem->getModifiedBy(), aTime, aLocaleWrapper ) );
     aTime = pInfoItem->getPrintDate();
-//	if ( aTime.IsValid())
     if ( aTime.Month > 0 )
         aPrintValFt.SetText( ConvertDateTime_Impl( pInfoItem->getPrintedBy(),
             aTime, aLocaleWrapper ) );
@@ -1197,10 +1180,10 @@ SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet )
         {
             pFrame->GetTargetList( aList );
 
-            String*			pObj;
-            for( USHORT nPos = ( USHORT ) aList.Count() ; nPos ; )
+            String* pObj;
+            for( size_t nPos = aList.size() ; nPos ; )
             {
-                pObj = aList.GetObject( --nPos );
+                pObj = aList[ --nPos ];
                 aCBFrame.InsertEntry( *pObj );
                 delete pObj;
             }
@@ -2335,7 +2318,6 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId&
 
     Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl );
     m_aVertScroll.SetScrollHdl( aScrollLink );
-//    m_aVertScroll.SetEndScrollHdl( aScrollLink );
 }
 
 CustomPropertiesControl::~CustomPropertiesControl()
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 52587cb..41452da 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.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
@@ -493,11 +493,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const
     if ( !GetParentFrame() )
     {
         // Einen Leerstring f"ur 'Kein Target'
-        rList.Insert( new String() );
-        rList.Insert( new String( DEFINE_CONST_UNICODE( "_top" ) ) );
-        rList.Insert( new String( DEFINE_CONST_UNICODE( "_parent" ) ) );
-        rList.Insert( new String( DEFINE_CONST_UNICODE( "_blank" ) ) );
-        rList.Insert( new String( DEFINE_CONST_UNICODE( "_self" ) ) );
+        rList.push_back( new String() );
+        rList.push_back( new String( DEFINE_CONST_UNICODE( "_top" ) ) );
+        rList.push_back( new String( DEFINE_CONST_UNICODE( "_parent" ) ) );
+        rList.push_back( new String( DEFINE_CONST_UNICODE( "_blank" ) ) );
+        rList.push_back( new String( DEFINE_CONST_UNICODE( "_self" ) ) );
     }
 
     SfxViewFrame* pView = GetCurrentViewFrame();
diff --git a/svx/inc/imapdlg.hxx b/svx/inc/imapdlg.hxx
index ccd77d8..05e30ee 100644
--- a/svx/inc/imapdlg.hxx
+++ b/svx/inc/imapdlg.hxx
@@ -45,6 +45,7 @@
 
 #include <vcl/status.hxx>
 #include "svx/svxdllapi.h"
+#include <vector>
 
 
 #ifndef _GOMISC_HXX
@@ -59,7 +60,7 @@ class ImageMap;
 \************************************************************************/
 
 class Graphic;
-class TargetList;
+typedef ::std::vector< String* > TargetList;
 
 class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
 {
diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx
index 0114e78..2024e4e 100644
--- a/svx/inc/svx/svxdlg.hxx
+++ b/svx/inc/svx/svxdlg.hxx
@@ -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
@@ -40,6 +40,7 @@ class SdrView;
 #include <com/sun/star/container/XIndexContainer.hpp> //add for FmShowColsDialog
 #include <com/sun/star/container/XNameReplace.hpp> //add for SvxMacroAssignDlg
 #include "svx/svxdllapi.h"
+#include <vector>
 
 namespace com{namespace sun{namespace star{
 namespace linguistic2{
@@ -56,7 +57,6 @@ typedef USHORT*		(*DialogGetRanges)();
 struct ExchangeData;
 class INetURLObject;
 class GalleryTheme;
-class TargetList;
 class SvxHyperlinkTabPageBase;
 class SearchAttrItemList;
 class FmFormShell;
@@ -64,6 +64,8 @@ class Graphic;
 class SdrObject;
 class SvxSpellWrapper;
 
+typedef ::std::vector< String* > TargetList;
+
 namespace svx{ class SpellDialogChildWindow;}
 
 #define EMPTY_FRAME_REF com::sun::star::uno::Reference < com::sun::star::frame::XFrame >()
@@ -355,7 +357,7 @@ public:
                                             SvxDistributeVertical eVer = SvxDistributeVerticalNone)= 0;
 
     virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent ) = 0;
-    
+
     virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent,  //add for SvxZoomDialog
                                             const SfxItemSet& rCoreSet )=0;
 
@@ -487,7 +489,7 @@ public:
     virtual VclAbstractDialog* CreateScriptErrorDialog(
             Window* pParent, com::sun::star::uno::Any aException) = 0;
 
-    virtual VclAbstractDialog*  CreateSvxMacroAssignDlg( 
+    virtual VclAbstractDialog*  CreateSvxMacroAssignDlg(
                 Window* _pParent,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxDocumentFrame,
                 const bool _bUnoDialogMode,
@@ -500,7 +502,7 @@ public:
     virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )=0;
 
     virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0;
-    
+
     virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) = 0;
 };
 
diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx
index 8fc0b57..76dd98c 100644
--- a/svx/source/dialog/hyprlink.cxx
+++ b/svx/source/dialog/hyprlink.cxx
@@ -460,9 +460,9 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute)
         TargetList aList;
         pVwFrm->GetTopFrame().GetTargetList(aList);
 
-        USHORT nCount = (USHORT)aList.Count();
-        if( nCount )
+        if ( !aList.empty() )
         {
+            size_t nCount = aList.size();
             BOOL bChecked = FALSE;
 
             if (pTargetMenu != NULL)
@@ -471,10 +471,10 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute)
             pTargetMenu = new PopupMenu;
             pTargetMenu->SetMenuFlags( pTargetMenu->GetMenuFlags() |
                                        MENU_FLAG_NOAUTOMNEMONICS );
-            USHORT i;
-            for ( i = 0; i < nCount; i++ )
+
+            for ( size_t i = 0; i < nCount; i++ )
             {
-                String sEntry(*aList.GetObject(i));
+                String sEntry( *aList[ i ] );
                 pTargetMenu->InsertItem(i + 1, sEntry, MIB_RADIOCHECK|MIB_AUTOCHECK);
 
                 if (sEntry == rSelEntry)
@@ -483,8 +483,8 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute)
                     bChecked = TRUE;
                 }
             }
-            for ( i = nCount; i; i-- )
-                delete aList.GetObject( i - 1 );
+            for ( size_t i = nCount; i; )
+                delete aList[ --i ];
 
             if (!bChecked)
                 pTargetMenu->CheckItem(1);
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index ead58ff..25d12c7 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -403,8 +403,8 @@ void SvxIMapDlg::SetTargetList( const TargetList& rTargetList )
 
     maCbbTarget.Clear();
 
-    for( String* pStr = aNewList.First(); pStr; pStr = aNewList.Next() )
-        maCbbTarget.InsertEntry( *pStr );
+    for ( size_t i = 0, n = aNewList.size(); i < n; ++i )
+        maCbbTarget.InsertEntry( *aNewList[ i ] );
 }
 
 
@@ -441,9 +441,9 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap,
     // UpdateTargetList loeschen, da diese Methode
     // vor dem Zuschlagen des Update-Timers noch
     // mehrmals gerufen werden kann( #46540 )
-    for( String* pStr = pOwnData->aUpdateTargetList.First(); pStr; pStr = pOwnData->aUpdateTargetList.Next() )
-        delete pStr;
-    pOwnData->aUpdateTargetList.Clear();
+    for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i )
+        delete pOwnData->aUpdateTargetList[ i ];
+    pOwnData->aUpdateTargetList.clear();
 
     // TargetListe muss kopiert werden, da sie im
     // Besitz des Aufrufers ist und von ihm nach diesem
@@ -453,8 +453,8 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap,
     {
         TargetList aTargetList( *pTargetList );
 
-        for( String* pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() )
-            pOwnData->aUpdateTargetList.Insert( new String( *pStr ) );
+        for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
+            pOwnData->aUpdateTargetList.push_back( new String( *aTargetList[ i ] ) );
     }
 
     pOwnData->aTimer.Start();
@@ -948,10 +948,9 @@ IMPL_LINK( SvxIMapDlg, UpdateHdl, Timer*, EMPTYARG )
     }
 
     // die in der Update-Methode kopierte Liste wieder loeschen
-    for( String* pStr = pOwnData->aUpdateTargetList.First(); pStr; pStr = pOwnData->aUpdateTargetList.Next() )
-        delete pStr;
-
-    pOwnData->aUpdateTargetList.Clear();
+    for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i )
+        delete pOwnData->aUpdateTargetList[ i ];
+    pOwnData->aUpdateTargetList.clear();
 
     GetBindings().Invalidate( SID_IMAP_EXEC );
 
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 5e417a6..37e0867 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.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
@@ -96,8 +96,8 @@ IMapWindow::IMapWindow( Window* pParent, const ResId& rResId, const Reference< X
 IMapWindow::~IMapWindow()
 {
     // Liste loeschen
-    for( String* pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() )
-        delete pStr;
+    for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
+        delete aTargetList[ i ];
 
     SfxItemPool::Free(pIMapPool);
     delete[] pItemInfo;
@@ -219,17 +219,14 @@ const ImageMap& IMapWindow::GetImageMap()
 
 void IMapWindow::SetTargetList( TargetList& rTargetList )
 {
-    String* pStr;
-
     // alte Liste loeschen
-    for( pStr = aTargetList.First(); pStr; pStr = aTargetList.Next() )
-        delete pStr;
-
-    aTargetList.Clear();
+    for( size_t i = 0, n = aTargetList.size(); i < n; ++i )
+        delete aTargetList[ i ];
+    aTargetList.clear();
 
     // mit uebergebener Liste fuellen
-    for( pStr = rTargetList.First(); pStr; pStr = rTargetList.Next() )
-        aTargetList.Insert( new String( *pStr ) );
+    for( size_t i = 0, n = rTargetList.size(); i < n; ++i )
+        aTargetList.push_back( new String( *rTargetList[ i ] ) );
 
     pModel->SetChanged( sal_False );
 }
@@ -823,7 +820,7 @@ void IMapWindow::DoMacroAssign()
         aNamesItem.AddEvent( String::CreateFromAscii( "MouseOver" ), String(), SFX_EVENT_MOUSEOVER_OBJECT );
         aNamesItem.AddEvent( String::CreateFromAscii( "MouseOut" ), String(), SFX_EVENT_MOUSEOUT_OBJECT );
         aSet.Put( aNamesItem );
-        
+
         SvxMacroItem    aMacroItem(SID_ATTR_MACROITEM);
         IMapObject*		pIMapObj = GetIMapObj( pSdrObj );
         aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );


More information about the Libreoffice-commits mailing list