[Libreoffice-commits] core.git: 2 commits - cui/source external/libexttextcat filter/source include/tools sfx2/source svl/source svx/source

Stephan Bergmann sbergman at redhat.com
Fri Nov 8 16:05:53 CET 2013


 cui/source/dialogs/cuigaldlg.cxx                     |    4 +--
 external/libexttextcat/ExternalProject_exttextcat.mk |    2 -
 filter/source/xsltdialog/xmlfilterjar.cxx            |    2 -
 filter/source/xsltdialog/xmlfiltertabpagexslt.cxx    |    2 -
 include/tools/urlobj.hxx                             |    7 +++--
 sfx2/source/appl/appopen.cxx                         |    2 -
 sfx2/source/appl/newhelp.cxx                         |    4 +--
 sfx2/source/doc/docfile.cxx                          |    3 --
 svl/source/fsstor/fsstorage.cxx                      |   24 +++++++++----------
 svx/source/gallery2/galtheme.cxx                     |    2 -
 svx/source/gengal/gengal.cxx                         |   23 ++++++++----------
 11 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit 797681b4f569212a0f306151167534e23a2e37af
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 8 16:05:07 2013 +0100

    Pass all relevant CFLAGS on to external/libexttextcat
    
    Change-Id: I05f25748dd29c80812328265ddb9f071ac4ae91a

diff --git a/external/libexttextcat/ExternalProject_exttextcat.mk b/external/libexttextcat/ExternalProject_exttextcat.mk
index 68035ca..330d0f0 100644
--- a/external/libexttextcat/ExternalProject_exttextcat.mk
+++ b/external/libexttextcat/ExternalProject_exttextcat.mk
@@ -17,7 +17,7 @@ $(call gb_ExternalProject_get_state_target,exttextcat,build):
 	$(call gb_ExternalProject_run,build,\
 		./configure --disable-shared --with-pic \
 			$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
-		CFLAGS="$(if $(debug),-g) $(if $(filter TRUE,$(HAVE_GCC_VISIBILITY_FEATURE)),-fvisibility=hidden) \
+		CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUG_CFLAGS) $(gb_COMPILEROPTFLAGS) \
 		$(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \
 		&& $(MAKE) \
 	)
commit 669128178f4697f4fba746f1ece1c18b0056022a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 8 14:13:54 2013 +0100

    Make INetURLObject-from-OUString ctor explicit
    
    ...and clean up call sites.
    
    Change-Id: I7219a33652835e82fdc44e9e801a7e62868e4f38

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 2c8d085..86e4058 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -316,7 +316,7 @@ void TakeThread::execute()
         {
             SolarMutexGuard aGuard;
 
-            mpProgress->SetFile( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
+            mpProgress->SetFile( aURL );
             pStatusProgress->Update( i, nEntries - 1 );
             mpProgress->Sync();
             pThm->InsertURL( aURL );
@@ -1008,7 +1008,7 @@ void TPGalleryThemeProperties::SearchFiles()
     aLbxFound.Clear();
 
     pProgress->SetFileType( aCbbFileType.GetText() );
-    pProgress->SetDirectory( OUString() );
+    pProgress->SetDirectory( INetURLObject() );
     pProgress->Update();
 
     pProgress->StartExecuteModal( LINK( this, TPGalleryThemeProperties, EndSearchProgressHdl ) );
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index 0e0dd4c..edb18f7 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -127,7 +127,7 @@ void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference
 
         if( !aFileURL.matchIgnoreAsciiCase( OUString("file://") ) )
         {
-            aFileURL = URIHelper::SmartRel2Abs( sProgPath, aFileURL, Link(), false );
+            aFileURL = URIHelper::SmartRel2Abs( INetURLObject(sProgPath), aFileURL, Link(), false );
         }
 
         INetURLObject aURL( aFileURL );
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
index 317dba8..edb9ffe 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
@@ -113,7 +113,7 @@ void XMLFilterTabPageXSLT::SetURL( SvtURLBox* rURLBox, const OUString& rURL )
     else if( !rURL.isEmpty() )
     {
         OUString aURL( rURL );
-        aURL = URIHelper::SmartRel2Abs( sInstPath, aURL, Link(), false );
+        aURL = URIHelper::SmartRel2Abs( INetURLObject(sInstPath), aURL, Link(), false );
         osl::FileBase::getSystemPathFromFileURL( aURL, aPath );
 
         rURLBox->SetBaseURL( aURL );
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index ab2ed51..4d9bd10 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -222,9 +222,10 @@ public:
 
     // Strict Parsing:
 
-    inline INetURLObject(OUString const & rTheAbsURIRef,
-                         EncodeMechanism eMechanism = WAS_ENCODED,
-                         rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+    inline explicit INetURLObject(
+        OUString const & rTheAbsURIRef,
+        EncodeMechanism eMechanism = WAS_ENCODED,
+        rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
 
     inline bool SetURL(OUString const & rTheAbsURIRef,
                        EncodeMechanism eMechanism = WAS_ENCODED,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index a758478..1112573 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -933,7 +933,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
                         sal_Bool bLoadInternal = sal_False;
 
                         // security reservation: => we have to check the referer before executing
-                        if (SFX_APP()->IsSecureURL(OUString(), &aReferer))
+                        if (SFX_APP()->IsSecureURL(INetURLObject(), &aReferer))
                         {
                             try
                             {
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 06383d8..289446b 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1278,7 +1278,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
                     RemoveEntry( nPos );
                     OUString aImageURL = IMAGE_URL;
                     aImageURL += INetURLObject( *pURL ).GetHost();
-                    nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( aImageURL, false ) );
+                    nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
                     SetEntryData( nPos, (void*)(sal_uIntPtr)( new OUString( *pURL ) ) );
                     SelectEntryPos( nPos );
                     delete pURL;
@@ -1451,7 +1451,7 @@ void BookmarksTabPage_Impl::AddBookmarks( const OUString& rTitle, const OUString
 {
     OUString aImageURL = IMAGE_URL;
     aImageURL += INetURLObject( rURL ).GetHost();
-    sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( aImageURL, false ) );
+    sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
     aBookmarksBox.SetEntryData( nPos, (void*)(sal_uIntPtr)( new OUString( rURL ) ) );
 }
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 95ff9dd..a8125d2 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2994,8 +2994,7 @@ const INetURLObject& SfxMedium::GetURLObject() const
     if (!pImp->m_pURLObj)
     {
         pImp->m_pURLObj = new INetURLObject( pImp->m_aLogicName );
-        if (pImp->m_pURLObj->HasMark())
-            *pImp->m_pURLObj = INetURLObject( pImp->m_aLogicName ).GetURLNoMark();
+        pImp->m_pURLObj->SetMark("");
     }
 
     return *pImp->m_pURLObj;
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index a1a7d40..f59ca36 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -1379,15 +1379,15 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
     if ( !aBaseURL.setFinalSlash() )
         throw uno::RuntimeException();
 
-    INetURLObject aFileURL = INetURLObject::GetAbsURL(
+    OUString aFileURL = INetURLObject::GetAbsURL(
                 aBaseURL.GetMainURL( INetURLObject::NO_DECODE ),
                 sStreamPath );
 
-    if ( ::utl::UCBContentHelper::IsFolder( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+    if ( ::utl::UCBContentHelper::IsFolder( aFileURL ) )
         throw io::IOException();
 
     if ( ( nOpenMode & embed::ElementModes::NOCREATE )
-      && !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+      && !::utl::UCBContentHelper::IsDocument( aFileURL ) )
         throw io::IOException(); // TODO:
 
     uno::Reference< ucb::XCommandEnvironment > xDummyEnv; // TODO: provide InteractionHandler if any
@@ -1396,19 +1396,19 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
     {
         if ( nOpenMode & embed::ElementModes::WRITE )
         {
-            if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+            if ( isLocalFile_Impl( aFileURL ) )
             {
                 uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess(
                     ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) );
                 uno::Reference< io::XStream > xStream =
-                    xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) );
+                    xSimpleFileAccess->openFileReadWrite( aFileURL );
 
                 xResult = static_cast< io::XStream* >( new OFSStreamContainer( xStream ) );
             }
             else
             {
                 // TODO: test whether it really works for http and fwp
-                SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ),
+                SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL,
                                                                           STREAM_STD_WRITE );
                 if ( pStream )
                 {
@@ -1435,10 +1435,10 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
         else
         {
             if ( ( nOpenMode & embed::ElementModes::TRUNCATE )
-              || !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+              || !::utl::UCBContentHelper::IsDocument( aFileURL ) )
                 throw io::IOException(); // TODO: access denied
 
-            ::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, comphelper::getProcessComponentContext() );
+            ::ucbhelper::Content aResultContent( aFileURL, xDummyEnv, comphelper::getProcessComponentContext() );
             uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
             xResult = static_cast< io::XStream* >( new OFSInputStreamContainer( xInStream ) );
         }
@@ -1511,19 +1511,19 @@ void SAL_CALL FSStorage::removeStreamElementByHierarchicalName( const OUString&
     if ( !aBaseURL.setFinalSlash() )
         throw uno::RuntimeException();
 
-    INetURLObject aFileURL = INetURLObject::GetAbsURL(
+    OUString aFileURL = INetURLObject::GetAbsURL(
                 aBaseURL.GetMainURL( INetURLObject::NO_DECODE ),
                 sStreamPath );
 
-    if ( !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+    if ( !::utl::UCBContentHelper::IsDocument( aFileURL ) )
     {
-        if ( ::utl::UCBContentHelper::IsFolder( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+        if ( ::utl::UCBContentHelper::IsFolder( aFileURL ) )
             throw lang::IllegalArgumentException();
         else
             throw container::NoSuchElementException(); // TODO:
     }
 
-    if ( !::utl::UCBContentHelper::Kill( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
+    if ( !::utl::UCBContentHelper::Kill( aFileURL ) )
         throw io::IOException(); // TODO: error handling
 }
 
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index bcc4e5a..e52fafc 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 355e006..2305d3b 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 );


More information about the Libreoffice-commits mailing list