[Libreoffice-commits] .: 20 commits - connectivity/inc connectivity/source desktop/source formula/source fpicker/source framework/source sfx2/source svx/source xmloff/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Mar 1 12:40:39 PST 2011
connectivity/inc/connectivity/CommonTools.hxx | 4 +
connectivity/source/commontools/CommonTools.cxx | 2
connectivity/source/drivers/adabas/BConnection.cxx | 2
connectivity/source/drivers/evoab2/NResultSet.cxx | 4 -
connectivity/source/drivers/evoab2/NStatement.cxx | 4 -
connectivity/source/drivers/file/FDatabaseMetaData.cxx | 6 +-
connectivity/source/drivers/jdbc/Class.cxx | 2
connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx | 8 +-
connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx | 27 ++++++----
connectivity/source/parse/sqlnode.cxx | 6 +-
desktop/source/app/app.cxx | 12 +---
desktop/source/splash/splash.cxx | 7 +-
formula/source/ui/resource/ModuleHelper.cxx | 3 -
fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 6 +-
framework/source/classes/fwkresid.cxx | 5 -
framework/source/classes/fwlresid.cxx | 5 -
framework/source/layoutmanager/layoutmanager.cxx | 2
framework/source/services/license.cxx | 3 -
framework/source/uielement/controlmenucontroller.cxx | 9 ---
sfx2/source/appl/app.cxx | 3 -
sfx2/source/appl/shutdownicon.cxx | 6 +-
sfx2/source/appl/workwin.cxx | 3 -
svx/source/accessibility/ChildrenManagerImpl.cxx | 2
svx/source/dialog/dialmgr.cxx | 5 -
svx/source/form/datanavi.cxx | 4 -
svx/source/form/filtnav.cxx | 2
svx/source/gallery2/galmisc.cxx | 3 -
svx/source/gengal/gengal.cxx | 11 +---
svx/source/svdraw/svdetc.cxx | 3 -
xmloff/source/core/DocumentSettingsContext.cxx | 2
xmloff/source/core/XMLBase64ImportContext.cxx | 2
xmloff/source/draw/ximpstyl.cxx | 2
xmloff/source/text/XMLTextFrameContext.cxx | 2
33 files changed, 75 insertions(+), 92 deletions(-)
New commits:
commit cd09bc9e70e80d240b18c173d2f9a2cf2f752af8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 16:25:46 2011 +0000
resolve ambiguities
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index e2e8ebe..778e7e0 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -291,7 +291,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
{
aName = aName.replaceAt(aName.getLength()-(aFilenameExtension.Len()+1),aFilenameExtension.Len()+1,::rtl::OUString());
sal_Unicode nChar = aName.toChar();
- if ( match(tableNamePattern,aName.getStr(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
+ if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
{
aRow.push_back(new ORowSetValueDecorator(aName));
bNewRow = sal_True;
@@ -306,7 +306,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
if (!aURL.getExtension().getLength())
{
sal_Unicode nChar = aURL.getBase().getStr()[0];
- if(match(tableNamePattern,aURL.getBase().getStr(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
+ if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
{
aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(aURL.getBase())));
bNewRow = sal_True;
@@ -426,7 +426,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
for(;pBegin != pEnd;++pBegin)
{
- if(match(tableNamePattern,pBegin->getStr(),'\0'))
+ if(match(tableNamePattern,*pBegin,'\0'))
{
static ODatabaseMetaDataResultSet::ORow aRow(8);
commit 34343b03bf03a3e8acb0f01e303661a80aac4e83
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 16:21:39 2011 +0000
remove this now its usage is gone
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 86d4bb0..aff440e 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1690,9 +1690,6 @@ void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW )
USHORT nId = pCW->nSaveId;
SfxChildWindow *pChildWin = pCW->pWin;
- // existing window goes out of the context and is therefore removed
- USHORT nPos = pChildWin->GetPosition();
-
// Save the information in the INI file
USHORT nFlags = pCW->aInfo.nFlags;
pCW->aInfo = pChildWin->GetInfo();
commit 81791ae76010d6bcab78c78b059b072714631a10
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 15:03:56 2011 +0000
avoid implicit cast
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index f0df032..f8bbc3d 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -405,8 +405,7 @@ void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap)
aStrBuf.append( "intro_" );
if ( _sAppName.getLength() > 0 )
{
- aStrBuf.append( OString( _sAppName, _sAppName.getLength(),
- RTL_TEXTENCODING_UTF8 ) );
+ aStrBuf.append( OUStringToOString(_sAppName, RTL_TEXTENCODING_UTF8) );
aStrBuf.append( "_" );
}
aResBuf.append( OString::valueOf( nWidth ));
@@ -414,12 +413,12 @@ void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap)
aResBuf.append( OString::valueOf( nHeight ));
aStrBuf.append( aResBuf.getStr() );
- if (Application::LoadBrandBitmap (aStrBuf.makeStringAndClear(), rBitmap))
+ if (Application::LoadBrandBitmap (aStrBuf.makeStringAndClear().getStr(), rBitmap))
return;
aStrBuf.append( "intro_" );
aStrBuf.append( aResBuf.getStr() );
- if (Application::LoadBrandBitmap (aResBuf.makeStringAndClear(), rBitmap))
+ if (Application::LoadBrandBitmap (aResBuf.makeStringAndClear().getStr(), rBitmap))
return;
Application::LoadBrandBitmap ("intro", rBitmap);
commit c3e3507da050dc89f06c49e8e1cdd9ee83a2ad60
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 15:03:45 2011 +0000
avoid implicit cast
diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 88fd513..ae87bed 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -879,10 +879,11 @@ void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const ::rtl::OUS
if ( catalog.hasValue() )
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr();
const char *pCOL = NULL;
@@ -980,11 +981,13 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding);
+ aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding).getStr(),
- *pCOL = aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr(),
+ *pCOL = aCOL.getStr();
SQLRETURN nRetcode = N3SQLColumnPrivileges(m_aStatementHandle,
@@ -1012,11 +1015,13 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, const ::rtl
::rtl::OString aPKQ,aPKO,aPKN,aCOL;
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding);
+ aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(tableNamePattern,m_nTextEncoding).getStr(),
- *pCOL = aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr(),
+ *pCOL = aCOL.getStr();
SQLRETURN nRetcode = N3SQLColumns(m_aStatementHandle,
@@ -1078,11 +1083,13 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, cons
::rtl::OString aPKQ,aPKO,aPKN,aCOL;
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding);
+ aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding).getStr(),
- *pCOL = aCOL = ::rtl::OUStringToOString(columnNamePattern,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr(),
+ *pCOL = aCOL.getStr();
SQLRETURN nRetcode = N3SQLProcedureColumns(m_aStatementHandle,
@@ -1111,10 +1118,11 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const ::rtl:
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schemaPattern,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(procedureNamePattern,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr();
SQLRETURN nRetcode = N3SQLProcedures(m_aStatementHandle,
@@ -1140,10 +1148,11 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(sal_Bool _bRowVer,const Any&
::rtl::OString aPKQ,aPKO,aPKN,aCOL;
aPKQ = ::rtl::OUStringToOString(comphelper::getString(catalog),m_nTextEncoding);
aPKO = ::rtl::OUStringToOString(schema,m_nTextEncoding);
+ aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding);
const char *pPKQ = catalog.hasValue() && aPKQ.getLength() ? aPKQ.getStr() : NULL,
*pPKO = pSchemaPat && pSchemaPat->getLength() ? aPKO.getStr() : NULL,
- *pPKN = aPKN = ::rtl::OUStringToOString(table,m_nTextEncoding).getStr();
+ *pPKN = aPKN.getStr();
SQLRETURN nRetcode = N3SQLSpecialColumns(m_aStatementHandle,_bRowVer ? SQL_ROWVER : SQL_BEST_ROWID,
commit 2b2ad77c97c433af7815abafa9d4972503a8d80f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 15:03:14 2011 +0000
avoid implicit cast
diff --git a/connectivity/source/drivers/jdbc/Class.cxx b/connectivity/source/drivers/jdbc/Class.cxx
index 181f0e0..b122ad5 100644
--- a/connectivity/source/drivers/jdbc/Class.cxx
+++ b/connectivity/source/drivers/jdbc/Class.cxx
@@ -58,7 +58,7 @@ java_lang_Class * java_lang_Class::forName( const ::rtl::OUString& _par0 )
{
::rtl::OString sClassName = ::rtl::OUStringToOString(_par0, RTL_TEXTENCODING_JAVA_UTF8);
sClassName = sClassName.replace('.','/');
- out = t.pEnv->FindClass(sClassName);
+ out = t.pEnv->FindClass(sClassName.getStr());
ThrowSQLException(t.pEnv,0);
} //t.pEnv
// WARNING: the caller becomes the owner of the returned pointer
commit a060fcaf265dff0e3fa4aaf7031aa415fc967ce4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 14:59:25 2011 +0000
pointless to go from char* to OString to char*
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index c601923..c028ca1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -195,12 +195,10 @@ ResMgr* Desktop::GetDesktopResManager()
{
if ( !Desktop::pResMgr )
{
- String aMgrName = String::CreateFromAscii( "dkt" );
-
// Create desktop resource manager and bootstrap process
// was successful. Use default way to get language specific message.
if ( Application::IsInExecute() )
- Desktop::pResMgr = ResMgr::CreateResMgr( U2S( aMgrName ));
+ Desktop::pResMgr = ResMgr::CreateResMgr("dkt");
if ( !Desktop::pResMgr )
{
@@ -215,7 +213,7 @@ ResMgr* Desktop::GetDesktopResManager()
::com::sun::star::lang::Locale aLocale( aLanguage, aCountry, aVariant );
- Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale);
+ Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLocale);
AllSettings as = GetSettings();
as.SetUILocale(aLocale);
SetSettings(as);
@@ -1606,13 +1604,11 @@ int Desktop::Main()
// create title string
sal_Bool bCheckOk = sal_False;
::com::sun::star::lang::Locale aLocale;
- String aMgrName = String::CreateFromAscii( "iso" );
- ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale );
+ ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( "iso", aLocale );
if ( !pLabelResMgr )
{
// no "iso" resource -> search for "ooo" resource
- aMgrName = String::CreateFromAscii( "ooo" );
- pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale);
+ pLabelResMgr = ResMgr::SearchCreateResMgr( "ooo", aLocale);
}
String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
delete pLabelResMgr;
diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx
index 5ac542d..d76c0cd 100644
--- a/formula/source/ui/resource/ModuleHelper.cxx
+++ b/formula/source/ui/resource/ModuleHelper.cxx
@@ -90,8 +90,7 @@ ResMgr* OModuleImpl::getResManager()
if (!m_pRessources)
{
// create a manager with a fixed prefix
- rtl::OString sName = rtl::OString( "forui" );
- m_pRessources = ResMgr::CreateResMgr(sName);
+ m_pRessources = ResMgr::CreateResMgr("forui");
}
return m_pRessources;
}
commit 673c932eebfe959ddf2629904398e73b2c2b6542
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 14:57:59 2011 +0000
avoid implicit cast
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 6c3dc16..2379558 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -285,7 +285,7 @@ namespace connectivity
{
::rtl::OString sClassName = ::rtl::OUStringToOString(_sClassName, RTL_TEXTENCODING_ASCII_US);
sClassName = sClassName.replace('.','/');
- jobject out = pEnv->FindClass(sClassName);
+ jobject out = pEnv->FindClass(sClassName.getStr());
bRet = out != NULL;
pEnv->DeleteLocalRef( out );
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index e7b0615..ba32a91 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1582,7 +1582,7 @@ OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
SQLNodeType eNewNodeType,
sal_uInt32 nNewNodeID)
:m_pParent(NULL)
- ,m_aNodeValue(_rNewValue,_rNewValue.getLength(),RTL_TEXTENCODING_UTF8)
+ ,m_aNodeValue(rtl::OStringToOUString(_rNewValue,RTL_TEXTENCODING_UTF8))
,m_eNodeType(eNewNodeType)
,m_nNodeID(nNewNodeID)
{
@@ -2471,7 +2471,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
rString.appendAscii(" ");
const ::rtl::OString sT = OSQLParser::TokenIDToStr(m_nNodeID, &rParam.m_rContext);
- rString.append(::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8));
+ rString.append(::rtl::OStringToOUString(sT,RTL_TEXTENCODING_UTF8));
} break;
case SQL_NODE_STRING:
if (rString.getLength())
@@ -2556,7 +2556,7 @@ void OSQLParseNode::parseLeaf(::rtl::OUStringBuffer& rString, const SQLParseNode
sal_Int32 OSQLParser::getFunctionReturnType(const ::rtl::OUString& _sFunctionName, const IParseContext* pContext)
{
sal_Int32 nType = DataType::VARCHAR;
- ::rtl::OString sFunctionName(_sFunctionName,_sFunctionName.getLength(),RTL_TEXTENCODING_UTF8);
+ ::rtl::OString sFunctionName(::rtl::OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) nType = DataType::INTEGER;
else if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_BIT_LENGTH,pContext))) nType = DataType::INTEGER;
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index f30ec61..eeb5025 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -599,7 +599,7 @@ void XMLConfigItemContext::Characters( const ::rtl::OUString& rChars )
if( sTrimmedChars.getLength() )
{
rtl::OUString sChars;
- if( msValue )
+ if( msValue.getLength() )
{
sChars = msValue;
sChars += sTrimmedChars;
diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx
index a06a660..a32b1e8 100644
--- a/xmloff/source/core/XMLBase64ImportContext.cxx
+++ b/xmloff/source/core/XMLBase64ImportContext.cxx
@@ -70,7 +70,7 @@ void XMLBase64ImportContext::Characters( const ::rtl::OUString& rChars )
if( sTrimmedChars.getLength() )
{
OUString sChars;
- if( sBase64CharsLeft )
+ if( sBase64CharsLeft.getLength() )
{
sChars = sBase64CharsLeft;
sChars += sTrimmedChars;
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 0d29c66..8d00493 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1276,7 +1276,7 @@ void SdXMLStylesContext::EndElement()
//
void SdXMLStylesContext::SetMasterPageStyles(SdXMLMasterPageContext& rMaster) const
{
- UniString sPrefix(rMaster.GetDisplayName(), (sal_uInt16)rMaster.GetDisplayName().getLength());
+ UniString sPrefix(rMaster.GetDisplayName());
sPrefix += sal_Unicode('-');
if(GetSdImport().GetLocalDocStyleFamilies().is() && GetSdImport().GetLocalDocStyleFamilies()->hasByName(rMaster.GetDisplayName())) try
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index b8798e7..892c080 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1207,7 +1207,7 @@ void XMLTextFrameContext_Impl::Characters( const OUString& rChars )
if( bOwnBase64Stream && xBase64Stream.is() )
{
OUString sChars;
- if( sBase64CharsLeft )
+ if( sBase64CharsLeft.getLength() )
{
sChars = sBase64CharsLeft;
sChars += sTrimmedChars;
commit 8ca6fe608822d780e4e9eb5280568d4591f7e1af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:25:12 2011 +0000
avoid implicit casting
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
index 6e4d758..42517f5 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx
@@ -39,7 +39,7 @@ using namespace connectivity::mozab;
void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &nss)
{
// Convert to ::rtl::OString (utf-8 encoding).
- ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_UTF8);
+ ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8));
const char *cs = os.getStr();
PRUint32 csLen = os.getLength();
@@ -100,7 +100,7 @@ void MTypeConverter::prUnicharToOUString(PRUnichar const *pru, ::rtl::OUString &
char *MTypeConverter::ouStringToCCharStringUtf8(::rtl::OUString const &ous)
{
// Convert to ::rtl::OString,
- ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_UTF8);
+ ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8));
const char *cs = os.getStr();
@@ -110,7 +110,7 @@ char *MTypeConverter::ouStringToCCharStringUtf8(::rtl::OUString const &ous)
char *MTypeConverter::ouStringToCCharStringAscii(::rtl::OUString const &ous)
{
// Convert ::rtl::OUString to ::rtl::OString,
- ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_ASCII_US);
+ ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_ASCII_US));
return(strdup(os.getStr()));
}
@@ -126,7 +126,7 @@ char *MTypeConverter::nsStringToCCharStringAscii(nsString const &nss)
::std::string MTypeConverter::ouStringToStlString(::rtl::OUString const &ous)
{
// Convert ::rtl::OUString to ::rtl::OString.
- ::rtl::OString os(ous,ous.getLength(),RTL_TEXTENCODING_ASCII_US);
+ ::rtl::OString os(rtl::OUStringToOString(ous,RTL_TEXTENCODING_ASCII_US));
return( ::std::string(os.getStr()));
}
// -------------------------------------------------------------------------
commit 44447f718d95d002815eb6f176692132f077770f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:23:42 2011 +0000
found an implicit casting bug
diff --git a/connectivity/source/drivers/adabas/BConnection.cxx b/connectivity/source/drivers/adabas/BConnection.cxx
index 74e7cca..9aae673 100644
--- a/connectivity/source/drivers/adabas/BConnection.cxx
+++ b/connectivity/source/drivers/adabas/BConnection.cxx
@@ -112,7 +112,7 @@ SQLRETURN OAdabasConnection::Construct( const ::rtl::OUString& url,const Sequenc
m_sUser = aUID;
if ( sHostName.getLength() )
- aDSN = sHostName + ':' + aDSN;
+ aDSN = sHostName + rtl::OUString(static_cast<sal_Unicode>(':')) + aDSN;
SQLRETURN nSQLRETURN = openConnectionWithAuth(aDSN,nTimeout, aUID,aPWD);
return nSQLRETURN;
commit b0970e0209cd0c71c6cd537aedc8da8400bef656
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:21:11 2011 +0000
avoid implicit casting
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index f992da4..b6b6673 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -945,7 +945,7 @@ void FmFilterModel::SetTextForItem(FmFilterItem* pItem, const ::rtl::OUString& r
m_pAdapter->setText(nParentPos, pItem, rText);
- if (!rText)
+ if (rText.isEmpty())
Remove(pItem);
else
{
commit 5abed4b1538490bf3f0419c26f3a4296d5642cdd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:20:57 2011 +0000
Pointless to convert char* to OString and back
diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx
index b2d0ba3..0b3c259 100644
--- a/svx/source/dialog/dialmgr.cxx
+++ b/svx/source/dialog/dialmgr.cxx
@@ -46,10 +46,7 @@ static ResMgr* pResMgr=0;
ResMgr* DialogsResMgr::GetResMgr()
{
if ( !pResMgr )
- {
- ByteString aName( "svx" );
- pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), Application::GetSettings().GetUILocale() );
- }
+ pResMgr = ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILocale() );
return pResMgr;
}
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 345df16..cd7f295 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -810,10 +810,8 @@ namespace svxform
{
// create a resource manager, for the svx resource file
// and the UI locale
- ByteString aResourceFile( "svx" );
ResMgr* pResMgr = ResMgr::CreateResMgr(
- aResourceFile.GetBuffer(),
- Application::GetSettings().GetUILocale() );
+ "svx", Application::GetSettings().GetUILocale() );
// load the resources for the AddSubmission modal dialog.
// This will create our own resource context.
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index d431707..37f402a 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -76,9 +76,8 @@ ResMgr* GetGalleryResMgr()
if( !pGalleryResMgr )
{
- ByteString aResMgrName( "gal" );
pGalleryResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+ "gal", Application::GetSettings().GetUILocale() );
}
return pGalleryResMgr;
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 5acd912..672319c 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -671,9 +671,8 @@ ResMgr* ImpGetResMgr()
if(!rGlobalData.pResMgr)
{
- ByteString aName("svx");
rGlobalData.pResMgr =
- ResMgr::CreateResMgr( aName.GetBuffer(), Application::GetSettings().GetUILocale() );
+ ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILocale() );
}
return rGlobalData.pResMgr;
commit bdf245c0685427c53c2f515524b33b3d9036384a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:18:52 2011 +0000
avoid implicit casting
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 49f887d..a41ef4f 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -108,12 +108,11 @@ static void createTheme( rtl::OUString aThemeName,
if (!pGallery ) {
fprintf( stderr, "Could't acquire '%s'\n",
- (const sal_Char *) rtl::OUStringToOString( aGalleryURL,
- RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString(aGalleryURL, RTL_TEXTENCODING_UTF8).getStr() );
exit( 1 );
}
fprintf( stderr, "Work on gallery '%s'\n",
- (const sal_Char *) rtl::OUStringToOString( aGalleryURL, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString(aGalleryURL, RTL_TEXTENCODING_UTF8).getStr() );
fprintf( stderr, "Existing themes: %lu\n",
sal::static_int_cast< unsigned long >(
@@ -141,7 +140,7 @@ static void createTheme( rtl::OUString aThemeName,
}
fprintf( stderr, "Using DestDir: %s\n",
- (const sal_Char *) rtl::OUStringToOString( aDestDir, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString(aDestDir, RTL_TEXTENCODING_UTF8).getStr() );
pGalTheme->SetDestDir(String(aDestDir));
FileNameList::const_iterator aIter;
@@ -158,10 +157,10 @@ static void createTheme( rtl::OUString aThemeName,
#if 1
if ( ! pGalTheme->InsertURL( *aIter ) )
fprintf( stderr, "Failed to import '%s'\n",
- (const sal_Char *) rtl::OUStringToOString( *aIter, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString(*aIter, RTL_TEXTENCODING_UTF8).getStr() );
else
fprintf( stderr, "Imported file '%s' (%lu)\n",
- (const sal_Char *) rtl::OUStringToOString( *aIter, RTL_TEXTENCODING_UTF8 ),
+ rtl::OUStringToOString(*aIter, RTL_TEXTENCODING_UTF8).getStr(),
sal::static_int_cast< unsigned long >(
pGalTheme->GetObjectCount() ) );
commit 249bb484307162b384ac9b01cbd116dc4d6dc19d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:13:07 2011 +0000
found an implicit casting bug
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index a6f86b0..5ed4dea 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -134,7 +134,7 @@ uno::Reference<XAccessible>
if (nIndex < 0 || (unsigned long)nIndex >= maVisibleChildren.size())
throw lang::IndexOutOfBoundsException (
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "no accessible child with index ")) + nIndex,
+ "no accessible child with index ")) + ::rtl::OUString::valueOf(nIndex),
mxParent);
return GetChild (maVisibleChildren[nIndex],nIndex);
commit 838086f27cbf471e50236af097fc5cb187893b9e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:02:31 2011 +0000
overload match and avoid implicit cast
diff --git a/connectivity/inc/connectivity/CommonTools.hxx b/connectivity/inc/connectivity/CommonTools.hxx
index c17b4f3..494db79 100644
--- a/connectivity/inc/connectivity/CommonTools.hxx
+++ b/connectivity/inc/connectivity/CommonTools.hxx
@@ -54,6 +54,10 @@ namespace connectivity
{
//------------------------------------------------------------------------------
OOO_DLLPUBLIC_DBTOOLS sal_Bool match(const sal_Unicode* pWild, const sal_Unicode* pStr, const sal_Unicode cEscape);
+ inline sal_Bool match(const ::rtl::OUString &rWild, const ::rtl::OUString &rStr, const sal_Unicode cEscape)
+ {
+ return match(rWild.getStr(), rStr.getStr(), cEscape);
+ }
//------------------------------------------------------------------------------
OOO_DLLPUBLIC_DBTOOLS rtl::OUString toString(const ::com::sun::star::uno::Any& rValue);
OOO_DLLPUBLIC_DBTOOLS rtl::OUString toDateString(const ::com::sun::star::util::Date& rDate);
commit 8c076824d7b8888c6540e2607b7ca41ced6ae3ab
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 12:00:30 2011 +0000
don't rely on implicit casting
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 38e97a0..f59a420 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -233,7 +233,7 @@ executeQuery (EBook* pBook, EBookQuery* pQuery, GList **ppList,
{
rtl::OString aUser( getUserName( pBook ) );
const char *pAuth = e_source_get_property( pSource, "auth" );
- bAuthSuccess = e_book_authenticate_user( pBook, aUser, rPassword, pAuth, pError );
+ bAuthSuccess = e_book_authenticate_user( pBook, aUser.getStr(), rPassword.getStr(), pAuth, pError );
}
if (bAuthSuccess)
@@ -517,7 +517,7 @@ void OEvoabResultSet::construct( const QueryData& _rData )
{
ENSURE_OR_THROW( _rData.getQuery(), "internal error: no EBookQuery" );
- EBook *pBook = openBook( ::rtl::OUStringToOString( _rData.sTable, RTL_TEXTENCODING_UTF8 ) );
+ EBook *pBook = openBook(::rtl::OUStringToOString(_rData.sTable, RTL_TEXTENCODING_UTF8).getStr());
if ( !pBook )
m_pConnection->throwGenericSQLException( STR_CANNOT_OPEN_BOOK, *this );
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index d7467f5..a73a241 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -208,8 +208,8 @@ OCommonStatement::createTest( const ::rtl::OUString &aColumnName,
::rtl::OString sMatch = rtl::OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
::rtl::OString sColumnName = rtl::OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
- return e_book_query_field_test( e_contact_field_id( sColumnName ),
- eTest, sMatch );
+ return e_book_query_field_test( e_contact_field_id( sColumnName.getStr() ),
+ eTest, sMatch.getStr() );
}
// -------------------------------------------------------------------------
commit c1c4c50587fb63224aff807bcd275a93cd89d503
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 11:45:00 2011 +0000
don't rely on implicit casting
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 981809a..dc79b68 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -892,10 +892,10 @@ void ShutdownIcon::SetAutostart( bool bActivate )
osl_getThreadTextEncoding() );
OString aShortcutUnx = OUStringToOString( aShortcut,
osl_getThreadTextEncoding() );
- if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST))
+ if ((0 != symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr())) && (errno == EEXIST))
{
- unlink(aShortcutUnx);
- int ret = symlink(aDesktopFileUnx, aShortcutUnx);
+ unlink(aShortcutUnx.getStr());
+ int ret = symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr());
(void)ret; //deliberately ignore return value, it's non-critical if it fails
}
commit 53ad8de63efafd7d488024052464ad9dc51e6f7d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 11:44:20 2011 +0000
Pointless to convert char* to OString and back
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index ac5db39..3518412 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -539,8 +539,7 @@ short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool /*bAutoSave
ResMgr* SfxApplication::CreateResManager( const char *pPrefix )
{
- String aMgrName = String::CreateFromAscii( pPrefix );
- return ResMgr::CreateResMgr(U2S(aMgrName));
+ return ResMgr::CreateResMgr(pPrefix);
}
//---------------------------------------------------------------------
commit b3aaf47ae44d6789ac6d76383f314f18735c1903
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 11:23:50 2011 +0000
don't rely on implicit casting
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 2905f03..ed5ea02 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -817,7 +817,7 @@ void LayoutManager::implts_createCustomToolBar( const rtl::OUString& aTbxResName
if ( aTbxResName.getLength() > 0 )
{
createElement( aTbxResName );
- if ( aTitle )
+ if ( !aTitle.isEmpty() )
{
Reference< XUIElement > xUIElement = getElement( aTbxResName );
if ( xUIElement.is() )
commit fcc749b09d2460b8d7e44db57728bbc60adf4576
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 11:23:10 2011 +0000
Why bother creating a OString from a char* to cast back to a char*
diff --git a/framework/source/classes/fwkresid.cxx b/framework/source/classes/fwkresid.cxx
index 6db4836..edbc4fa 100644
--- a/framework/source/classes/fwkresid.cxx
+++ b/framework/source/classes/fwkresid.cxx
@@ -45,11 +45,8 @@ ResMgr* FwkResId::GetResManager()
if ( !pResMgr )
{
- rtl::OStringBuffer aBuf( 32 );
- aBuf.append( "fwe" );
-
SolarMutexGuard aSolarGuard;
- pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
+ pResMgr = ResMgr::CreateResMgr("fwe");
}
return pResMgr;
diff --git a/framework/source/classes/fwlresid.cxx b/framework/source/classes/fwlresid.cxx
index 99e6b6e..4a2ced6 100644
--- a/framework/source/classes/fwlresid.cxx
+++ b/framework/source/classes/fwlresid.cxx
@@ -45,11 +45,8 @@ ResMgr* FwlResId::GetResManager()
if ( !pResMgr )
{
- rtl::OStringBuffer aBuf( 32 );
- aBuf.append( "fwe" );
-
SolarMutexGuard aSolarGuard;
- pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
+ pResMgr = ResMgr::CreateResMgr("fwe");
}
return pResMgr;
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index 03bc99b..1b3d78c 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -268,10 +268,9 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
// determine the filename of the license to show
::rtl::OUString aLangString;
::com::sun::star::lang::Locale aLocale;
- ::rtl::OString aMgrName = ::rtl::OString("fwe");
AllSettings aSettings(Application::GetSettings());
aLocale = aSettings.GetUILocale();
- ResMgr* pResMgr = ResMgr::SearchCreateResMgr(aMgrName, aLocale);
+ ResMgr* pResMgr = ResMgr::SearchCreateResMgr("fwe", aLocale);
aLangString = aLocale.Language;
if ( aLocale.Country.getLength() != 0 )
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 8ad9e98..556414c 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -230,9 +230,7 @@ ControlMenuController::~ControlMenuController()
// private function
void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
{
- rtl::OUString aResName( RTL_CONSTASCII_USTRINGPARAM( "svx" ));
-
- ResMgr* pResMgr = ResMgr::CreateResMgr( rtl::OUStringToOString( aResName, RTL_TEXTENCODING_ASCII_US ));
+ ResMgr* pResMgr = ResMgr::CreateResMgr("svx");
ResId aResId( RID_SVXIMGLIST_FMEXPL, *pResMgr );
aResId.SetRT( RSC_IMAGELIST );
@@ -383,10 +381,7 @@ void ControlMenuController::impl_setPopupMenu()
{
if ( m_pResPopupMenu == 0 )
{
- rtl::OStringBuffer aBuf( 32 );
- aBuf.append( "svx" );
-
- ResMgr* pResMgr = ResMgr::CreateResMgr( aBuf.getStr() );
+ ResMgr* pResMgr = ResMgr::CreateResMgr("svx");
if ( pResMgr )
{
ResId aResId( RID_FMSHELL_CONVERSIONMENU, *pResMgr );
commit 45615cda780055d65e69924bfded005288c0f1af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Mar 1 11:15:46 2011 +0000
don't rely on implicit casting
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index e91d5d2..0e355e6 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -488,7 +488,7 @@ shrinkFilterName( const rtl::OUString &rFilterName, bool bAllowNoStar = false )
int i;
int nBracketLen = -1;
int nBracketEnd = -1;
- const sal_Unicode *pStr = rFilterName;
+ const sal_Unicode *pStr = rFilterName.getStr();
OUString aRealName = rFilterName;
for( i = aRealName.getLength() - 1; i > 0; i-- )
@@ -1891,7 +1891,7 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O
OUString aShrunkName = shrinkFilterName( rFilter );
OString aFilterName = rtl::OUStringToOString( aShrunkName, RTL_TEXTENCODING_UTF8 );
- gtk_file_filter_set_name( filter, aFilterName );
+ gtk_file_filter_set_name( filter, aFilterName.getStr() );
static const OUString aStarDot(RTL_CONSTASCII_USTRINGPARAM( "*." ));
OUString aTokens;
@@ -1915,7 +1915,7 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O
aTokens = aTokens += aToken;
gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_URI,
case_insensitive_filter,
- g_strdup( rtl::OUStringToOString( aToken, RTL_TEXTENCODING_UTF8 ) ),
+ g_strdup( rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() ),
(GDestroyNotify) g_free );
OSL_TRACE( "fustering with %s\n", rtl::OUStringToOString( aToken, RTL_TEXTENCODING_UTF8 ).getStr());
More information about the Libreoffice-commits
mailing list