Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/1572
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/72/1572/1
Remove some RTL_* macros, rtl:: prefixes and simplification in dbaccess
Change-Id: I2a4381cbe1e716cd2de1fb596053646d1a74d4b0
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmai.com>
---
M dbaccess/source/ui/querydesign/querycontroller.cxx
M dbaccess/source/ui/uno/copytablewizard.cxx
M dbaccess/source/ui/uno/unosqlmessage.cxx
3 files changed, 142 insertions(+), 173 deletions(-)
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx
b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 22109df..d56b51b 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -100,12 +100,12 @@
class OViewController : public OQueryController
{
//------------------------------------------------------------------------------
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw( RuntimeException )
+ virtual OUString SAL_CALL getImplementationName() throw( RuntimeException )
{
return getImplementationName_Static();
}
//-------------------------------------------------------------------------
- virtual Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames()
throw(RuntimeException)
+ virtual Sequence< OUString> SAL_CALL getSupportedServiceNames() throw(RuntimeException)
{
return getSupportedServiceNames_Static();
}
@@ -113,14 +113,14 @@
OViewController(const Reference< XMultiServiceFactory >& _rM) : OQueryController(_rM){}
// need by registration
- static ::rtl::OUString getImplementationName_Static() throw( RuntimeException )
+ static OUString getImplementationName_Static() throw( RuntimeException )
{
- return
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OViewDesign"));
+ return OUString("org.openoffice.comp.dbu.OViewDesign");
}
- static Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw(
RuntimeException )
+ static Sequence< OUString > getSupportedServiceNames_Static(void) throw( RuntimeException )
{
- Sequence< ::rtl::OUString> aSupported(1);
- aSupported.getArray()[0] =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ViewDesign"));
+ Sequence< OUString> aSupported(1);
+ aSupported.getArray()[0] = "com.sun.star.sdb.ViewDesign";
return aSupported;
}
static Reference< XInterface > SAL_CALL Create(const Reference< XMultiServiceFactory >&
_rM)
@@ -143,15 +143,12 @@
// -----------------------------------------------------------------------------
void insertParseTree(SvTreeListBox* _pBox,::connectivity::OSQLParseNode*
_pNode,SvTreeListEntry* _pParent = NULL)
{
- ::rtl::OUString rString;
+ OUString rString;
if (!_pNode->isToken())
{
// Regelnamen als rule: ...
- rString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RULE_ID: "));
- rString += ::rtl::OUString::valueOf( (sal_Int32)_pNode->getRuleID());
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("("));
- rString += OSQLParser::RuleIDToStr(_pNode->getRuleID());
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
+ rString = "RULE_ID: " + OUString::valueOf( (sal_Int32)_pNode->getRuleID() ) +
+ "(" + OSQLParser::RuleIDToStr(_pNode->getRuleID()) + ")";
_pParent = _pBox->InsertEntry(rString,_pParent);
@@ -172,54 +169,45 @@
case SQL_NODE_KEYWORD:
{
- rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_KEYWORD:"));
- ::rtl::OString sT = OSQLParser::TokenIDToStr(_pNode->getTokenID());
- rString += ::rtl::OStringToOUString(sT, RTL_TEXTENCODING_UTF8);
+ rString += "SQL_KEYWORD:";
+ OString sT = OSQLParser::TokenIDToStr(_pNode->getTokenID());
+ rString += OStringToOUString(sT, RTL_TEXTENCODING_UTF8);
break;}
case SQL_NODE_COMPARISON:
{
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_COMPARISON:"));
- rString += _pNode->getTokenValue(); // haenge Nodevalue an
+ rString += "SQL_COMPARISON:" + _pNode->getTokenValue(); // haenge
Nodevalue an
// und beginne neu Zeile
break;}
case SQL_NODE_NAME:
{
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_NAME:"));
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
- rString += _pNode->getTokenValue();
- rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
+ rString += "SQL_NAME:" + "\"" + _pNode->getTokenValue() + "\"";
break;}
case SQL_NODE_STRING:
{
- rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_STRING:'"));
- rString += _pNode->getTokenValue();
+ rString += "SQL_STRING:'" + _pNode->getTokenValue();
break;}
case SQL_NODE_INTNUM:
{
- rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_INTNUM:"));
- rString += _pNode->getTokenValue();
+ rString += "SQL_INTNUM:" + _pNode->getTokenValue();
break;}
case SQL_NODE_APPROXNUM:
{
- rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_APPROXNUM:"));
- rString += _pNode->getTokenValue();
+ rString += "SQL_APPROXNUM:" + _pNode->getTokenValue();
break;}
case SQL_NODE_PUNCTUATION:
{
- rString +=
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_PUNCTUATION:"));
- rString += _pNode->getTokenValue(); // haenge Nodevalue an
+ rString += "SQL_PUNCTUATION:" + _pNode->getTokenValue(); // haenge
Nodevalue an
break;}
case SQL_NODE_AMMSC:
{
- rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_AMMSC:"));
- rString += _pNode->getTokenValue(); // haenge Nodevalue an
+ rString += "SQL_AMMSC:" + _pNode->getTokenValue(); // haenge Nodevalue an
break;}
default:
@@ -272,8 +260,8 @@
if ( xLayoutManager.is() )
{
xLayoutManager->lock();
- static ::rtl::OUString
s_sDesignToolbar(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/designobjectbar"));
- static ::rtl::OUString
s_sSqlToolbar(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/sqlobjectbar"));
+ static OUString s_sDesignToolbar("private:resource/toolbar/designobjectbar");
+ static OUString s_sSqlToolbar("private:resource/toolbar/sqlobjectbar");
if ( _bDesign )
{
xLayoutManager->destroyElement( s_sSqlToolbar );
@@ -291,25 +279,25 @@
}
//------------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OQueryController::getImplementationName() throw( RuntimeException )
+OUString SAL_CALL OQueryController::getImplementationName() throw( RuntimeException )
{
return getImplementationName_Static();
}
//------------------------------------------------------------------------------
-::rtl::OUString OQueryController::getImplementationName_Static() throw( RuntimeException )
+OUString OQueryController::getImplementationName_Static() throw( RuntimeException )
{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OQueryDesign"));
+ return OUString("org.openoffice.comp.dbu.OQueryDesign");
}
//------------------------------------------------------------------------------
-Sequence< ::rtl::OUString> OQueryController::getSupportedServiceNames_Static(void) throw(
RuntimeException )
+Sequence< OUString> OQueryController::getSupportedServiceNames_Static(void) throw(
RuntimeException )
{
- Sequence< ::rtl::OUString> aSupported(1);
- aSupported.getArray()[0] =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.QueryDesign"));
+ Sequence< OUString> aSupported(1);
+ aSupported.getArray()[0] = "com.sun.star.sdb.QueryDesign";
return aSupported;
}
//-------------------------------------------------------------------------
-Sequence< ::rtl::OUString> SAL_CALL OQueryController::getSupportedServiceNames()
throw(RuntimeException)
+Sequence< OUString> SAL_CALL OQueryController::getSupportedServiceNames() throw(RuntimeException)
{
return getSupportedServiceNames_Static();
}
@@ -389,7 +377,7 @@
{
::comphelper::NamedValueCollection aCurrentDesign;
aCurrentDesign.put( "GraphicalDesign", isGraphicalDesign() );
- aCurrentDesign.put( (::rtl::OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
+ aCurrentDesign.put( (OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
if ( isGraphicalDesign() )
{
@@ -428,7 +416,7 @@
const sal_Int32 nLength = aProps.getLength();
aProps.realloc( nLength + 1 );
aProps[ nLength ] = Property(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CurrentQueryDesign" ) ),
+ "CurrentQueryDesign",
PROPERTY_ID_CURRENT_QUERY_DESIGN,
::cppu::UnoType< Sequence< PropertyValue > >::get(),
PropertyAttribute::READONLY
@@ -600,7 +588,7 @@
SQLExceptionInfo aError;
try
{
- ::rtl::OUString aErrorMsg;
+ OUString aErrorMsg;
setStatement_fireEvent( getContainer()->getStatement() );
if(m_sStatement.isEmpty() && m_pSqlIterator)
{
@@ -631,7 +619,7 @@
aError = SQLException(
String( ModuleRes( STR_QRY_NOSELECT ) ),
NULL,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) ),
+ "S1000",
1000,
Any()
);
@@ -640,7 +628,7 @@
{
// change the view of the data
m_bGraphicalDesign = !m_bGraphicalDesign;
- ::rtl::OUString sNewStatement;
+ OUString sNewStatement;
pNode->parseNodeToStr( sNewStatement, getConnection() );
setStatement_fireEvent( sNewStatement );
getContainer()->SaveUIConfig();
@@ -654,7 +642,7 @@
aError = SQLException(
String( ModuleRes( STR_QRY_SYNTAX ) ),
NULL,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "S1000" ) ),
+ "S1000",
1000,
Any()
);
@@ -686,7 +674,7 @@
getContainer()->clear();
GetUndoManager().LeaveListAction();
- setStatement_fireEvent( ::rtl::OUString() );
+ setStatement_fireEvent( OUString() );
if(m_bGraphicalDesign)
InvalidateFeature(ID_BROWSER_ADDTABLE);
}
@@ -739,7 +727,7 @@
case ID_EDIT_QUERY_DESIGN:
case ID_EDIT_QUERY_SQL:
{
- ::rtl::OUString aErrorMsg;
+ OUString aErrorMsg;
setStatement_fireEvent( getContainer()->getStatement() );
::connectivity::OSQLParseNode* pNode = m_aSqlParser.parseTree( aErrorMsg,
m_sStatement, m_bGraphicalDesign );
if ( pNode )
@@ -770,7 +758,7 @@
OSQLParseNode::compress(pNodeTmp);
pNodeTmp = pTemp->getChild(1);
}
- ::rtl::OUString sTemp;
+ OUString sTemp;
pNode->parseNodeToStr(sTemp,getConnection());
getContainer()->setStatement(sTemp);
}
@@ -843,14 +831,14 @@
const NamedValueCollection& rArguments( getInitParams() );
- ::rtl::OUString sCommand;
+ OUString sCommand;
m_nCommandType = CommandType::QUERY;
//
�����������������������������������������������������������������������������������������������������������������
// � reading parameters
//
�����������������������������������������������������������������������������������������������������������������
// legacy parameters first (later overwritten by regular parameters)
- ::rtl::OUString sIndependentSQLCommand;
+ OUString sIndependentSQLCommand;
if ( rArguments.get_ensureType( "IndependentSQLCommand", sIndependentSQLCommand ) )
{
OSL_FAIL( "OQueryController::impl_initialize: IndependentSQLCommand is regognized for
compatibility only!" );
@@ -858,7 +846,7 @@
m_nCommandType = CommandType::COMMAND;
}
- ::rtl::OUString sCurrentQuery;
+ OUString sCurrentQuery;
if ( rArguments.get_ensureType( "CurrentQuery", sCurrentQuery ) )
{
OSL_FAIL( "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility
only!" );
@@ -874,8 +862,8 @@
}
// non-legacy parameters which overwrite the legacy parameters
- rArguments.get_ensureType( (::rtl::OUString)PROPERTY_COMMAND, sCommand );
- rArguments.get_ensureType( (::rtl::OUString)PROPERTY_COMMAND_TYPE, m_nCommandType );
+ rArguments.get_ensureType( (OUString)PROPERTY_COMMAND, sCommand );
+ rArguments.get_ensureType( (OUString)PROPERTY_COMMAND_TYPE, m_nCommandType );
// translate Command/Type into proper members
// TODO/Later: all this (including those members) should be hidden behind some abstact
interface,
@@ -890,7 +878,7 @@
break;
case CommandType::COMMAND:
setStatement_fireEvent( sCommand );
- m_sName = ::rtl::OUString();
+ m_sName = OUString();
break;
default:
OSL_FAIL( "OQueryController::impl_initialize: logic error in code!" );
@@ -899,17 +887,17 @@
// more legacy parameters
sal_Bool bGraphicalDesign( sal_True );
- if ( rArguments.get_ensureType( (::rtl::OUString)PROPERTY_QUERYDESIGNVIEW, bGraphicalDesign ) )
+ if ( rArguments.get_ensureType( (OUString)PROPERTY_QUERYDESIGNVIEW, bGraphicalDesign ) )
{
OSL_FAIL( "OQueryController::impl_initialize: QueryDesignView is regognized for
compatibility only!" );
m_bGraphicalDesign = bGraphicalDesign;
}
// more non-legacy
- rArguments.get_ensureType( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
+ rArguments.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
bool bEscapeProcessing( sal_True );
- if ( rArguments.get_ensureType( (::rtl::OUString)PROPERTY_ESCAPE_PROCESSING, bEscapeProcessing
) )
+ if ( rArguments.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, bEscapeProcessing ) )
{
setEscapeProcessing_fireEvent( bEscapeProcessing );
@@ -927,17 +915,17 @@
if ( aCurrentQueryDesignProps.getLength() )
{
::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps );
- if ( aCurrentQueryDesign.has( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN ) )
+ if ( aCurrentQueryDesign.has( (OUString)PROPERTY_GRAPHICAL_DESIGN ) )
{
- aCurrentQueryDesign.get_ensureType( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN,
m_bGraphicalDesign );
+ aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN,
m_bGraphicalDesign );
}
- if ( aCurrentQueryDesign.has( (::rtl::OUString)PROPERTY_ESCAPE_PROCESSING ) )
+ if ( aCurrentQueryDesign.has( (OUString)PROPERTY_ESCAPE_PROCESSING ) )
{
- aCurrentQueryDesign.get_ensureType( (::rtl::OUString)PROPERTY_ESCAPE_PROCESSING,
m_bEscapeProcessing );
+ aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING,
m_bEscapeProcessing );
}
if ( aCurrentQueryDesign.has( "Statement" ) )
{
- ::rtl::OUString sStatement;
+ OUString sStatement;
aCurrentQueryDesign.get_ensureType( "Statement", sStatement );
aCurrentQueryDesign.remove( "Statement" );
setStatement_fireEvent( sStatement );
@@ -990,7 +978,7 @@
if ( !( aView >>= m_xAlterView ) )
{
throw IllegalArgumentException(
- ::rtl::OUString( String( ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ) ) ),
+ OUString( String( ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ) ) ),
*this,
1
);
@@ -1061,9 +1049,9 @@
}
// -----------------------------------------------------------------------------
-::rtl::OUString OQueryController::getPrivateTitle( ) const
+OUString OQueryController::getPrivateTitle( ) const
{
- ::rtl::OUString sName = m_sName;
+ OUString sName = m_sName;
if ( sName.isEmpty() )
{
if ( !editingCommand() )
@@ -1072,7 +1060,7 @@
::osl::MutexGuard aGuard( getMutex() );
String aDefaultName = String( ModuleRes( editingView() ? STR_VIEW_TITLE :
STR_QRY_TITLE ) );
sName = aDefaultName.GetToken(0,' ');
- sName += ::rtl::OUString::valueOf(getCurrentStartNumber());
+ sName += OUString::valueOf(getCurrentStartNumber());
}
}
return sName;
@@ -1207,7 +1195,7 @@
aFieldData.clear();
(*field)->Save( aFieldData, i_includingCriteria );
- const ::rtl::OUString sFieldSettingName = ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "Field" ) ) + ::rtl::OUString::valueOf( i );
+ const OUString sFieldSettingName = "Field" + OUString::valueOf( i );
aAllFieldsData.put( sFieldSettingName, aFieldData.getPropertyValues() );
}
}
@@ -1268,9 +1256,9 @@
{
// we don't need to check the connection here because we already check the composer
// which can't live without his connection
- ::rtl::OUString sTranslatedStmt = translateStatement( false );
+ OUString sTranslatedStmt = translateStatement( false );
- ::rtl::OUString sDataSourceName = getDataSourceName();
+ OUString sDataSourceName = getDataSourceName();
if ( !(sDataSourceName.isEmpty() || sTranslatedStmt.isEmpty()) )
{
try
@@ -1279,9 +1267,9 @@
InvalidateFeature(SID_DB_QUERY_PREVIEW);
URL aWantToDispatch;
- aWantToDispatch.Complete =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB/DataSourceBrowser"));
+ aWantToDispatch.Complete = ".component:DB/DataSourceBrowser";
- ::rtl::OUString sFrameName( FRAME_NAME_QUERY_PREVIEW );
+ OUString sFrameName( FRAME_NAME_QUERY_PREVIEW );
sal_Int32 nSearchFlags = FrameSearchFlag::CHILDREN;
Reference< XDispatch> xDisp;
@@ -1415,7 +1403,7 @@
if ( !getContainer()->checkStatement() )
return false;
- ::rtl::OUString sTranslatedStmt = translateStatement();
+ OUString sTranslatedStmt = translateStatement();
if ( editingCommand() )
{
setModified( sal_False );
@@ -1429,7 +1417,7 @@
// first we need a name for our query so ask the user
// did we get a name
- ::rtl::OUString sOriginalName( m_sName );
+ OUString sOriginalName( m_sName );
if ( !askForNewName( xElements, _bSaveAs ) || m_sName.isEmpty() )
return false;
@@ -1584,9 +1572,9 @@
namespace {
struct CommentStrip
{
- ::rtl::OUString maComment;
+ OUString maComment;
bool mbLastOnLine;
- CommentStrip( const ::rtl::OUString& rComment, bool bLastOnLine )
+ CommentStrip( const OUString& rComment, bool bLastOnLine )
: maComment( rComment), mbLastOnLine( bLastOnLine) {}
};
}
@@ -1595,7 +1583,7 @@
See also delComment() implementation for OSQLParser::parseTree().
*/
-static ::std::vector< CommentStrip > getComment( const ::rtl::OUString& rQuery )
+static ::std::vector< CommentStrip > getComment( const OUString& rQuery )
{
::std::vector< CommentStrip > aRet;
// First a quick search if there is any "--" or "//" or "/*", if not then
@@ -1610,7 +1598,7 @@
bool bIsText2 = false; // 'text'
bool bComment2 = false; // /* comment */
bool bComment = false; // -- or // comment
- ::rtl::OUStringBuffer aBuf;
+ OUStringBuffer aBuf;
for (sal_Int32 i=0; i < nQueryLen; ++i)
{
if (bComment2)
@@ -1673,7 +1661,7 @@
recomposition. This is ugly but at least allows commented queries while
preserving the comments _somehow_.
*/
-static ::rtl::OUString concatComment( const ::rtl::OUString& rQuery, const ::std::vector<
CommentStrip >& rComments )
+static OUString concatComment( const OUString& rQuery, const ::std::vector< CommentStrip >&
rComments )
{
// No comments => return query.
if (rComments.empty())
@@ -1687,7 +1675,7 @@
sal_Int32 nBufSize = nLen + nComments;
for (::std::vector< CommentStrip >::const_iterator it( rComments.begin()); it !=
rComments.end(); ++it)
nBufSize += (*it).maComment.getLength();
- ::rtl::OUStringBuffer aBuf( nBufSize );
+ OUStringBuffer aBuf( nBufSize );
sal_Int32 nIndBeg = 0;
sal_Int32 nIndLF = rQuery.indexOf('\n');
size_t i = 0;
@@ -1723,16 +1711,16 @@
return aBuf.makeStringAndClear();
}
// -----------------------------------------------------------------------------
-::rtl::OUString OQueryController::translateStatement( bool _bFireStatementChange )
+OUString OQueryController::translateStatement( bool _bFireStatementChange )
{
// now set the properties
setStatement_fireEvent( getContainer()->getStatement(), _bFireStatementChange );
- ::rtl::OUString sTranslatedStmt;
+ OUString sTranslatedStmt;
if(!m_sStatement.isEmpty() && m_xComposer.is() && m_bEscapeProcessing)
{
try
{
- ::rtl::OUString aErrorMsg;
+ OUString aErrorMsg;
::std::vector< CommentStrip > aComments = getComment( m_sStatement);
@@ -1752,15 +1740,15 @@
::dbtools::SQLExceptionInfo aInfo(e);
showError(aInfo);
// an error occurred so we clear the statement
- sTranslatedStmt = ::rtl::OUString();
+ sTranslatedStmt = OUString();
}
}
else if(m_sStatement.isEmpty())
{
ModuleRes aModuleRes(STR_QRY_NOSELECT);
String sTmpStr(aModuleRes);
- ::rtl::OUString sError(sTmpStr);
- showError(SQLException(sError,NULL,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")
),1000,Any()));
+ OUString sError(sTmpStr);
+ showError(SQLException(sError,NULL,"S1000",1000,Any()));
}
else
sTranslatedStmt = m_sStatement;
@@ -1812,7 +1800,7 @@
Reference< XPropertySet > xProp;
if( xQueries->hasByName( m_sName ) && ( xQueries->getByName( m_sName ) >>= xProp )
&& xProp.is() )
{
- ::rtl::OUString sNewStatement;
+ OUString sNewStatement;
xProp->getPropertyValue( PROPERTY_COMMAND ) >>= sNewStatement;
setStatement_fireEvent( sNewStatement );
@@ -1872,7 +1860,7 @@
}
else if ( m_bEscapeProcessing )
{
- ::rtl::OUString aErrorMsg;
+ OUString aErrorMsg;
::std::auto_ptr< ::connectivity::OSQLParseNode > pNode(
m_aSqlParser.parseTree( aErrorMsg, m_sStatement, m_bGraphicalDesign ) );
@@ -1928,7 +1916,7 @@
}
// -----------------------------------------------------------------------------
-void OQueryController::setStatement_fireEvent( const ::rtl::OUString& _rNewStatement, bool
_bFireStatementChange )
+void OQueryController::setStatement_fireEvent( const OUString& _rNewStatement, bool
_bFireStatementChange )
{
Any aOldValue = makeAny( m_sStatement );
m_sStatement = _rNewStatement;
@@ -1974,7 +1962,7 @@
return false;
const NamedValueCollection& rArguments( getInitParams() );
- sal_Int32 nCommandType = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_COMMAND_TYPE,
(sal_Int32)CommandType::QUERY );
+ sal_Int32 nCommandType = rArguments.getOrDefault( (OUString)PROPERTY_COMMAND_TYPE,
(sal_Int32)CommandType::QUERY );
sal_Bool bCreatingView = ( nCommandType == CommandType::TABLE );
return !bCreatingView;
}
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 6774f2b..ded417a 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -154,28 +154,28 @@
{
public:
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw(RuntimeException);
+ virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames()
throw(RuntimeException);
// XServiceInfo - static methods
- static Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw(
RuntimeException );
- static ::rtl::OUString getImplementationName_Static(void) throw(
RuntimeException );
+ static Sequence< OUString > getSupportedServiceNames_Static(void) throw( RuntimeException
);
+ static OUString getImplementationName_Static(void) throw( RuntimeException );
static Reference< XInterface > Create( const Reference< XMultiServiceFactory >& );
// XCopyTableWizard
virtual ::sal_Int16 SAL_CALL getOperation() throw (RuntimeException);
virtual void SAL_CALL setOperation( ::sal_Int16 _operation ) throw
(IllegalArgumentException, RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDestinationTableName() throw (RuntimeException);
- virtual void SAL_CALL setDestinationTableName( const ::rtl::OUString&
_destinationTableName ) throw (RuntimeException);
- virtual Optional< ::rtl::OUString > SAL_CALL getCreatePrimaryKey() throw
(RuntimeException);
- virtual void SAL_CALL setCreatePrimaryKey( const Optional< ::rtl::OUString >&
_newPrimaryKey ) throw (IllegalArgumentException, RuntimeException);
+ virtual OUString SAL_CALL getDestinationTableName() throw (RuntimeException);
+ virtual void SAL_CALL setDestinationTableName( const OUString& _destinationTableName )
throw (RuntimeException);
+ virtual Optional< OUString > SAL_CALL getCreatePrimaryKey() throw (RuntimeException);
+ virtual void SAL_CALL setCreatePrimaryKey( const Optional< OUString >& _newPrimaryKey )
throw (IllegalArgumentException, RuntimeException);
virtual sal_Bool SAL_CALL getUseHeaderLineAsColumnNames() throw (RuntimeException);
virtual void SAL_CALL setUseHeaderLineAsColumnNames( sal_Bool _bUseHeaderLineAsColumnNames
) throw (RuntimeException);
virtual void SAL_CALL addCopyTableListener( const Reference< XCopyTableListener >&
Listener ) throw (RuntimeException);
virtual void SAL_CALL removeCopyTableListener( const Reference< XCopyTableListener >&
Listener ) throw (RuntimeException);
// XCopyTableWizard::XExecutableDialog
- virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (RuntimeException);
+ virtual void SAL_CALL setTitle( const OUString& aTitle ) throw (RuntimeException);
virtual ::sal_Int16 SAL_CALL execute( ) throw (RuntimeException);
// XInitialization
@@ -308,7 +308,7 @@
/** creates the INSERT INTO statement
@param _xTable The destination table.
*/
- ::rtl::OUString impl_getServerSideCopyStatement_throw( const Reference< XPropertySet >&
_xTable );
+ OUString impl_getServerSideCopyStatement_throw( const Reference< XPropertySet >& _xTable );
/** creates the statement which, when executed, will produce the source data to copy
@@ -342,8 +342,8 @@
// attributes
sal_Int16 m_nOperation;
- ::rtl::OUString m_sDestinationTable;
- Optional< ::rtl::OUString > m_aPrimaryKeyName;
+ OUString m_sDestinationTable;
+ Optional< OUString > m_aPrimaryKeyName;
sal_Bool m_bUseHeaderLineAsColumnNames;
// source
@@ -397,7 +397,7 @@
,m_aContext( _rxORB )
,m_nOperation( CopyTableOperation::CopyDefinitionAndData )
,m_sDestinationTable()
- ,m_aPrimaryKeyName( sal_False, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ))
+ ,m_aPrimaryKeyName( sal_False, "ID" )
,m_bUseHeaderLineAsColumnNames( sal_True )
,m_xSourceConnection()
,m_nCommandType( CommandType::COMMAND )
@@ -436,15 +436,15 @@
}
//-------------------------------------------------------------------------
-::rtl::OUString SAL_CALL CopyTableWizard::getImplementationName() throw(RuntimeException)
+OUString SAL_CALL CopyTableWizard::getImplementationName() throw(RuntimeException)
{
return getImplementationName_Static();
}
//-------------------------------------------------------------------------
-::rtl::OUString CopyTableWizard::getImplementationName_Static() throw(RuntimeException)
+OUString CopyTableWizard::getImplementationName_Static() throw(RuntimeException)
{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.dbu.CopyTableWizard"
) );
+ return OUString( "org.openoffice.comp.dbu.CopyTableWizard" );
}
//-------------------------------------------------------------------------
@@ -457,7 +457,7 @@
::comphelper::StringSequence CopyTableWizard::getSupportedServiceNames_Static()
throw(RuntimeException)
{
::comphelper::StringSequence aSupported(1);
- aSupported.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.sdb.application.CopyTableWizard" ) );
+ aSupported.getArray()[0] = "com.sun.star.sdb.application.CopyTableWizard";
return aSupported;
}
@@ -485,7 +485,7 @@
&& ( _operation != CopyTableOperation::CreateAsView )
&& ( _operation != CopyTableOperation::AppendData )
)
- throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+ throw IllegalArgumentException( OUString(), *this, 1 );
if ( ( _operation == CopyTableOperation::CreateAsView )
&& !OCopyTableWizard::supportsViews( m_xDestConnection )
@@ -500,28 +500,28 @@
}
//--------------------------------------------------------------------
-::rtl::OUString SAL_CALL CopyTableWizard::getDestinationTableName() throw (RuntimeException)
+OUString SAL_CALL CopyTableWizard::getDestinationTableName() throw (RuntimeException)
{
CopyTableAccessGuard aGuard( *this );
return m_sDestinationTable;
}
//--------------------------------------------------------------------
-void SAL_CALL CopyTableWizard::setDestinationTableName( const ::rtl::OUString&
_destinationTableName ) throw (RuntimeException)
+void SAL_CALL CopyTableWizard::setDestinationTableName( const OUString& _destinationTableName )
throw (RuntimeException)
{
CopyTableAccessGuard aGuard( *this );
m_sDestinationTable = _destinationTableName;
}
//--------------------------------------------------------------------
-Optional< ::rtl::OUString > SAL_CALL CopyTableWizard::getCreatePrimaryKey() throw
(RuntimeException)
+Optional< OUString > SAL_CALL CopyTableWizard::getCreatePrimaryKey() throw (RuntimeException)
{
CopyTableAccessGuard aGuard( *this );
return m_aPrimaryKeyName;
}
//--------------------------------------------------------------------
-void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< ::rtl::OUString >&
_newPrimaryKey ) throw (IllegalArgumentException, RuntimeException)
+void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< OUString >& _newPrimaryKey )
throw (IllegalArgumentException, RuntimeException)
{
CopyTableAccessGuard aGuard( *this );
@@ -563,7 +563,7 @@
}
//--------------------------------------------------------------------
-void SAL_CALL CopyTableWizard::setTitle( const ::rtl::OUString& _rTitle ) throw (RuntimeException)
+void SAL_CALL CopyTableWizard::setTitle( const OUString& _rTitle ) throw (RuntimeException)
{
CopyTableAccessGuard aGuard( *this );
CopyTableWizard_DialogBase::setTitle( _rTitle );
@@ -587,7 +587,7 @@
{
OCopyTableWizard* pWizard = dynamic_cast< OCopyTableWizard* >( m_pDialog );
if ( !pWizard )
- throw DisposedException( ::rtl::OUString(), *this );
+ throw DisposedException( OUString(), *this );
return *pWizard;
}
@@ -596,7 +596,7 @@
{
const OCopyTableWizard* pWizard = dynamic_cast< const OCopyTableWizard* >( m_pDialog );
if ( !pWizard )
- throw DisposedException( ::rtl::OUString(), *const_cast< CopyTableWizard* >( this ) );
+ throw DisposedException( OUString(), *const_cast< CopyTableWizard* >( this ) );
return *pWizard;
}
@@ -617,7 +617,7 @@
if ( m_aPrimaryKeyName.IsPresent )
m_aPrimaryKeyName.Value = _rDialog.getPrimaryKeyName();
else
- m_aPrimaryKeyName.Value = ::rtl::OUString();
+ m_aPrimaryKeyName.Value = OUString();
m_sDestinationTable = _rDialog.getName();
@@ -698,8 +698,7 @@
{
Reference< XServiceInfo > xSI( xDescriptor, UNO_QUERY );
bIsValid = ( xSI.is()
- && xSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.sdb.DataAccessDescriptor" ) ) )
- );
+ && xSI->supportsService( "com.sun.star.sdb.DataAccessDescriptor" ) );
}
// it must be able to provide a connection
@@ -725,9 +724,9 @@
namespace
{
bool lcl_hasNonEmptyStringValue_throw( const Reference< XPropertySet >& _rxDescriptor,
- const Reference< XPropertySetInfo > _rxPSI, const ::rtl::OUString& _rPropertyName )
+ const Reference< XPropertySetInfo > _rxPSI, const OUString& _rPropertyName )
{
- ::rtl::OUString sValue;
+ OUString sValue;
if ( _rxPSI->hasPropertyByName( _rPropertyName ) )
{
OSL_VERIFY( _rxDescriptor->getPropertyValue( _rPropertyName ) >>= sValue );
@@ -741,9 +740,9 @@
{
OSL_PRECOND( _rxSourceDescriptor.is(),
"CopyTableWizard::impl_checkForUnsupportedSettings_throw: illegal argument!" );
Reference< XPropertySetInfo > xPSI( _rxSourceDescriptor->getPropertySetInfo(), UNO_SET_THROW );
- ::rtl::OUString sUnsupportedSetting;
+ OUString sUnsupportedSetting;
- const ::rtl::OUString aSettings[] = {
+ const OUString aSettings[] = {
PROPERTY_FILTER, PROPERTY_ORDER, PROPERTY_HAVING_CLAUSE, PROPERTY_GROUP_BY
};
for ( size_t i=0; i < sizeof( aSettings ) / sizeof( aSettings[0] ); ++i )
@@ -757,8 +756,8 @@
if ( !sUnsupportedSetting.isEmpty() )
{
- ::rtl::OUString sMessage(
- rtl::OUString(String(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING))).
+ OUString sMessage(
+ OUString(String(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING))).
replaceFirst("$name$", sUnsupportedSetting));
throw IllegalArgumentException(
sMessage,
@@ -779,14 +778,11 @@
if ( !xPSI->hasPropertyByName( PROPERTY_COMMAND )
|| !xPSI->hasPropertyByName( PROPERTY_COMMAND_TYPE )
)
- throw IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Expecting a table or query
specification." ) ),
- // TODO: resource
- *const_cast< CopyTableWizard* >( this ),
- 1
- );
+ throw IllegalArgumentException("Expecting a table or query specification.",
+ // TODO: resource
+ *const_cast< CopyTableWizard* >( this ), 1);
- ::rtl::OUString sCommand;
+ OUString sCommand;
_out_rCommandType = CommandType::COMMAND;
OSL_VERIFY( _rxDescriptor->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand );
OSL_VERIFY( _rxDescriptor->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= _out_rCommandType );
@@ -860,12 +856,9 @@
const bool bHasResultSet = m_xSourceResultSet.is();
const bool bHasSelection = ( m_aSourceSelection.getLength() != 0 );
if ( bHasSelection && !bHasResultSet )
- throw IllegalArgumentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "A result set is needed when specifying
a selection to copy." ) ),
- // TODO: resource
- *this,
- 1
- );
+ throw IllegalArgumentException("A result set is needed when specifying a selection to
copy.",
+ // TODO: resource
+ *this, 1);
if ( bHasSelection && m_bSourceSelectionBookmarks )
{
@@ -911,7 +904,7 @@
}
// there could be a DataSourceName or a DatabaseLocation, describing the css.sdb.DataSource
- ::rtl::OUString sDataSource, sDatabaseLocation;
+ OUString sDataSource, sDatabaseLocation;
if ( xPSI->hasPropertyByName( PROPERTY_DATASOURCENAME ) )
OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATASOURCENAME ) >>=
sDataSource );
if ( xPSI->hasPropertyByName( PROPERTY_DATABASE_LOCATION ) )
@@ -940,7 +933,7 @@
// interactively connecting was not successful or possible -> connect without interaction
if ( !xConnection.is() )
{
- xConnection.reset( xDataSource->getConnection( ::rtl::OUString(), ::rtl::OUString() ),
SharedConnection::TakeOwnership );
+ xConnection.reset( xDataSource->getConnection( OUString(), OUString() ),
SharedConnection::TakeOwnership );
}
}
@@ -948,7 +941,7 @@
break;
// finally, there could be a ConnectionResource/ConnectionInfo
- ::rtl::OUString sConnectionResource;
+ OUString sConnectionResource;
Sequence< PropertyValue > aConnectionInfo;
if ( xPSI->hasPropertyByName( PROPERTY_CONNECTION_RESOURCE ) )
OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_RESOURCE ) >>=
sConnectionResource );
@@ -992,7 +985,7 @@
case CommandType::QUERY:
{
- ::rtl::OUString sQueryCommand( m_pSourceObject->getSelectStatement() );
+ OUString sQueryCommand( m_pSourceObject->getSelectStatement() );
xStatement.set( m_pSourceObject->getPreparedSelectStatement(), UNO_SET_THROW );
// check whether we have to fill in parameter values
@@ -1270,11 +1263,8 @@
if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= (sal_Int32)aSourceColTypes.size()
) )
{ // ( we have to check here against 1 because the parameters are 1 based)
- ::dbtools::throwSQLException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Internal error: invalid
column type index." ) ),
- ::dbtools::SQL_INVALID_DESCRIPTOR_INDEX,
- *this
- );
+ ::dbtools::throwSQLException("Internal error: invalid column type index.",
+ ::dbtools::SQL_INVALID_DESCRIPTOR_INDEX, *this);
}
switch ( aSourceColTypes[ nSourceColumn ] )
@@ -1351,10 +1341,10 @@
default:
{
- ::rtl::OUString aMessage( String( ModuleRes(
STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) );
+ OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) )
);
- aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$type$", 6 ), 6,
::rtl::OUString::valueOf( aSourceColTypes[ nSourceColumn ] ) );
- aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$pos$", 5 ), 5,
::rtl::OUString::valueOf( nSourceColumn ) );
+ aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$type$", 6 ), 6,
OUString::valueOf( aSourceColTypes[ nSourceColumn ] ) );
+ aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$pos$", 5 ), 5,
OUString::valueOf( nSourceColumn ) );
::dbtools::throwSQLException(
aMessage,
@@ -1497,14 +1487,14 @@
}
}
// -----------------------------------------------------------------------------
-::rtl::OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference<
XPropertySet >& _xTable)
+OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference< XPropertySet >&
_xTable)
{
const Reference<XColumnsSupplier> xDestColsSup(_xTable,UNO_QUERY_THROW);
- const Sequence< ::rtl::OUString> aDestColumnNames =
xDestColsSup->getColumns()->getElementNames();
- const Sequence< ::rtl::OUString > aColumnNames = m_pSourceObject->getColumnNames();
+ const Sequence< OUString> aDestColumnNames = xDestColsSup->getColumns()->getElementNames();
+ const Sequence< OUString > aColumnNames = m_pSourceObject->getColumnNames();
const Reference< XDatabaseMetaData > xDestMetaData( m_xDestConnection->getMetaData(),
UNO_QUERY_THROW );
- const ::rtl::OUString sQuote = xDestMetaData->getIdentifierQuoteString();
- ::rtl::OUStringBuffer sColumns;
+ const OUString sQuote = xDestMetaData->getIdentifierQuoteString();
+ OUStringBuffer sColumns;
// 1st check if the columns matching
const OCopyTableWizard& rWizard = impl_getDialog_throw();
ODatabaseExport::TPositions aColumnMapping = rWizard.GetColumnPositions();
@@ -1514,30 +1504,21 @@
if ( COLUMN_POSITION_NOT_FOUND != aPosIter->second )
{
if ( sColumns.getLength() )
- sColumns.appendAscii(",");
- sColumns.append(sQuote);
- sColumns.append(aDestColumnNames[aPosIter->second - 1]);
- sColumns.append(sQuote);
+ sColumns.append(",");
+ sColumns.append(sQuote + aDestColumnNames[aPosIter->second - 1] + sQuote);
}
}
- ::rtl::OUStringBuffer sSql;
- sSql.appendAscii("INSERT INTO ");
- const ::rtl::OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData,
_xTable, ::dbtools::eInDataManipulation, false, false, true );
- sSql.append( sComposedTableName );
- sSql.appendAscii(" ( ");
- sSql.append( sColumns.makeStringAndClear() );
- sSql.appendAscii(" ) ( ");
- sSql.append( m_pSourceObject->getSelectStatement());
- sSql.appendAscii(" )");
+ const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable,
::dbtools::eInDataManipulation, false, false, true );
+ OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns.makeStringAndClear() + "
) ( " + m_pSourceObject->getSelectStatement() + " )");
- return sSql.makeStringAndClear();
+ return sSql;
}
//-------------------------------------------------------------------------
void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) throw (Exception,
RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
if ( isInitialized() )
- throw AlreadyInitializedException( ::rtl::OUString(), *this );
+ throw AlreadyInitializedException( OUString(), *this );
sal_Int32 nArgCount( _rArguments.getLength() );
if ( ( nArgCount != 2 ) && ( nArgCount != 3 ) )
diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx
index 6a56624..d404730 100644
--- a/dbaccess/source/ui/uno/unosqlmessage.cxx
+++ b/dbaccess/source/ui/uno/unosqlmessage.cxx
@@ -70,15 +70,15 @@
}
//-------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OSQLMessageDialog::getImplementationName() throw(RuntimeException)
+OUString SAL_CALL OSQLMessageDialog::getImplementationName() throw(RuntimeException)
{
return getImplementationName_Static();
}
//-------------------------------------------------------------------------
-::rtl::OUString OSQLMessageDialog::getImplementationName_Static() throw(RuntimeException)
+OUString OSQLMessageDialog::getImplementationName_Static() throw(RuntimeException)
{
- return
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OSQLMessageDialog"));
+ return OUString("org.openoffice.comp.dbu.OSQLMessageDialog");
}
//-------------------------------------------------------------------------
@@ -91,7 +91,7 @@
::comphelper::StringSequence OSQLMessageDialog::getSupportedServiceNames_Static()
throw(RuntimeException)
{
::comphelper::StringSequence aSupported(1);
- aSupported.getArray()[0] =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ErrorMessageDialog"));
+ aSupported.getArray()[0] = "com.sun.star.sdb.ErrorMessageDialog";
return aSupported;
}
--
To view, visit https://gerrit.libreoffice.org/1572
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a4381cbe1e716cd2de1fb596053646d1a74d4b0
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Marcos Souza <marcos.souza.org@gmail.com>
Context
- [PATCH] Remove some RTL_* macros, rtl:: prefixes and simplification ... · Marcos Souza (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.