summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-11-08 14:13:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-11-08 16:05:24 +0100
commit669128178f4697f4fba746f1ece1c18b0056022a (patch)
treec742a7c7654ae302ad39b616a7bb80149fd68ca8 /svx
parentfa7085bd182e1968237b742c544de3ff0a5b9742 (diff)
Make INetURLObject-from-OUString ctor explicit
...and clean up call sites. Change-Id: I7219a33652835e82fdc44e9e801a7e62868e4f38
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/galtheme.cxx2
-rw-r--r--svx/source/gengal/gengal.cxx23
2 files changed, 12 insertions, 13 deletions
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index bcc4e5a27a5d..e52fafc50d7b 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -915,7 +915,7 @@ sal_Bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInse
if( bRet )
{
- const SgaObjectBmp aObjBmp( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
+ const SgaObjectBmp aObjBmp( aURL );
InsertObject( aObjBmp, nInsertPos );
}
}
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 355e006deddb..2305d3b08f54 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -18,7 +18,7 @@
#include <unistd.h>
#endif
-#include <list>
+#include <vector>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -43,8 +43,6 @@
using namespace ::com::sun::star;
-typedef ::std::list<OUString> FileNameList;
-
class GalApp : public Application
{
bool mbInBuildTree;
@@ -72,7 +70,7 @@ void disposeGallery( Gallery* pGallery )
}
static void createTheme( OUString aThemeName, OUString aGalleryURL,
- OUString aDestDir, FileNameList &rFiles,
+ OUString aDestDir, std::vector<INetURLObject> &rFiles,
bool bRelativeURLs )
{
Gallery* pGallery;
@@ -111,7 +109,7 @@ static void createTheme( OUString aThemeName, OUString aGalleryURL,
OUStringToOString( aDestDir, RTL_TEXTENCODING_UTF8 ).getStr() );
pGalTheme->SetDestDir( aDestDir, bRelativeURLs );
- FileNameList::const_iterator aIter;
+ std::vector<INetURLObject>::const_iterator aIter;
for( aIter = rFiles.begin(); aIter != rFiles.end(); ++aIter )
{
@@ -123,10 +121,10 @@ static void createTheme( OUString aThemeName, OUString aGalleryURL,
if ( ! pGalTheme->InsertURL( *aIter ) )
fprintf( stderr, "Failed to import '%s'\n",
- OUStringToOString( *aIter, RTL_TEXTENCODING_UTF8 ).getStr() );
+ OUStringToOString( aIter->GetMainURL(INetURLObject::NO_DECODE), RTL_TEXTENCODING_UTF8 ).getStr() );
else
fprintf( stderr, "Imported file '%s' (%" SAL_PRI_SIZET "u)\n",
- OUStringToOString( *aIter, RTL_TEXTENCODING_UTF8 ).getStr(),
+ OUStringToOString( aIter->GetMainURL(INetURLObject::NO_DECODE), RTL_TEXTENCODING_UTF8 ).getStr(),
pGalTheme->GetObjectCount() );
}
@@ -162,11 +160,11 @@ static int PrintHelp()
return EXIT_SUCCESS;
}
-static OUString Smartify( const OUString &rPath )
+static INetURLObject Smartify( const OUString &rPath )
{
INetURLObject aURL;
aURL.SetSmartURL( rPath );
- return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ return aURL;
}
void GalApp::Init()
@@ -214,7 +212,7 @@ int GalApp::Main()
{
OUString aPath, aDestDir;
OUString aName( "Default name" );
- FileNameList aFiles;
+ std::vector<INetURLObject> aFiles;
for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
{
@@ -232,7 +230,8 @@ int GalApp::Main()
else if ( aParam == "--name" )
aName = GetCommandLineParam( ++i );
else if ( aParam == "--path" )
- aPath = Smartify( GetCommandLineParam( ++i ) );
+ aPath = Smartify( GetCommandLineParam( ++i ) ).
+ GetMainURL(INetURLObject::NO_DECODE);
else if ( aParam == "--destdir" )
aDestDir = GetCommandLineParam( ++i );
else if ( aParam == "--relative-urls" )
@@ -244,7 +243,7 @@ int GalApp::Main()
aFiles.push_back( Smartify( aParam ) );
}
- if( aFiles.size() < 1 )
+ if( aFiles.empty() )
return PrintHelp();
createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );