[Libreoffice-commits] .: 2 commits - svx/inc svx/source
Joseph Powers
jpowers at kemper.freedesktop.org
Sun May 8 06:39:19 PDT 2011
svx/inc/svx/gallery.hxx | 5 ++---
svx/source/gallery2/galexpl.cxx | 18 +++++++++++-------
2 files changed, 13 insertions(+), 10 deletions(-)
New commits:
commit 3df9b6f5427a66cc0aecd199d96ee3d98e5b1935
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri May 6 22:41:45 2011 -0430
Check if ObjectList has any item with empty instead of size.
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index c214457..096fc3c 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -187,7 +187,7 @@ sal_Bool GalleryExplorer::FillObjListTitle( const sal_uInt32 nThemeId, std::vect
pGal->ReleaseTheme( pTheme, aListener );
}
}
- return( rList.size() > 0 );
+ return !rList.empty();
}
// ------------------------------------------------------------------------
commit f941250d4578607451e00f7f36a9ca8fe57baa3e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Fri May 6 22:39:38 2011 -0430
Remove List in GalleryExplorer::FillObjList functions.
diff --git a/svx/inc/svx/gallery.hxx b/svx/inc/svx/gallery.hxx
index 181780b..cfdea8a 100644
--- a/svx/inc/svx/gallery.hxx
+++ b/svx/inc/svx/gallery.hxx
@@ -200,7 +200,6 @@
// - GalleryExplorer -
// -------------------
-class List;
class Gallery;
class VCDrawModel;
class FmFormModel;
@@ -231,8 +230,8 @@ public:
static bool FillThemeList( std::vector<String>& rThemeList );
// FillObjList is filling rObjList with Strings of the internal Gallery Object URL
- static sal_Bool FillObjList( const String& rThemeName, List& rObjList );
- static sal_Bool FillObjList( sal_uIntPtr nThemeId, List& rObjList );
+ static sal_Bool FillObjList( const String& rThemeName, std::vector<String> &rObjList );
+ static sal_Bool FillObjList( const sal_uInt32 nThemeId, std::vector<String> &rObjList );
// FillObjTitleList is filling the rList with the title for each gallery object
static sal_Bool FillObjListTitle( const sal_uInt32 nThemeId, std::vector< rtl::OUString >& rList );
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index 22f52b1..c214457 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -129,7 +129,7 @@ bool GalleryExplorer::FillThemeList( std::vector<String>& rThemeList )
// ------------------------------------------------------------------------
-sal_Bool GalleryExplorer::FillObjList( const String& rThemeName, List& rObjList )
+sal_Bool GalleryExplorer::FillObjList( const String& rThemeName, std::vector<String> &rObjList )
{
Gallery* pGal = ImplGetGallery();
@@ -140,22 +140,26 @@ sal_Bool GalleryExplorer::FillObjList( const String& rThemeName, List& rObjList
if( pTheme )
{
- for( sal_uIntPtr i = 0, nCount = pTheme->GetObjectCount(); i < nCount; i++ )
- rObjList.Insert( new String( pTheme->GetObjectURL( i ).GetMainURL( INetURLObject::NO_DECODE ) ), LIST_APPEND );
+ for( sal_uInt32 i = 0, nCount = pTheme->GetObjectCount(); i < nCount; i++ )
+ rObjList.push_back( pTheme->GetObjectURL( i ).GetMainURL( INetURLObject::NO_DECODE ) );
pGal->ReleaseTheme( pTheme, aListener );
}
}
- return( rObjList.Count() > 0 );
+ return !rObjList.empty();
}
// ------------------------------------------------------------------------
-sal_Bool GalleryExplorer::FillObjList( sal_uIntPtr nThemeId, List& rObjList )
+sal_Bool GalleryExplorer::FillObjList( const sal_uInt32 nThemeId, std::vector<String> &rObjList )
{
Gallery* pGal = ImplGetGallery();
- return( pGal ? FillObjList( pGal->GetThemeName( nThemeId ), rObjList ) : sal_False );
+
+ if (!pGal)
+ return false;
+
+ return FillObjList( pGal->GetThemeName( nThemeId ), rObjList );
}
// ------------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list