dbaccess/source/ui/app/AppController.cxx    |    6 ++++--
 dbaccess/source/ui/app/AppControllerDnD.cxx |    3 ++-
 dbaccess/source/ui/app/AppControllerGen.cxx |    9 ++-------
 3 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 13a40e9c8e1d505565bd77774742cf72bb33b99f
Author:     Julien Nabet <[email protected]>
AuthorDate: Mon Jan 1 19:05:44 2024 +0100
Commit:     Julien Nabet <[email protected]>
CommitDate: Mon Jan 1 20:02:36 2024 +0100

    Remove OApplicationController::getStrippedDatabaseName which only adds a 
layer
    
    Change-Id: Ife0435f52b1abe62337623aa5c6010195802760b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161523
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>

diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index 9d548a138139..fbe2c395633f 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -362,11 +362,12 @@ void SAL_CALL OApplicationController::disposing()
                     if ( pFilter )
                         aFilter = pFilter->GetFilterName();
 
+                    OUString sDatabaseName;
                     // add to svtool history options
                     SvtHistoryOptions::AppendItem( EHistoryType::PickList,
                             aURL.GetURLNoPass( 
INetURLObject::DecodeMechanism::NONE ),
                             aFilter,
-                            getStrippedDatabaseName(),
+                            ::dbaui::getStrippedDatabaseName(m_xDataSource, 
sDatabaseName),
                             std::nullopt, std::nullopt);
 
                     // add to recent document list
@@ -504,7 +505,8 @@ sal_Bool SAL_CALL OApplicationController::suspend(sal_Bool 
bSuspend)
                 )
             )
         {
-            switch (ExecuteQuerySaveDocument(getFrameWeld(), 
getStrippedDatabaseName()))
+            OUString sDatabaseName;
+            switch (ExecuteQuerySaveDocument(getFrameWeld(), 
::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName)))
             {
                 case RET_YES:
                     Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx 
b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 76525cf8f8bd..11ee8a621381 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -314,7 +314,8 @@ const SharedConnection& 
OApplicationController::ensureConnection( ::dbtools::SQL
         SolarMutexGuard aSolarGuard;
 
         OUString sConnectingContext(DBA_RES(STR_COULDNOTCONNECT_DATASOURCE));
-        sConnectingContext = sConnectingContext.replaceFirst("$name$", 
getStrippedDatabaseName());
+        OUString sDatabaseName;
+        sConnectingContext = sConnectingContext.replaceFirst("$name$", 
::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName));
 
         // do the connection *without* holding getMutex() to avoid deadlock
         // when we are not in the main thread and we need username/password
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx 
b/dbaccess/source/ui/app/AppControllerGen.cxx
index 8712f6386879..0f6eda11de7b 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -321,7 +321,8 @@ void SAL_CALL OApplicationController::connect(  )
 
         // no particular error, but nonetheless could not connect -> throw a 
generic exception
         OUString sConnectingContext( DBA_RES( STR_COULDNOTCONNECT_DATASOURCE ) 
);
-        ::dbtools::throwGenericSQLException( sConnectingContext.replaceFirst( 
"$name$", getStrippedDatabaseName() ), *this );
+        OUString sDatabaseName;
+        ::dbtools::throwGenericSQLException( sConnectingContext.replaceFirst( 
"$name$", ::dbaui::getStrippedDatabaseName(m_xDataSource, sDatabaseName) ), 
*this );
     }
 }
 
@@ -550,12 +551,6 @@ OUString OApplicationController::getDatabaseName() const
     return sDatabaseName;
 }
 
-OUString OApplicationController::getStrippedDatabaseName() const
-{
-    OUString sDatabaseName;
-    return ::dbaui::getStrippedDatabaseName( m_xDataSource, sDatabaseName );
-}
-
 void OApplicationController::onDocumentOpened( const OUString& _rName, const 
sal_Int32 _nType,
         const ElementOpenMode _eMode, const Reference< XComponent >& 
_xDocument, const Reference< XComponent >& _rxDefinition )
 {

Reply via email to