summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/app/AppControllerDnD.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/app/AppControllerDnD.cxx')
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx33
1 files changed, 15 insertions, 18 deletions
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index dcad078bd59e..73af7c3514cf 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -52,7 +52,7 @@
#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
#include <svtools/querydelete.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <defaultobjectnamecheck.hxx>
#include <osl/mutex.hxx>
@@ -74,7 +74,6 @@ using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::util;
void OApplicationController::deleteTables(const std::vector< OUString>& _rList)
{
@@ -93,7 +92,7 @@ void OApplicationController::deleteTables(const std::vector< OUString>& _rList)
std::vector< OUString>::const_iterator aEnd = _rList.end();
for (std::vector< OUString>::const_iterator aIter = _rList.begin(); aIter != aEnd; ++aIter)
{
- OUString sTableName = *aIter;
+ const OUString& sTableName = *aIter;
sal_Int32 nResult = RET_YES;
if ( bConfirm )
@@ -314,7 +313,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
@@ -363,7 +363,7 @@ const SharedConnection& OApplicationController::ensureConnection( ::dbtools::SQL
{
if ( _pErrorInfo )
{
- *_pErrorInfo = aError;
+ *_pErrorInfo = std::move(aError);
}
else
{
@@ -586,7 +586,7 @@ rtl::Reference<TransferableHelper> OApplicationController::copyObject()
{
rtl::Reference<ODataClipboard> xExchange(new ODataClipboard);
if (copySQLObject(*xExchange))
- return rtl::Reference<TransferableHelper>(xExchange.get());
+ return xExchange;
break;
}
case E_FORM:
@@ -594,7 +594,7 @@ rtl::Reference<TransferableHelper> OApplicationController::copyObject()
{
rtl::Reference<svx::OComponentTransferable> xExchange(new svx::OComponentTransferable);
if (copyDocObject(*xExchange))
- return rtl::Reference<TransferableHelper>(xExchange.get());
+ return xExchange;
break;
}
break;
@@ -744,11 +744,11 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
::comphelper::copyProperties(xQuery,xNewQuery);
else
{
- xNewQuery->setPropertyValue(PROPERTY_COMMAND,makeAny(sCommand));
- xNewQuery->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,makeAny(bEscapeProcessing));
+ xNewQuery->setPropertyValue(PROPERTY_COMMAND,Any(sCommand));
+ xNewQuery->setPropertyValue(PROPERTY_ESCAPE_PROCESSING,Any(bEscapeProcessing));
}
// insert
- xDestQueries->insertByName( sTargetName, makeAny(xNewQuery) );
+ xDestQueries->insertByName( sTargetName, Any(xNewQuery) );
xNewQuery.set(xDestQueries->getByName( sTargetName),UNO_QUERY);
if ( xQuery.is() && xNewQuery.is() )
{
@@ -764,12 +764,9 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
{
Reference<XPropertySet> xDstProp(xFac->createDataDescriptor());
- Sequence< OUString> aSeq = xSrcNameAccess->getElementNames();
- const OUString* pIter = aSeq.getConstArray();
- const OUString* pEnd = pIter + aSeq.getLength();
- for( ; pIter != pEnd ; ++pIter)
+ for (auto& name : xSrcNameAccess->getElementNames())
{
- Reference<XPropertySet> xSrcProp(xSrcNameAccess->getByName(*pIter),UNO_QUERY);
+ Reference<XPropertySet> xSrcProp(xSrcNameAccess->getByName(name),UNO_QUERY);
::comphelper::copyProperties(xSrcProp,xDstProp);
xAppend->appendByDescriptor(xDstProp);
}
@@ -786,7 +783,7 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
{
Reference<XContent> xContent;
_rPasteData[DataAccessDescriptorProperty::Component] >>= xContent;
- return insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
+ return insertHierarchyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
}
}
catch(const SQLException&) { showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); }
@@ -852,10 +849,10 @@ IMPL_LINK_NOARG( OApplicationController, OnAsyncDrop, void*, void )
std::vector< OUString> aList;
sal_Int32 nIndex = 0;
OUString sName = xContent->getIdentifier()->getContentIdentifier();
- OUString sErase = sName.getToken(0,'/',nIndex); // we don't want to have the "private:forms" part
+ std::u16string_view sErase = o3tl::getToken(sName,0,'/',nIndex); // we don't want to have the "private:forms" part
if ( nIndex != -1 )
{
- aList.push_back(sName.copy(sErase.getLength() + 1));
+ aList.push_back(sName.copy(sErase.size() + 1));
deleteObjects( m_aAsyncDrop.nType, aList, false );
}
}