sw/source/ui/dbui/addresslistdialog.cxx | 50 ++++++------- sw/source/ui/dbui/createaddresslistdialog.cxx | 2 sw/source/ui/dbui/dbinsdlg.cxx | 30 ++++---- sw/source/ui/dbui/dbmgr.cxx | 97 ++++++++++++-------------- sw/source/ui/dbui/dbtablepreviewdialog.cxx | 8 -- sw/source/ui/dbui/mmconfigitem.cxx | 28 +++---- sw/source/ui/dbui/mmlayoutpage.cxx | 2 sw/source/ui/dbui/mmoutputpage.cxx | 10 +- sw/source/ui/dbui/mmpreparemergepage.cxx | 14 +-- sw/source/ui/dbui/selectdbtabledialog.cxx | 17 ++-- 10 files changed, 126 insertions(+), 132 deletions(-)
New commits: commit 8808f482a2d28919e4d3eddfccfe6e4daf697601 Author: Miklos Vajna <vmik...@suse.cz> Date: Fri Dec 21 12:00:43 2012 +0100 sw: kill C2U in dbui diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 03f80d7..b8126c7 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -99,13 +99,13 @@ static ::rtl::OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet>& xSou if(xSourceProperties.is()) { rtl::OUString sDBURL; - xSourceProperties->getPropertyValue(C2U("URL")) >>= sDBURL; + xSourceProperties->getPropertyValue("URL") >>= sDBURL; if(String(sDBURL).SearchAscii("sdbc:flat:") == 0) { uno::Sequence<OUString> aFilters; - xSourceProperties->getPropertyValue(C2U("TableFilter")) >>= aFilters; + xSourceProperties->getPropertyValue("TableFilter") >>= aFilters; uno::Sequence<PropertyValue> aInfo; - xSourceProperties->getPropertyValue(C2U("Info")) >>= aInfo; + xSourceProperties->getPropertyValue("Info") >>= aInfo; if(aFilters.getLength() == 1 && aInfo.getLength() ) { ::rtl::OUString sFieldDelim; @@ -114,13 +114,13 @@ static ::rtl::OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet>& xSou ::rtl::OUString sCharSet; for(sal_Int32 nInfo = 0; nInfo < aInfo.getLength(); ++nInfo) { - if(aInfo[nInfo].Name == C2U("FieldDelimiter")) + if(aInfo[nInfo].Name == "FieldDelimiter") aInfo[nInfo].Value >>= sFieldDelim; - else if(aInfo[nInfo].Name == C2U("StringDelimiter")) + else if(aInfo[nInfo].Name == "StringDelimiter") aInfo[nInfo].Value >>= sStringDelim; - else if(aInfo[nInfo].Name == C2U("Extension")) + else if(aInfo[nInfo].Name == "Extension") aInfo[nInfo].Value >>= sExtension; - else if(aInfo[nInfo].Name == C2U("CharSet")) + else if(aInfo[nInfo].Name == "CharSet") aInfo[nInfo].Value >>= sCharSet; } if(!sCharSet.compareToAscii( cUTF8 )) @@ -128,9 +128,9 @@ static ::rtl::OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet>& xSou sURL = String(sDBURL).Copy( 10 ); //#i97577# at this point the 'URL' can also be a file name! sURL = URIHelper::SmartRel2Abs( INetURLObject(), sURL ); - sURL += C2U("/"); + sURL += "/"; sURL += aFilters[0]; - sURL += C2U("."); + sURL += "."; sURL += sExtension; } } @@ -289,21 +289,21 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl) { uno::Reference<lang::XMultiServiceFactory> xConnectFactory(pUserData->xConnection, UNO_QUERY_THROW); uno::Reference<XSingleSelectQueryComposer> xComposer( - xConnectFactory->createInstance(C2U("com.sun.star.sdb.SingleSelectQueryComposer")), UNO_QUERY_THROW); + xConnectFactory->createInstance("com.sun.star.sdb.SingleSelectQueryComposer"), UNO_QUERY_THROW); uno::Reference<XRowSet> xRowSet( - xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); + xMgr->createInstance("com.sun.star.sdb.RowSet"), UNO_QUERY); uno::Reference<XPropertySet> xRowProperties(xRowSet, UNO_QUERY); - xRowProperties->setPropertyValue(C2U("DataSourceName"), + xRowProperties->setPropertyValue("DataSourceName", makeAny(OUString(m_aListLB.GetEntryText(pSelect, ITEMID_NAME - 1)))); - xRowProperties->setPropertyValue(C2U("Command"), makeAny( + xRowProperties->setPropertyValue("Command", makeAny( OUString(sCommand))); - xRowProperties->setPropertyValue(C2U("CommandType"), makeAny(pUserData->nCommandType)); - xRowProperties->setPropertyValue(C2U("ActiveConnection"), makeAny(pUserData->xConnection.getTyped())); + xRowProperties->setPropertyValue("CommandType", makeAny(pUserData->nCommandType)); + xRowProperties->setPropertyValue("ActiveConnection", makeAny(pUserData->xConnection.getTyped())); xRowSet->execute(); ::rtl::OUString sQuery; - xRowProperties->getPropertyValue(C2U("ActiveCommand"))>>= sQuery; + xRowProperties->getPropertyValue("ActiveCommand")>>= sQuery; xComposer->setQuery(sQuery); if(!pUserData->sFilter.isEmpty()) xComposer->setFilter(pUserData->sFilter); @@ -367,32 +367,32 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) } uno::Reference<XPropertySet> xDataProperties(xNewInstance, UNO_QUERY); - OUString sDBURL(C2U("sdbc:flat:")); + OUString sDBURL("sdbc:flat:"); //only the 'path' has to be added INetURLObject aTempURL(aURL); aTempURL.removeSegment(); aTempURL.removeFinalSlash(); sDBURL += aTempURL.GetMainURL(INetURLObject::NO_DECODE); Any aAny(&sDBURL, ::getCppuType(&sDBURL)); - xDataProperties->setPropertyValue(C2U("URL"), aAny); + xDataProperties->setPropertyValue("URL", aAny); //set the filter to the file name without extension uno::Sequence<OUString> aFilters(1); aFilters[0] = sNewName; aAny <<= aFilters; - xDataProperties->setPropertyValue(C2U("TableFilter"), aAny); + xDataProperties->setPropertyValue("TableFilter", aAny); uno::Sequence<PropertyValue> aInfo(4); PropertyValue* pInfo = aInfo.getArray(); - pInfo[0].Name = C2U("FieldDelimiter"); + pInfo[0].Name = "FieldDelimiter"; pInfo[0].Value <<= OUString('\t'); - pInfo[1].Name = C2U("StringDelimiter"); + pInfo[1].Name = "StringDelimiter"; pInfo[1].Value <<= OUString('"'); - pInfo[2].Name = C2U("Extension"); - pInfo[2].Value <<= ::rtl::OUString(aURL.getExtension());//C2U("csv"); - pInfo[3].Name = C2U("CharSet"); + pInfo[2].Name = "Extension"; + pInfo[2].Value <<= ::rtl::OUString(aURL.getExtension());//"csv"; + pInfo[3].Name = "CharSet"; pInfo[3].Value <<= rtl::OUString::createFromAscii(cUTF8); aAny <<= aInfo; - xDataProperties->setPropertyValue(C2U("Info"), aAny); + xDataProperties->setPropertyValue("Info", aAny); uno::Reference<sdb::XDocumentDataSource> xDS(xNewInstance, UNO_QUERY_THROW); uno::Reference<frame::XStorable> xStore(xDS->getDatabaseDocument(), UNO_QUERY_THROW); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index b26a43c..494c723 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -557,7 +557,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl) rtl::OUString("$(userurl)/database") )); aDlgHelper.SetDisplayDirectory( sPath ); uno::Reference< XFilterManager > xFltMgr(xFP, uno::UNO_QUERY); - ::rtl::OUString sCSV(C2U("*.csv")); + ::rtl::OUString sCSV("*.csv"); xFltMgr->appendFilter( m_sAddressListFilterName, sCSV ); xFltMgr->setCurrentFilter( m_sAddressListFilterName ) ; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 3797e7b..c53173f 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -191,7 +191,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, Reference<sdbcx::XColumnsSupplier> xColSupp, const SwDBData& rData ) : SfxModalDialog( rView.GetWindow(), SW_RES( DLG_AP_INSERT_DB_SEL )), - ConfigItem(C2U("Office.Writer/InsertData/DataSet"), CONFIG_MODE_DELAYED_UPDATE), + ConfigItem("Office.Writer/InsertData/DataSet", CONFIG_MODE_DELAYED_UPDATE), aFtInsertData( this, SW_RES( FT_INSERT_DATA )), aRbAsTable( this, SW_RES( RB_AS_TABLE )), aRbAsField( this, SW_RES( RB_AS_FIELD )), @@ -257,7 +257,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, Reference< util::XNumberFormats > xNumberFormats; if(xSourceProps.is()) { - Any aFormats = xSourceProps->getPropertyValue(C2U("NumberFormatsSupplier")); + Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); if(aFormats.hasValue()) { Reference< util::XNumberFormatsSupplier> xSuppl; @@ -299,7 +299,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, case DataType::TIMESTAMP: { pNew->bHasFmt = sal_True; - Any aFormat = xCol->getPropertyValue(C2U("FormatKey")); + Any aFormat = xCol->getPropertyValue("FormatKey"); if(aFormat.hasValue()) { sal_Int32 nFmt = 0; @@ -309,8 +309,8 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, try { Reference<XPropertySet> xNumProps = xNumberFormats->getByKey( nFmt ); - Any aFormatVal = xNumProps->getPropertyValue(C2U("FormatString")); - Any aLocale = xNumProps->getPropertyValue(C2U("Locale")); + Any aFormatVal = xNumProps->getPropertyValue("FormatString"); + Any aLocale = xNumProps->getPropertyValue("Locale"); rtl::OUString sFormat; aFormatVal >>= sFormat; lang::Locale aLoc; @@ -1089,7 +1089,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, sal_Int32 eDataType = 0; if( xColumnProps.is() ) { - Any aType = xColumnProps->getPropertyValue(C2U("Type")); + Any aType = xColumnProps->getPropertyValue("Type"); aType >>= eDataType; } try @@ -1222,7 +1222,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, Reference<XPropertySet> xSourceProps(xSource, UNO_QUERY); if(xSourceProps.is()) { - Any aFormats = xSourceProps->getPropertyValue(C2U("NumberFormatsSupplier")); + Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); if(aFormats.hasValue()) { Reference< util::XNumberFormatsSupplier> xSuppl; @@ -1230,7 +1230,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if(xSuppl.is()) { Reference< XPropertySet > xSettings = xSuppl->getNumberFormatSettings(); - Any aNull = xSettings->getPropertyValue(C2U("NullDate")); + Any aNull = xSettings->getPropertyValue("NullDate"); aNull >>= aDBFormatData.aNullDate; if(aDBFormatData.xFormatter.is()) aDBFormatData.xFormatter->attachNumberFormatsSupplier(xSuppl); @@ -1302,7 +1302,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, &nValue ) ); if( DBL_MAX != nValue ) { - Any aType = xColumnProps->getPropertyValue(C2U("Type")); + Any aType = xColumnProps->getPropertyValue("Type"); sal_Int32 eDataType = 0; aType >>= eDataType; if( DataType::DATE == eDataType || DataType::TIME == eDataType || @@ -1524,7 +1524,7 @@ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames) { sal_Int32 nIdx = aNames.getLength(); const rtl::OUString* pNames = aNames.getConstArray(); - rtl::OUString sTest(C2U("_")); + rtl::OUString sTest("_"); rtl::OUString sRet; while(sal_True) { @@ -1556,9 +1556,9 @@ void SwInsertDBColAutoPilot::Commit() Sequence<rtl::OUString> aSourceNames(2); rtl::OUString* pSourceNames = aSourceNames.getArray(); pSourceNames[0] = pNames[nNode]; - pSourceNames[0] += C2U("/DataSource"); + pSourceNames[0] += "/DataSource"; pSourceNames[1] = pNames[nNode]; - pSourceNames[1] += C2U("/Command"); + pSourceNames[1] += "/Command"; Sequence<Any> aSourceProperties = GetProperties(aSourceNames); const Any* pSourceProps = aSourceProperties.getArray(); rtl::OUString sSource, sCommand; @@ -1578,7 +1578,7 @@ void SwInsertDBColAutoPilot::Commit() Sequence<PropertyValue> aValues(aNodeNames.getLength()); PropertyValue* pValues = aValues.getArray(); const rtl::OUString* pNodeNames = aNodeNames.getConstArray(); - rtl::OUString sSlash(C2U("/")); + rtl::OUString sSlash("/"); for(sal_Int32 i = 0; i < aNodeNames.getLength(); i++) { pValues[i].Name = sSlash; @@ -1618,7 +1618,7 @@ void SwInsertDBColAutoPilot::Commit() SetSetProperties(rtl::OUString(), aValues); - sNewNode += C2U("/ColumnSet"); + sNewNode += "/ColumnSet"; rtl::OUString sDelim("/__"); LanguageType ePrevLang = (LanguageType)-1; @@ -1719,7 +1719,7 @@ void SwInsertDBColAutoPilot::Load() pNewData->bIsEmptyHeadln = *(sal_Bool*)pDataSourceProps[10].getValue(); rtl::OUString sSubNodeName(pNames[nNode]); - sSubNodeName += C2U("/ColumnSet/"); + sSubNodeName += "/ColumnSet/"; Sequence <rtl::OUString> aSubNames = GetNodeNames(sSubNodeName); const rtl::OUString* pSubNames = aSubNames.getConstArray(); for(sal_Int32 nSub = 0; nSub < aSubNames.getLength(); nSub++) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 029a208..65c5052 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -167,14 +167,14 @@ bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<XResultS try { sal_Bool bFinal = sal_False; - Any aFinal = xPrSet->getPropertyValue(C2U("IsRowCountFinal")); + Any aFinal = xPrSet->getPropertyValue("IsRowCountFinal"); aFinal >>= bFinal; if(!bFinal) { xResultSet->last(); xResultSet->first(); } - Any aCount = xPrSet->getPropertyValue(C2U("RowCount")); + Any aCount = xPrSet->getPropertyValue("RowCount"); if( aCount >>= rCount ) return true; } @@ -237,7 +237,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSourc uno::Reference<XPropertySet> xSourceProps(xSource, UNO_QUERY); if(xSourceProps.is()) { - Any aFormats = xSourceProps->getPropertyValue(C2U("NumberFormatsSupplier")); + Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); if(aFormats.hasValue()) { uno::Reference<XNumberFormatsSupplier> xSuppl; @@ -245,7 +245,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSourc if(xSuppl.is()) { uno::Reference< XPropertySet > xSettings = xSuppl->getNumberFormatSettings(); - Any aNull = xSettings->getPropertyValue(C2U("NullDate")); + Any aNull = xSettings->getPropertyValue("NullDate"); aNull >>= rParam.aNullDate; if(rParam.xFormatter.is()) rParam.xFormatter->attachNumberFormatsSupplier(xSuppl); @@ -1462,7 +1462,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, uno::Reference< XNumberFormats > xNumberFormats; if(xSourceProps.is()) { - Any aFormats = xSourceProps->getPropertyValue(C2U("NumberFormatsSupplier")); + Any aFormats = xSourceProps->getPropertyValue("NumberFormatsSupplier"); if(aFormats.hasValue()) { uno::Reference<XNumberFormatsSupplier> xSuppl; @@ -1476,7 +1476,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, bool bUseDefault = true; try { - Any aFormatKey = xColumn->getPropertyValue(C2U("FormatKey")); + Any aFormatKey = xColumn->getPropertyValue("FormatKey"); if(aFormatKey.hasValue()) { sal_Int32 nFmt = 0; @@ -1486,8 +1486,8 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, try { uno::Reference<XPropertySet> xNumProps = xNumberFormats->getByKey( nFmt ); - Any aFormatString = xNumProps->getPropertyValue(C2U("FormatString")); - Any aLocaleVal = xNumProps->getPropertyValue(C2U("Locale")); + Any aFormatString = xNumProps->getPropertyValue("FormatString"); + Any aLocaleVal = xNumProps->getPropertyValue("Locale"); rtl::OUString sFormat; aFormatString >>= sFormat; lang::Locale aLoc; @@ -1603,23 +1603,22 @@ uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Refe sal_Int32 nCommandType = SW_DB_SELECT_TABLE == eTableOrQuery ? CommandType::TABLE : CommandType::QUERY; Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - Reference<XRowSet> xRowSet( - xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); + Reference<XRowSet> xRowSet(xMgr->createInstance("com.sun.star.sdb.RowSet"), UNO_QUERY); ::rtl::OUString sDataSource; Reference<XDataSource> xSource = SwNewDBMgr::getDataSourceAsParent(xConnection, sDataSource); Reference<XPropertySet> xSourceProperties(xSource, UNO_QUERY); if(xSourceProperties.is()) { - xSourceProperties->getPropertyValue(C2U("Name")) >>= sDataSource; + xSourceProperties->getPropertyValue("Name") >>= sDataSource; } Reference<XPropertySet> xRowProperties(xRowSet, UNO_QUERY); - xRowProperties->setPropertyValue(C2U("DataSourceName"), makeAny(sDataSource)); - xRowProperties->setPropertyValue(C2U("Command"), makeAny(::rtl::OUString(rTableOrQuery))); - xRowProperties->setPropertyValue(C2U("CommandType"), makeAny(nCommandType)); - xRowProperties->setPropertyValue(C2U("FetchSize"), makeAny((sal_Int32)10)); - xRowProperties->setPropertyValue(C2U("ActiveConnection"), makeAny(xConnection)); + xRowProperties->setPropertyValue("DataSourceName", makeAny(sDataSource)); + xRowProperties->setPropertyValue("Command", makeAny(::rtl::OUString(rTableOrQuery))); + xRowProperties->setPropertyValue("CommandType", makeAny(nCommandType)); + xRowProperties->setPropertyValue("FetchSize", makeAny((sal_Int32)10)); + xRowProperties->setPropertyValue("ActiveConnection", makeAny(xConnection)); xRowSet->execute(); xRet = Reference<XColumnsSupplier>( xRowSet, UNO_QUERY ); } @@ -1641,7 +1640,7 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps, if(!xColumn.is()) return sRet; - Any aType = xColumnProps->getPropertyValue(C2U("Type")); + Any aType = xColumnProps->getPropertyValue("Type"); sal_Int32 eDataType = 0; aType >>= eDataType; switch(eDataType) @@ -1966,8 +1965,8 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa } pFound->xStatement = pFound->xConnection->createStatement(); rtl::OUString aQuoteChar = xMetaData->getIdentifierQuoteString(); - rtl::OUString sStatement(C2U("SELECT * FROM ")); - sStatement = C2U("SELECT * FROM "); + rtl::OUString sStatement("SELECT * FROM "); + sStatement = "SELECT * FROM "; sStatement += aQuoteChar; sStatement += rTableOrQuery; sStatement += aQuoteChar; @@ -2193,18 +2192,18 @@ String SwNewDBMgr::LoadAndRegisterDataSource() String sFilterMDB(SW_RES(STR_FILTER_MDB)); String sFilterACCDB(SW_RES(STR_FILTER_ACCDB)); #endif - xFltMgr->appendFilter( sFilterAll, C2U("*") ); - xFltMgr->appendFilter( sFilterAllData, C2U("*.ods;*.sxc;*.dbf;*.xls;*.txt;*.csv")); - - xFltMgr->appendFilter( sFilterSXB, C2U("*.odb") ); - xFltMgr->appendFilter( sFilterSXC, C2U("*.ods;*.sxc") ); - xFltMgr->appendFilter( sFilterDBF, C2U("*.dbf") ); - xFltMgr->appendFilter( sFilterXLS, C2U("*.xls") ); - xFltMgr->appendFilter( sFilterTXT, C2U("*.txt") ); - xFltMgr->appendFilter( sFilterCSV, C2U("*.csv") ); + xFltMgr->appendFilter( sFilterAll, "*" ); + xFltMgr->appendFilter( sFilterAllData, "*.ods;*.sxc;*.dbf;*.xls;*.txt;*.csv"); + + xFltMgr->appendFilter( sFilterSXB, "*.odb" ); + xFltMgr->appendFilter( sFilterSXC, "*.ods;*.sxc" ); + xFltMgr->appendFilter( sFilterDBF, "*.dbf" ); + xFltMgr->appendFilter( sFilterXLS, "*.xls" ); + xFltMgr->appendFilter( sFilterTXT, "*.txt" ); + xFltMgr->appendFilter( sFilterCSV, "*.csv" ); #ifdef WNT - xFltMgr->appendFilter( sFilterMDB, C2U("*.mdb") ); - xFltMgr->appendFilter( sFilterACCDB, C2U("*.accdb") ); + xFltMgr->appendFilter( sFilterMDB, "*.mdb" ); + xFltMgr->appendFilter( sFilterACCDB, "*.accdb" ); #endif xFltMgr->setCurrentFilter( sFilterAll ) ; @@ -2230,7 +2229,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource() || sExt.EqualsIgnoreCaseAscii("ods") || sExt.EqualsIgnoreCaseAscii("xls")) { - rtl::OUString sDBURL(C2U("sdbc:calc:")); + rtl::OUString sDBURL("sdbc:calc:"); sDBURL += aTempURL.GetMainURL(INetURLObject::NO_DECODE); aURLAny <<= sDBURL; } @@ -2238,7 +2237,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource() { aTempURL.removeSegment(); aTempURL.removeFinalSlash(); - rtl::OUString sDBURL(C2U("sdbc:dbase:")); + rtl::OUString sDBURL("sdbc:dbase:"); sDBURL += aTempURL.GetMainURL(INetURLObject::NO_DECODE); aURLAny <<= sDBURL; //set the filter to the file name without extension @@ -2250,7 +2249,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource() { aTempURL.removeSegment(); aTempURL.removeFinalSlash(); - rtl::OUString sDBURL(C2U("sdbc:flat:")); + rtl::OUString sDBURL("sdbc:flat:"); //only the 'path' has to be added sDBURL += aTempURL.GetMainURL(INetURLObject::NO_DECODE); aURLAny <<= sDBURL; @@ -2264,14 +2263,14 @@ String SwNewDBMgr::LoadAndRegisterDataSource() #ifdef WNT else if(sExt.EqualsIgnoreCaseAscii("mdb")) { - rtl::OUString sDBURL(C2U("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=")); + rtl::OUString sDBURL("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="); sDBURL += aTempURL.PathToFileName(); aURLAny <<= sDBURL; aSuppressVersionsAny <<= makeAny(true); } else if(sExt.EqualsIgnoreCaseAscii("accdb")) { - rtl::OUString sDBURL(C2U("sdbc:ado:PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=")); + rtl::OUString sDBURL("sdbc:ado:PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="); sDBURL += aTempURL.PathToFileName(); aURLAny <<= sDBURL; aSuppressVersionsAny <<= makeAny(true); @@ -2313,27 +2312,26 @@ String SwNewDBMgr::LoadAndRegisterDataSource() Reference<XPropertySet> xDataProperties(xNewInstance, UNO_QUERY); if(aURLAny.hasValue()) - xDataProperties->setPropertyValue(C2U("URL"), aURLAny); + xDataProperties->setPropertyValue("URL", aURLAny); if(aTableFilterAny.hasValue()) - xDataProperties->setPropertyValue(C2U("TableFilter"), aTableFilterAny); + xDataProperties->setPropertyValue("TableFilter", aTableFilterAny); if(aSuppressVersionsAny.hasValue()) - xDataProperties->setPropertyValue(C2U("SuppressVersionColumns"), aSuppressVersionsAny); + xDataProperties->setPropertyValue("SuppressVersionColumns", aSuppressVersionsAny); if(aInfoAny.hasValue()) - xDataProperties->setPropertyValue(C2U("Info"), aInfoAny); + xDataProperties->setPropertyValue("Info", aInfoAny); if( bTextConnection ) { - uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg( - xMgr->createInstance( C2U( "com.sun.star.sdb.TextConnectionSettings" ) ), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xSettingsDlg(xMgr->createInstance( "com.sun.star.sdb.TextConnectionSettings" ), uno::UNO_QUERY); if( xSettingsDlg->execute() ) { - uno::Any aSettings = xDataProperties->getPropertyValue( C2U( "Settings" ) ); + uno::Any aSettings = xDataProperties->getPropertyValue( "Settings" ); uno::Reference < beans::XPropertySet > xDSSettings; aSettings >>= xDSSettings; ::comphelper::copyProperties( uno::Reference < beans::XPropertySet >( xSettingsDlg, uno::UNO_QUERY ), xDSSettings ); - xDSSettings->setPropertyValue( C2U("Extension"), uno::makeAny( ::rtl::OUString( sExt ))); + xDSSettings->setPropertyValue( "Extension", uno::makeAny( ::rtl::OUString( sExt ))); } } @@ -2428,7 +2426,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); - pValues[0].Name = C2U("FilterName"); + pValues[0].Name = "FilterName"; pValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName()); uno::Reference< XStorable > xStore( xDocShell->GetModel(), uno::UNO_QUERY); sTempURL = URIHelper::SmartRel2Abs( INetURLObject(), utl::TempFile::CreateTempName() ); @@ -2636,15 +2634,14 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) { - uno::Reference<XInterface> xInstance = xMgr->createInstance( - C2U( "com.sun.star.sdb.RowSet" )); + uno::Reference<XInterface> xInstance = xMgr->createInstance("com.sun.star.sdb.RowSet"); uno::Reference<XPropertySet> xRowSetPropSet(xInstance, UNO_QUERY); if(xRowSetPropSet.is()) { - xRowSetPropSet->setPropertyValue(C2U("DataSourceName"), makeAny(_sDataSourceName)); - xRowSetPropSet->setPropertyValue(C2U("ActiveConnection"), makeAny(_xConnection)); - xRowSetPropSet->setPropertyValue(C2U("Command"), makeAny(_sCommand)); - xRowSetPropSet->setPropertyValue(C2U("CommandType"), makeAny(_nCommandType)); + xRowSetPropSet->setPropertyValue("DataSourceName", makeAny(_sDataSourceName)); + xRowSetPropSet->setPropertyValue("ActiveConnection", makeAny(_xConnection)); + xRowSetPropSet->setPropertyValue("Command", makeAny(_sCommand)); + xRowSetPropSet->setPropertyValue("CommandType", makeAny(_nCommandType)); uno::Reference< XCompletedExecution > xRowSet(xInstance, UNO_QUERY); diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index f57a3b2..3bf7c4d 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -69,7 +69,7 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b // create a frame wrapper for myself uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - m_xFrame = uno::Reference< frame::XFrame >(xMgr->createInstance(C2U("com.sun.star.frame.Frame")), uno::UNO_QUERY); + m_xFrame = uno::Reference< frame::XFrame >(xMgr->createInstance("com.sun.star.frame.Frame"), uno::UNO_QUERY); if(m_xFrame.is()) { m_xFrame->initialize( VCLUnoHelper::GetInterface ( m_pBeamerWIN ) ); @@ -83,10 +83,8 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b { uno::Reference<frame::XDispatchProvider> xDP(m_xFrame, uno::UNO_QUERY); util::URL aURL; - aURL.Complete = C2U(".component:DB/DataSourceBrowser"); - uno::Reference<frame::XDispatch> xD = xDP->queryDispatch(aURL, - C2U(""), - 0x0C); + aURL.Complete = ".component:DB/DataSourceBrowser"; + uno::Reference<frame::XDispatch> xD = xDP->queryDispatch(aURL, "", 0x0C); if(xD.is()) { xD->dispatch(aURL, rValues); diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index 1ad3662..04d6314 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -180,7 +180,7 @@ public: }; SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : - ConfigItem(C2U("Office.Writer/MailMergeWizard"), 0), + ConfigItem("Office.Writer/MailMergeWizard", 0), nResultSetCursorPos(-1), nCurrentAddressBlock(0), bIsAddressBlock(sal_True), @@ -368,7 +368,7 @@ static OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments ) do { bFound = false; - sNewName = C2U("_"); + sNewName = "_"; sNewName += OUString::valueOf(nStart); //search if the name exists for(sal_Int32 nAssign = 0; nAssign < rAssignments.getLength(); ++nAssign) @@ -398,7 +398,7 @@ static void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeader String sHeader = rHeaders.GetString( i ); sHeader.Insert('<', 0); sHeader += '>'; - String sReplace(C2U("<>")); + String sReplace("<>"); sReplace.Insert('0' + i, 1); sBlock.SearchAndReplaceAll(sHeader, sReplace); } @@ -594,7 +594,7 @@ void SwMailMergeConfigItem_Impl::Commit() OUString sNewNode = !aAssignIter->sConfigNodeName.isEmpty() ? aAssignIter->sConfigNodeName : lcl_CreateNodeName(aAssignments); - OUString sSlash = C2U("/"); + OUString sSlash = "/"; OUString sNodePath = rtl::OUString::createFromAscii(cAddressDataAssignments); sNodePath += sSlash; sNodePath += sNewNode; @@ -905,17 +905,17 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const if( xMgr.is() ) { Reference<XRowSet> xRowSet( - xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); + xMgr->createInstance("com.sun.star.sdb.RowSet"), UNO_QUERY); Reference<XPropertySet> xRowProperties(xRowSet, UNO_QUERY); - xRowProperties->setPropertyValue(C2U("DataSourceName"), makeAny(m_pImpl->aDBData.sDataSource)); - xRowProperties->setPropertyValue(C2U("Command"), makeAny(m_pImpl->aDBData.sCommand)); - xRowProperties->setPropertyValue(C2U("CommandType"), makeAny(m_pImpl->aDBData.nCommandType)); - xRowProperties->setPropertyValue(C2U("FetchSize"), makeAny((sal_Int32)10)); - xRowProperties->setPropertyValue(C2U("ActiveConnection"), makeAny(m_pImpl->xConnection.getTyped())); + xRowProperties->setPropertyValue("DataSourceName", makeAny(m_pImpl->aDBData.sDataSource)); + xRowProperties->setPropertyValue("Command", makeAny(m_pImpl->aDBData.sCommand)); + xRowProperties->setPropertyValue("CommandType", makeAny(m_pImpl->aDBData.nCommandType)); + xRowProperties->setPropertyValue("FetchSize", makeAny((sal_Int32)10)); + xRowProperties->setPropertyValue("ActiveConnection", makeAny(m_pImpl->xConnection.getTyped())); try { - xRowProperties->setPropertyValue(C2U("ApplyFilter"), makeAny(!m_pImpl->sFilter.isEmpty())); - xRowProperties->setPropertyValue(C2U("Filter"), makeAny(m_pImpl->sFilter)); + xRowProperties->setPropertyValue("ApplyFilter", makeAny(!m_pImpl->sFilter.isEmpty())); + xRowProperties->setPropertyValue("Filter", makeAny(m_pImpl->sFilter)); } catch (const Exception&) { @@ -960,8 +960,8 @@ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter) { try { - xRowProperties->setPropertyValue(C2U("ApplyFilter"), makeAny(!m_pImpl->sFilter.isEmpty())); - xRowProperties->setPropertyValue(C2U("Filter"), makeAny(m_pImpl->sFilter)); + xRowProperties->setPropertyValue("ApplyFilter", makeAny(!m_pImpl->sFilter.isEmpty())); + xRowProperties->setPropertyValue("Filter", makeAny(m_pImpl->sFilter)); uno::Reference<XRowSet> xRowSet( m_pImpl->xResultSet, UNO_QUERY_THROW ); xRowSet->execute(); } diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 8ca0f7b..563f5df 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -123,7 +123,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : SwView* pView = m_pWizard->GetSwView(); uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); - pValues[0].Name = C2U("FilterName"); + pValues[0].Name = "FilterName"; pValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName()); uno::Reference< frame::XStorable > xStore( pView->GetDocShell()->GetModel(), uno::UNO_QUERY); diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index c88c168..2b51dce 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -668,7 +668,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) return 0; uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); - pValues[0].Name = C2U("FilterName"); + pValues[0].Name = "FilterName"; pValues[0].Value <<= ::rtl::OUString(sFilter); uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY); @@ -720,7 +720,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); - pValues[0].Name = C2U("FilterName"); + pValues[0].Name = "FilterName"; pValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName()); uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY); @@ -1155,7 +1155,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); - pValues[0].Name = C2U("FilterName"); + pValues[0].Name = "FilterName"; pValues[0].Value <<= ::rtl::OUString(pTargetSfxFlt->GetFilterName()); uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY); @@ -1203,11 +1203,11 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) { uno::Sequence< beans::PropertyValue > aFilterValues(MM_DOCTYPE_TEXT == nDocType ? 2 : 1); beans::PropertyValue* pFilterValues = aFilterValues.getArray(); - pFilterValues[0].Name = C2U("FilterName"); + pFilterValues[0].Name = "FilterName"; pFilterValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName()); if(MM_DOCTYPE_TEXT == nDocType) { - pFilterValues[1].Name = C2U("FilterOptions"); + pFilterValues[1].Name = "FilterOptions"; pFilterValues[1].Value <<= ::rtl::OUString(sFilterOptions); } diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 1d80a42..ca8ff66 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -121,19 +121,19 @@ IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) Sequence< PropertyValue > aArgs(7); Sequence<Any> aSelection(1); aSelection[0] <<= rConfigItem.GetResultSetPosition(); - aArgs[0].Name = C2U("Selection"); + aArgs[0].Name = "Selection"; aArgs[0].Value <<= aSelection; - aArgs[1].Name = C2U("DataSourceName"); + aArgs[1].Name = "DataSourceName"; aArgs[1].Value <<= rDBData.sDataSource; - aArgs[2].Name = C2U("Command"); + aArgs[2].Name = "Command"; aArgs[2].Value <<= rDBData.sCommand; - aArgs[3].Name = C2U("CommandType"); + aArgs[3].Name = "CommandType"; aArgs[3].Value <<= rDBData.nCommandType; - aArgs[4].Name = C2U("ActiveConnection"); + aArgs[4].Name = "ActiveConnection"; aArgs[4].Value <<= rConfigItem.GetConnection().getTyped(); - aArgs[5].Name = C2U("Filter"); + aArgs[5].Name = "Filter"; aArgs[5].Value <<= rConfigItem.GetFilter(); - aArgs[6].Name = C2U("Cursor"); + aArgs[6].Name = "Cursor"; aArgs[6].Value <<= rConfigItem.GetResultSet(); ::svx::ODataAccessDescriptor aDescriptor(aArgs); diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index 52574d4..bbcd035 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -149,22 +149,21 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) { Reference<XDataSource> xSource(xChild->getParent(), UNO_QUERY); Reference<XPropertySet> xPrSet(xSource, UNO_QUERY); - xPrSet->getPropertyValue(C2U("Name")) >>= sDataSourceName; + xPrSet->getPropertyValue("Name") >>= sDataSourceName; } OSL_ENSURE(!sDataSourceName.isEmpty(), "no data source found"); Sequence<PropertyValue> aProperties(5); PropertyValue* pProperties = aProperties.getArray(); - pProperties[0].Name = C2U("DataSourceName"); + pProperties[0].Name = "DataSourceName"; pProperties[0].Value <<= sDataSourceName; - pProperties[1].Name = C2U("Command"); + pProperties[1].Name = "Command"; pProperties[1].Value <<= sTableOrQuery; - pProperties[2].Name = C2U("CommandType"); + pProperties[2].Name = "CommandType"; pProperties[2].Value <<= nCommandType; - pProperties[3].Name = C2U("ShowTreeView"); - sal_Bool bFalse = sal_False; - pProperties[3].Value <<= bFalse; - pProperties[4].Name = C2U("ShowTreeViewButton"); - pProperties[4].Value <<= bFalse; + pProperties[3].Name = "ShowTreeView"; + pProperties[3].Value <<= sal_False; + pProperties[4].Name = "ShowTreeViewButton"; + pProperties[4].Value <<= sal_False; SwDBTablePreviewDialog* pDlg = new SwDBTablePreviewDialog(pButton, aProperties); pDlg->Execute(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits