Kaydet (Commit) 098877d6 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

Remove RTL_CONSTASCII_(U)STRINGPARAM in sw

Change-Id: I704628eabdddb70530b6a8a1160c20724332c7e5
üst 506e1efa
......@@ -137,7 +137,7 @@ void SwFiltersTest::setUp()
//which is a private symbol to us, gets called
m_xWriterComponent =
getMultiServiceFactory()->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument")));
"com.sun.star.comp.Writer.TextDocument"));
CPPUNIT_ASSERT_MESSAGE("no writer component!", m_xWriterComponent.is());
}
......
......@@ -76,7 +76,7 @@ private:
void SwLayoutTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
{
rtl::OUString aSep(RTL_CONSTASCII_USTRINGPARAM("/"));
rtl::OUString aSep("/");
rtl::OUStringBuffer aBuffer( getSrcRootURL() );
aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension);
aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
......@@ -86,8 +86,8 @@ void SwLayoutTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUSt
void SwLayoutTest::test()
{
rtl::OUString aFilePath;
rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM("test."));
rtl::OUString aExtension(RTL_CONSTASCII_USTRINGPARAM("odt"));
rtl::OUString aFileBase("test.");
rtl::OUString aExtension("odt");
createFileURL(aFileBase, aExtension, aFilePath);
uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFilePath, "com.sun.star.text.TextDocument");
CPPUNIT_ASSERT(xComponent.is());
......@@ -95,7 +95,7 @@ void SwLayoutTest::test()
SwLayoutTest::SwLayoutTest()
: m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data"))
: m_aBaseString("/sw/qa/core/data")
{
}
......@@ -107,7 +107,7 @@ void SwLayoutTest::setUp()
// which is a private symbol to us, gets called
m_xWriterComponent =
getMultiServiceFactory()->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument")));
"com.sun.star.comp.Writer.TextDocument"));
CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xWriterComponent.is());
mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) );
}
......
......@@ -102,7 +102,7 @@ private:
void SwMacrosTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
{
rtl::OUString aSep(RTL_CONSTASCII_USTRINGPARAM("/"));
rtl::OUString aSep("/");
rtl::OUStringBuffer aBuffer( getSrcRootURL() );
aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension);
aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
......@@ -113,7 +113,7 @@ void SwMacrosTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUSt
void SwMacrosTest::testStarBasic()
{
const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("StarBasic."));
const rtl::OUString aFileNameBase("StarBasic.");
rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFileName;
createFileURL(aFileNameBase, aFileExtension, aFileName);
......@@ -121,7 +121,7 @@ void SwMacrosTest::testStarBasic()
CPPUNIT_ASSERT_MESSAGE("Failed to load StarBasic.ods", xComponent.is());
rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic&location=document"));
rtl::OUString aURL("vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic&location=document");
String sUrl = aURL;
Any aRet;
Sequence< sal_Int16 > aOutParamIndex;
......@@ -142,17 +142,17 @@ void SwMacrosTest::testVba()
{
TestMacroInfo testInfo[] = {
{
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("testVba.")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic&location=document"))
rtl::OUString("testVba."),
rtl::OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic&location=document")
}
};
rtl::OUString aFileExtension( RTL_CONSTASCII_USTRINGPARAM("doc") );
rtl::OUString aFileExtension( "doc" );
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
{
rtl::OUString aFileName;
createFileURL(testInfo[i].sFileBaseName, aFileExtension, aFileName);
uno::Reference< com::sun::star::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument");
rtl::OUStringBuffer sMsg( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Failed to load ")) );
rtl::OUStringBuffer sMsg( rtl::OUString("Failed to load ") );
sMsg.append ( aFileName );
CPPUNIT_ASSERT_MESSAGE( rtl::OUStringToOString( sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ).getStr(), xComponent.is() );
......@@ -208,7 +208,7 @@ void SwMacrosTest::testFdo55289()
}
SwMacrosTest::SwMacrosTest()
: m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data"))
: m_aBaseString("/sw/qa/core/data")
{
}
......@@ -220,7 +220,7 @@ void SwMacrosTest::setUp()
// which is a private symbol to us, gets called
m_xWriterComponent =
getMultiServiceFactory()->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument")));
"com.sun.star.comp.Writer.TextDocument"));
CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xWriterComponent.is());
mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) );
}
......
......@@ -135,7 +135,7 @@ void SwDocTest::testFileNameFields()
{
//Here's a file name with some chars in it that will be %% encoded, when expanding
//SwFileNameFields we want to restore the original readable filename
utl::TempFile aTempFile(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("demo [name]")));
utl::TempFile aTempFile(rtl::OUString("demo [name]"));
aTempFile.EnableKillingFile();
INetURLObject aTempFileURL(aTempFile.GetURL());
......@@ -143,9 +143,9 @@ void SwDocTest::testFileNameFields()
SfxMedium aDstMed(sFileURL, STREAM_STD_READWRITE);
SfxFilter aFilter(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text")),
rtl::OUString("Text"),
rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TEXT")), rtl::OUString() );
rtl::OUString("TEXT"), rtl::OUString() );
aDstMed.SetFilter(&aFilter);
m_xDocShRef->DoSaveAs(aDstMed);
......@@ -198,7 +198,7 @@ void SwDocTest::testDocStat()
SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx);
rtl::OUString sText(RTL_CONSTASCII_USTRINGPARAM("Hello World"));
rtl::OUString sText("Hello World");
m_pDoc->InsertString(aPaM, sText);
CPPUNIT_ASSERT_MESSAGE("Should still be non-updated 0 count", m_pDoc->GetDocStat().nChar == 0);
......@@ -354,7 +354,7 @@ void SwDocTest::testSwScanner()
//fdo#40449 and fdo#39365
{
SwScanner aScanner(*pTxtNode,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hello World")),
rtl::OUString("Hello World"),
0, ModelToViewHelper(), i18n::WordType::DICTIONARY_WORD, 0,
RTL_CONSTASCII_LENGTH("Hello World"));
......@@ -362,13 +362,13 @@ void SwDocTest::testSwScanner()
CPPUNIT_ASSERT_MESSAGE("First Token", bFirstOk);
const rtl::OUString &rHello = aScanner.GetWord();
CPPUNIT_ASSERT_MESSAGE("Should be Hello",
rHello.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Hello")));
rHello == "Hello");
bool bSecondOk = aScanner.NextWord();
CPPUNIT_ASSERT_MESSAGE("Second Token", bSecondOk);
const rtl::OUString &rWorld = aScanner.GetWord();
CPPUNIT_ASSERT_MESSAGE("Should be World",
rWorld.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("World")));
rWorld == "World");
}
//See https://www.libreoffice.org/bugzilla/show_bug.cgi?id=45271
......@@ -694,14 +694,14 @@ void SwDocTest::testGraphicAnchorDeletion()
SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx);
m_pDoc->InsertString(aPaM, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Paragraph 1")));
m_pDoc->InsertString(aPaM, rtl::OUString("Paragraph 1"));
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("graphic anchor>><<graphic anchor")));
m_pDoc->InsertString(aPaM, rtl::OUString("graphic anchor>><<graphic anchor"));
SwNodeIndex nPara2 = aPaM.GetPoint()->nNode;
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Paragraph 3")));
m_pDoc->InsertString(aPaM, rtl::OUString("Paragraph 3"));
aPaM.GetPoint()->nNode = nPara2;
aPaM.GetPoint()->nContent.Assign(aPaM.GetCntntNode(), RTL_CONSTASCII_LENGTH("graphic anchor>>"));
......@@ -727,8 +727,7 @@ void SwDocTest::testGraphicAnchorDeletion()
#ifdef DEBUG_AS_HTML
{
SvFileStream aPasteDebug(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"cppunitDEBUG.html")), STREAM_WRITE|STREAM_TRUNC);
SvFileStream aPasteDebug(rtl::OUString("cppunitDEBUG.html"), STREAM_WRITE|STREAM_TRUNC);
WriterRef xWrt;
GetHTMLWriter( String(), String(), xWrt );
SwWriter aDbgWrt( aPasteDebug, *m_pDoc );
......
......@@ -489,7 +489,7 @@ void SwXMLTextBlocks::WriteInfo( void )
embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
uno::Reference < beans::XPropertySet > xSet( xDocStream, uno::UNO_QUERY );
OUString aMime ( RTL_CONSTASCII_USTRINGPARAM ( "text/xml") );
OUString aMime ( "text/xml" );
Any aAny;
aAny <<= aMime;
xSet->setPropertyValue( OUString("MediaType"), aAny );
......
......@@ -35,8 +35,8 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
try {
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xI =
rxMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.i18n.IndexEntrySupplier")) );
rxMSF->createInstance( ::rtl::OUString(
"com.sun.star.i18n.IndexEntrySupplier") );
if( xI.is() )
{
::com::sun::star::uno::Any x = xI->queryInterface( ::getCppuType(
......@@ -51,7 +51,7 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("IndexEntrySupplierWrapper: Caught exception\n"));
rtl::OStringBuffer aMsg("IndexEntrySupplierWrapper: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......@@ -77,7 +77,7 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt,
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexKey: Caught exception\n"));
rtl::OStringBuffer aMsg("getIndexKey: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......@@ -98,7 +98,7 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexFollowPageWord: Caught exception\n"));
rtl::OStringBuffer aMsg("getIndexFollowPageWord: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......@@ -121,7 +121,7 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const ::com::sun::star::lang::Local
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getAlgorithmList: Caught exception\n"));
rtl::OStringBuffer aMsg("getAlgorithmList: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......@@ -144,7 +144,7 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm(
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("loadAlgorithm: Caught exception\n"));
rtl::OStringBuffer aMsg("loadAlgorithm: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......@@ -170,7 +170,7 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry(
)
{
#if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("compareIndexEntry: Caught exception\n"));
rtl::OStringBuffer aMsg("compareIndexEntry: Caught exception\n");
aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
OSL_FAIL( aMsg.getStr() );
#endif
......
......@@ -74,9 +74,9 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName,
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap().getByName( rPropertyName );
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw UnknownPropertyException(OUString ( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
if ( pMap->nFlags & PropertyAttribute::READONLY)
throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw PropertyVetoException ( OUString ( "Property is read-only: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID);
if (RES_PAGEDESC == pMap->nWID && MID_PAGEDESC_PAGEDESCNAME == pMap->nMemberId)
......@@ -140,7 +140,7 @@ Any SAL_CALL SwXTextDefaults::getPropertyValue( const OUString& rPropertyName )
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap().getByName( rPropertyName );
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw UnknownPropertyException(OUString ( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
Any aRet;
const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID);
rItem.QueryValue( aRet, pMap->nMemberId );
......@@ -186,7 +186,7 @@ PropertyState SAL_CALL SwXTextDefaults::getPropertyState( const OUString& rPrope
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap().getByName( rPropertyName );
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw UnknownPropertyException(OUString ( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID);
if (IsStaticDefaultItem ( &rItem ) )
......@@ -217,9 +217,9 @@ void SAL_CALL SwXTextDefaults::setPropertyToDefault( const OUString& rPropertyNa
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap().getByName( rPropertyName );
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw UnknownPropertyException(OUString ( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
if ( pMap->nFlags & PropertyAttribute::READONLY)
throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw RuntimeException( OUString ( "setPropertyToDefault: property is read-only: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
SfxItemPool& rSet (m_pDoc->GetAttrPool());
rSet.ResetPoolDefaultItem ( pMap->nWID );
}
......@@ -232,7 +232,7 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap().getByName( rPropertyName );
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
throw UnknownPropertyException(OUString ( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
Any aRet;
SfxItemPool& rSet (m_pDoc->GetAttrPool());
const SfxPoolItem *pItem = rSet.GetPoolDefaultItem ( pMap->nWID );
......
......@@ -63,8 +63,7 @@ sal_Bool UCB_DeleteFile( const String& rURL )
ucbhelper::Content aTempContent( rURL,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
comphelper::getProcessComponentContext() );
aTempContent.executeCommand(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
aTempContent.executeCommand(rtl::OUString("delete"),
::com::sun::star::uno::makeAny( sal_True ) );
bRemoved = sal_True;
}
......@@ -97,9 +96,8 @@ sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL, sal_Bool bCopy
aInfo.SourceURL = rURL;
aInfo.MoveData = bCopyIsMove;
aAny <<= aInfo;
aTempContent.executeCommand(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),
aAny );
aTempContent.executeCommand( rtl::OUString("transfer"),
aAny );
}
catch( ::com::sun::star::uno::Exception& )
{
......@@ -144,7 +142,7 @@ sal_Bool UCB_IsReadOnlyFileName( const String& rURL )
{
ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Any aAny = aCnt.getPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly")));
rtl::OUString("IsReadOnly"));
if(aAny.hasValue())
bIsReadOnly = *(sal_Bool*)aAny.getValue();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment