diff options
Diffstat (limited to 'sw/source/uibase/dbui/dbmgr.cxx')
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 23f9c89ebd7c..a85cc1dbf563 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -187,14 +187,14 @@ static bool lcl_getCountFromResultSet( sal_Int32& rCount, const SwDSParam* pPara try { bool bFinal = false; - uno::Any aFinal = xPrSet->getPropertyValue("IsRowCountFinal"); + uno::Any aFinal = xPrSet->getPropertyValue(u"IsRowCountFinal"_ustr); aFinal >>= bFinal; if(!bFinal) { pParam->xResultSet->last(); pParam->xResultSet->first(); } - uno::Any aCount = xPrSet->getPropertyValue("RowCount"); + uno::Any aCount = xPrSet->getPropertyValue(u"RowCount"_ustr); if( aCount >>= rCount ) return true; } @@ -335,7 +335,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<sdbc::XDat if(!xSourceProps.is()) return; - uno::Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); + uno::Any aFormats = xSourceProps->getPropertyValue(u"NumberFormatsSupplier"_ustr); if(!aFormats.hasValue()) return; @@ -344,7 +344,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<sdbc::XDat if(xSuppl.is()) { uno::Reference< beans::XPropertySet > xSettings = xSuppl->getNumberFormatSettings(); - uno::Any aNull = xSettings->getPropertyValue("NullDate"); + uno::Any aNull = xSettings->getPropertyValue(u"NullDate"_ustr); aNull >>= rParam.aNullDate; if(rParam.xFormatter.is()) rParam.xFormatter->attachNumberFormatsSupplier(xSuppl); @@ -654,7 +654,7 @@ bool SwDBManager::GetTableNames(weld::ComboBox& rBox, const OUString& rDBName) uno::Reference<container::XNameAccess> xTables = xTSupplier->getTables(); const uno::Sequence<OUString> aTables = xTables->getElementNames(); for (const OUString& rTable : aTables) - rBox.append("0", rTable); + rBox.append(u"0"_ustr, rTable); } uno::Reference<sdb::XQueriesSupplier> xQSupplier(xConnection, uno::UNO_QUERY); if(xQSupplier.is()) @@ -662,7 +662,7 @@ bool SwDBManager::GetTableNames(weld::ComboBox& rBox, const OUString& rDBName) uno::Reference<container::XNameAccess> xQueries = xQSupplier->getQueries(); const uno::Sequence<OUString> aQueries = xQueries->getElementNames(); for (const OUString& rQuery : aQueries) - rBox.append("1", rQuery); + rBox.append(u"1"_ustr, rQuery); } if (!sOldTableName.isEmpty()) rBox.set_active_text(sOldTableName); @@ -854,7 +854,7 @@ static void lcl_PreparePrinterOptions( // printing should be done synchronously otherwise the document // might already become invalid during the process - rOutPrintOptions = { comphelper::makePropertyValue("Wait", true) }; + rOutPrintOptions = { comphelper::makePropertyValue(u"Wait"_ustr, true) }; // copy print options sal_Int32 nIndex = 1; @@ -879,8 +879,8 @@ static void lcl_PrepareSaveFilterDataOptions( const OUString& sPassword) { rOutSaveFilterDataOptions - = { comphelper::makePropertyValue("EncryptFile", true), - comphelper::makePropertyValue("DocumentOpenPassword", sPassword) }; + = { comphelper::makePropertyValue(u"EncryptFile"_ustr, true), + comphelper::makePropertyValue(u"DocumentOpenPassword"_ustr, sPassword) }; // copy other options sal_Int32 nIndex = 2; @@ -1155,7 +1155,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, // if a save_to filter is set then use it - otherwise use the default if( bMT_EMAIL && !rMergeDescriptor.bSendAsAttachment ) { - OUString sExtension = rMergeDescriptor.bSendAsHTML ? OUString("html") : OUString("txt"); + OUString sExtension = rMergeDescriptor.bSendAsHTML ? u"html"_ustr : u"txt"_ustr; pStoreToFilter = pFilterContainer->GetFilter4Extension(sExtension, SfxFilterFlags::EXPORT); } else if( !rMergeDescriptor.sSaveToFilter.isEmpty()) @@ -1452,7 +1452,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, SwDocMergeInfo aMergeInfo; // Name of the mark is actually irrelevant, UNO bookmarks have internals names. aMergeInfo.startPageInTarget = pTargetDoc->getIDocumentMarkAccess()->makeMark( - SwPaM(appendedDocStart), "", IDocumentMarkAccess::MarkType::UNO_BOOKMARK, + SwPaM(appendedDocStart), u""_ustr, IDocumentMarkAccess::MarkType::UNO_BOOKMARK, ::sw::mark::InsertMode::New); aMergeInfo.nDBRow = nStartRow; rMergeDescriptor.pMailMergeConfigItem->AddMergedDocument( aMergeInfo ); @@ -1781,7 +1781,7 @@ sal_uInt32 SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> cons uno::Reference< util::XNumberFormats > xNumberFormats; if(xSourceProps.is()) { - uno::Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); + uno::Any aFormats = xSourceProps->getPropertyValue(u"NumberFormatsSupplier"_ustr); if(aFormats.hasValue()) { uno::Reference<util::XNumberFormatsSupplier> xSuppl; @@ -1795,7 +1795,7 @@ sal_uInt32 SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> cons bool bUseDefault = true; try { - uno::Any aFormatKey = xColumn->getPropertyValue("FormatKey"); + uno::Any aFormatKey = xColumn->getPropertyValue(u"FormatKey"_ustr); if(aFormatKey.hasValue()) { sal_Int32 nFormat = 0; @@ -1805,8 +1805,8 @@ sal_uInt32 SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> cons try { uno::Reference<beans::XPropertySet> xNumProps = xNumberFormats->getByKey( nFormat ); - uno::Any aFormatString = xNumProps->getPropertyValue("FormatString"); - uno::Any aLocaleVal = xNumProps->getPropertyValue("Locale"); + uno::Any aFormatString = xNumProps->getPropertyValue(u"FormatString"_ustr); + uno::Any aLocaleVal = xNumProps->getPropertyValue(u"Locale"_ustr); OUString sFormat; aFormatString >>= sFormat; lang::Locale aLoc; @@ -1870,7 +1870,7 @@ sal_Int32 SwDBManager::GetColumnType( const OUString& rDBName, uno::Any aCol = xCols->getByName(rColNm); uno::Reference<beans::XPropertySet> xCol; aCol >>= xCol; - uno::Any aType = xCol->getPropertyValue("Type"); + uno::Any aType = xCol->getPropertyValue(u"Type"_ustr); aType >>= nRet; } if(bDispose) @@ -1923,22 +1923,22 @@ uno::Reference< sdbcx::XColumnsSupplier> SwDBManager::GetColumnSupplier(uno::Ref sal_Int32 nCommandType = SwDBSelect::TABLE == eTableOrQuery ? sdb::CommandType::TABLE : sdb::CommandType::QUERY; uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - uno::Reference<sdbc::XRowSet> xRowSet(xMgr->createInstance("com.sun.star.sdb.RowSet"), uno::UNO_QUERY); + uno::Reference<sdbc::XRowSet> xRowSet(xMgr->createInstance(u"com.sun.star.sdb.RowSet"_ustr), uno::UNO_QUERY); OUString sDataSource; uno::Reference<sdbc::XDataSource> xSource = SwDBManager::getDataSourceAsParent(xConnection, sDataSource); uno::Reference<beans::XPropertySet> xSourceProperties(xSource, uno::UNO_QUERY); if(xSourceProperties.is()) { - xSourceProperties->getPropertyValue("Name") >>= sDataSource; + xSourceProperties->getPropertyValue(u"Name"_ustr) >>= sDataSource; } uno::Reference<beans::XPropertySet> xRowProperties(xRowSet, uno::UNO_QUERY); - xRowProperties->setPropertyValue("DataSourceName", uno::Any(sDataSource)); - xRowProperties->setPropertyValue("Command", uno::Any(rTableOrQuery)); - xRowProperties->setPropertyValue("CommandType", uno::Any(nCommandType)); - xRowProperties->setPropertyValue("FetchSize", uno::Any(sal_Int32(10))); - xRowProperties->setPropertyValue("ActiveConnection", uno::Any(xConnection)); + xRowProperties->setPropertyValue(u"DataSourceName"_ustr, uno::Any(sDataSource)); + xRowProperties->setPropertyValue(u"Command"_ustr, uno::Any(rTableOrQuery)); + xRowProperties->setPropertyValue(u"CommandType"_ustr, uno::Any(nCommandType)); + xRowProperties->setPropertyValue(u"FetchSize"_ustr, uno::Any(sal_Int32(10))); + xRowProperties->setPropertyValue(u"ActiveConnection"_ustr, uno::Any(xConnection)); xRowSet->execute(); xRet.set( xRowSet, uno::UNO_QUERY ); } @@ -1960,7 +1960,7 @@ OUString SwDBManager::GetDBField(uno::Reference<beans::XPropertySet> const & xCo if(!xColumn.is()) return sRet; - uno::Any aType = xColumnProps->getPropertyValue("Type"); + uno::Any aType = xColumnProps->getPropertyValue(u"Type"_ustr); sal_Int32 eDataType = sdbc::DataType::SQLNULL; aType >>= eDataType; switch(eDataType) @@ -2151,7 +2151,7 @@ bool SwDBManager::FillCalcWithMergeData( SvNumberFormatter *pDocFormatter, uno::Any aCol = xCols->getByName( rColName ); uno::Reference<beans::XPropertySet> xColumnProps; aCol >>= xColumnProps; - uno::Any aType = xColumnProps->getPropertyValue( "Type" ); + uno::Any aType = xColumnProps->getPropertyValue( u"Type"_ustr ); aType >>= nColumnType; double aNumber = DBL_MAX; @@ -2722,21 +2722,21 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference uno::Reference<beans::XPropertySet> xDataProperties(xNewInstance, uno::UNO_QUERY); if (aURLAny.hasValue()) - xDataProperties->setPropertyValue("URL", aURLAny); + xDataProperties->setPropertyValue(u"URL"_ustr, aURLAny); if (aTableFilterAny.hasValue()) - xDataProperties->setPropertyValue("TableFilter", aTableFilterAny); + xDataProperties->setPropertyValue(u"TableFilter"_ustr, aTableFilterAny); if (aSuppressVersionsAny.hasValue()) - xDataProperties->setPropertyValue("SuppressVersionColumns", aSuppressVersionsAny); + xDataProperties->setPropertyValue(u"SuppressVersionColumns"_ustr, aSuppressVersionsAny); if (aInfoAny.hasValue()) - xDataProperties->setPropertyValue("Info", aInfoAny); + xDataProperties->setPropertyValue(u"Info"_ustr, aInfoAny); if (DBConnURIType::FLAT == type && pSettings) { - uno::Any aSettings = xDataProperties->getPropertyValue("Settings"); + uno::Any aSettings = xDataProperties->getPropertyValue(u"Settings"_ustr); uno::Reference < beans::XPropertySet > xDSSettings; aSettings >>= xDSSettings; ::comphelper::copyProperties(*pSettings, xDSSettings); - xDSSettings->setPropertyValue("Extension", uno::Any(sExt)); + xDSSettings->setPropertyValue(u"Extension"_ustr, uno::Any(sExt)); } uno::Reference<sdb::XDocumentDataSource> xDS(xNewInstance, uno::UNO_QUERY_THROW); @@ -2752,14 +2752,14 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference else { // Embed. - OUString aStreamRelPath = "EmbeddedDatabase"; + OUString aStreamRelPath = u"EmbeddedDatabase"_ustr; uno::Reference<embed::XStorage> xStorage = pDocShell->GetStorage(); // Refer to the sub-storage name in the document settings, so // we can load it again next time the file is imported. uno::Reference<lang::XMultiServiceFactory> xFactory(pDocShell->GetModel(), uno::UNO_QUERY); - uno::Reference<beans::XPropertySet> xPropertySet(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); - xPropertySet->setPropertyValue("EmbeddedDatabaseName", uno::Any(aStreamRelPath)); + uno::Reference<beans::XPropertySet> xPropertySet(xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY); + xPropertySet->setPropertyValue(u"EmbeddedDatabaseName"_ustr, uno::Any(aStreamRelPath)); // Store it only after setting the above property, so that only one data source gets registered. SwDBManager::StoreEmbeddedDataSource(xStore, xStorage, aStreamRelPath, aOwnURL); @@ -2807,7 +2807,7 @@ OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, SwDocShel sAllDataFilter.append(filter); } - xFP->appendFilter( sFilterAll, "*" ); + xFP->appendFilter( sFilterAll, u"*"_ustr ); xFP->appendFilter( sFilterAllData, sAllDataFilter.makeStringAndClear()); // Similar to sfx2::addExtension from sfx2/source/dialog/filtergrouping.cxx @@ -3116,14 +3116,14 @@ uno::Reference<sdbc::XResultSet> SwDBManager::createCursor(const OUString& _sDat uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) { - uno::Reference<uno::XInterface> xInstance = xMgr->createInstance("com.sun.star.sdb.RowSet"); + uno::Reference<uno::XInterface> xInstance = xMgr->createInstance(u"com.sun.star.sdb.RowSet"_ustr); uno::Reference<beans::XPropertySet> xRowSetPropSet(xInstance, uno::UNO_QUERY); if(xRowSetPropSet.is()) { - xRowSetPropSet->setPropertyValue("DataSourceName", uno::Any(_sDataSourceName)); - xRowSetPropSet->setPropertyValue("ActiveConnection", uno::Any(_xConnection)); - xRowSetPropSet->setPropertyValue("Command", uno::Any(_sCommand)); - xRowSetPropSet->setPropertyValue("CommandType", uno::Any(_nCommandType)); + xRowSetPropSet->setPropertyValue(u"DataSourceName"_ustr, uno::Any(_sDataSourceName)); + xRowSetPropSet->setPropertyValue(u"ActiveConnection"_ustr, uno::Any(_xConnection)); + xRowSetPropSet->setPropertyValue(u"Command"_ustr, uno::Any(_sCommand)); + xRowSetPropSet->setPropertyValue(u"CommandType"_ustr, uno::Any(_nCommandType)); uno::Reference< sdb::XCompletedExecution > xRowSet(xInstance, uno::UNO_QUERY); |