summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-06-02 22:33:02 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-06-02 22:33:02 -0500
commitf86ee78ba2fcb1ff3aca3c20c747932d615bed14 (patch)
treef086e51f21817be9f7e4b65d662a0335154b243c /sfx2
parent56f3f3e9dae673266d42149de4fc36a4161de923 (diff)
targeted string re-work
Change-Id: Ib607fc30bf6eaa1c1043eb7e815295b728da3085
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx12
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx184
-rw-r--r--sfx2/source/doc/doctempl.cxx30
-rw-r--r--sfx2/source/doc/doctemplates.cxx157
4 files changed, 191 insertions, 192 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 74a5a717dd57..6d5f30bca0ad 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -501,14 +501,14 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic )
return 0;
#else
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
&thisModule, aLibName.pData, 0 );
// get symbol
- ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_handle_basic_error" ) );
+ ::rtl::OUString aSymbol( "basicide_handle_basic_error" );
basicide_handle_basic_error pSymbol = (basicide_handle_basic_error) osl_getFunctionSymbol( handleMod, aSymbol.pData );
// call basicide_handle_basic_error in basctl
@@ -532,8 +532,8 @@ sal_Bool SfxApplication::IsXScriptURL( const String& rScriptURL )
::com::sun::star::uno::Reference
< ::com::sun::star::uri::XUriReferenceFactory >
xFactory( xSMgr->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.uri.UriReferenceFactory" )) ),
+ ::rtl::OUString(
+ "com.sun.star.uri.UriReferenceFactory" ) ),
::com::sun::star::uno::UNO_QUERY );
if ( xFactory.is() )
@@ -600,14 +600,14 @@ void SfxApplication::MacroOrganizer( sal_Int16 nTabId )
(void) nTabId;
#else
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
&thisModule, aLibName.pData, 0 );
// get symbol
- ::rtl::OUString aSymbol( RTL_CONSTASCII_USTRINGPARAM( "basicide_macro_organizer" ) );
+ ::rtl::OUString aSymbol( "basicide_macro_organizer" );
basicide_macro_organizer pSymbol = (basicide_macro_organizer) osl_getFunctionSymbol( handleMod, aSymbol.pData );
// call basicide_choose_macro in basctl
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index d27df1dece1d..bbe7555e9ae1 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -153,8 +153,8 @@ uno::Reference<rdf::XURI> createBaseURI(
i_xContext->getServiceManager(), uno::UNO_SET_THROW);
const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
xServiceFactory->createInstanceWithContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.uri.UriReferenceFactory")), i_xContext),
+ ::rtl::OUString(
+ "com.sun.star.uri.UriReferenceFactory"), i_xContext),
uno::UNO_QUERY_THROW);
uno::Reference< uri::XUriReference > xBaseURI;
@@ -325,8 +325,8 @@ addFile(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "addFile: exception")), /*this*/0, uno::makeAny(e));
+ ::rtl::OUString(
+ "addFile: exception"), /*this*/0, uno::makeAny(e));
}
}
@@ -374,7 +374,7 @@ removeFile(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("removeFile: exception")),
+ ::rtl::OUString("removeFile: exception"),
0, uno::makeAny(e));
}
}
@@ -403,7 +403,7 @@ getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl)
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getAllParts: exception")),
+ ::rtl::OUString("getAllParts: exception"),
0, uno::makeAny(e));
}
}
@@ -425,7 +425,7 @@ isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("isPartOfType: exception")),
+ ::rtl::OUString("isPartOfType: exception"),
0, uno::makeAny(e));
}
}
@@ -441,10 +441,10 @@ mkException( ::rtl::OUString const & i_rMessage,
iaioe.Classification = task::InteractionClassification_ERROR;
iaioe.Code = i_ErrorCode;
- const beans::PropertyValue uriProp(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")),
+ const beans::PropertyValue uriProp(::rtl::OUString("Uri"),
-1, uno::makeAny(i_rUri), static_cast<beans::PropertyState>(0));
const beans::PropertyValue rnProp(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ResourceName")),
+ ::rtl::OUString("ResourceName"),
-1, uno::makeAny(i_rResource), static_cast<beans::PropertyState>(0));
iaioe.Arguments = ::comphelper::makeSequence(
uno::makeAny(uriProp), uno::makeAny(rnProp));
@@ -464,8 +464,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
const uno::Reference<task::XInteractionHandler> & i_xHandler)
{
if (!i_xHandler.is()) {
- throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::loadMetadataFromStorage: exception")),
+ throw lang::WrappedTargetException(::rtl::OUString(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
/* *this*/ 0, uno::makeAny(i_rException));
}
@@ -488,8 +488,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
return false;
} else {
OSL_ENSURE(pAbort->wasSelected(), "no continuation selected?");
- throw lang::WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::loadMetadataFromStorage: exception")),
+ throw lang::WrappedTargetException(::rtl::OUString(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
/* *this*/ 0, uno::makeAny(i_rException));
}
}
@@ -501,8 +501,8 @@ collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage,
::rtl::OUString i_Path,
std::set< ::rtl::OUString > & o_rFiles)
{
- static ::rtl::OUString content(RTL_CONSTASCII_USTRINGPARAM(s_content));
- static ::rtl::OUString styles(RTL_CONSTASCII_USTRINGPARAM(s_styles ));
+ static ::rtl::OUString content(s_content);
+ static ::rtl::OUString styles(s_styles );
try {
if (i_xStorage->hasByName(content) &&
i_xStorage->isStreamElement(content))
@@ -545,8 +545,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
i_rImpl.m_xRepository->importGraph(rdf::FileFormat::RDF_XML,
xInStream, xURI, xBaseURI);
} else {
- throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "readStream: is not a stream")),
+ throw mkException(::rtl::OUString(
+ "readStream: is not a stream"),
ucb::IOErrorCode_NO_FILE, i_rBaseURI + i_rPath, i_rPath);
}
} else {
@@ -572,8 +572,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
buf.append(dir).append(static_cast<sal_Unicode>('/'));
readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() );
} else {
- throw mkException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "readStream: is not a directory")),
+ throw mkException(::rtl::OUString(
+ "readStream: is not a directory"),
ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir);
}
}
@@ -606,7 +606,7 @@ retry:
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("importFile: exception")),
+ ::rtl::OUString("importFile: exception"),
0, uno::makeAny(e));
}
}
@@ -627,8 +627,8 @@ exportStream(struct DocumentMetadataAccess_Impl & i_rImpl,
uno::UNO_QUERY);
if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
xStreamProps->setPropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),
- uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_rdfxml))));
+ ::rtl::OUString("MediaType"),
+ uno::makeAny(::rtl::OUString(s_rdfxml)));
}
const uno::Reference<io::XOutputStream> xOutStream(
xStream->getOutputStream(), uno::UNO_SET_THROW );
@@ -747,9 +747,9 @@ retry:
if (rterr.hasValue()) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "exception")), 0, rterr);
+ "exception"), 0, rterr);
}
if (err) {
@@ -773,7 +773,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl)
getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("init: unexpected exception")), 0,
+ ::rtl::OUString("init: unexpected exception"), 0,
uno::makeAny(e));
}
@@ -860,8 +860,8 @@ throw (uno::RuntimeException)
const IXmlIdRegistry * pReg(
m_pImpl->m_rXmlIdRegistrySupplier.GetXmlIdRegistry() );
if (!pReg) {
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::getElementByXmlId: no registry")), *this);
+ throw uno::RuntimeException(::rtl::OUString(
+ "DocumentMetadataAccess::getElementByXmlId: no registry"), *this);
}
return pReg->GetElementByMetadataReference(i_rReference);
}
@@ -872,8 +872,8 @@ DocumentMetadataAccess::getElementByURI(
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
if (!i_xURI.is()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::getElementByURI: URI is null")), *this, 0);
+ throw lang::IllegalArgumentException(::rtl::OUString(
+ "DocumentMetadataAccess::getElementByURI: URI is null"), *this, 0);
}
const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() );
@@ -898,9 +898,9 @@ DocumentMetadataAccess::getMetadataGraphsWithType(
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
if (!i_xType.is()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::getMetadataGraphsWithType: "
- "type is null")), *this, 0);
+ "type is null"), *this, 0);
}
::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > ret;
@@ -921,21 +921,21 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::addMetadataFile: invalid FileName")),
+ throw lang::IllegalArgumentException(::rtl::OUString(
+ "DocumentMetadataAccess::addMetadataFile: invalid FileName"),
*this, 0);
}
if (isReservedFile(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::addMetadataFile:"
- "invalid FileName: reserved")), *this, 0);
+ "invalid FileName: reserved"), *this, 0);
}
for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
if (!i_rTypes[i].is()) {
throw lang::IllegalArgumentException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::addMetadataFile: "
- "null type")), *this, 2);
+ "null type"), *this, 2);
}
}
@@ -946,8 +946,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
m_pImpl->m_xRepository->createGraph(xGraphName);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::addMetadataFile: exception")),
+ ::rtl::OUString(
+ "DocumentMetadataAccess::addMetadataFile: exception"),
*this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -967,20 +967,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException, rdf::ParseException, io::IOException)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::importMetadataFile: invalid FileName")),
+ throw lang::IllegalArgumentException(::rtl::OUString(
+ "DocumentMetadataAccess::importMetadataFile: invalid FileName"),
*this, 0);
}
if (isReservedFile(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::importMetadataFile:"
- "invalid FileName: reserved")), *this, 0);
+ "invalid FileName: reserved"), *this, 0);
}
for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
if (!i_rTypes[i].is()) {
throw lang::IllegalArgumentException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::importMetadataFile: null type")),
+ ::rtl::OUString(
+ "DocumentMetadataAccess::importMetadataFile: null type"),
*this, 5);
}
}
@@ -993,9 +993,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
i_Format, i_xInStream, xGraphName, i_xBaseURI);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::importMetadataFile: "
- "RepositoryException")), *this, uno::makeAny(e));
+ "RepositoryException"), *this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -1014,9 +1014,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
m_pImpl->m_xRepository->destroyGraph(i_xGraphName);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::removeMetadataFile: "
- "RepositoryException")), *this, uno::makeAny(e));
+ "RepositoryException"), *this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -1031,15 +1031,15 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::addContentOrStylesFile: "
- "invalid FileName")), *this, 0);
+ "invalid FileName"), *this, 0);
}
if (!addContentOrStylesFileImpl(*m_pImpl, i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::addContentOrStylesFile: "
- "invalid FileName: must end with content.xml or styles.xml")),
+ "invalid FileName: must end with content.xml or styles.xml"),
*this, 0);
}
}
@@ -1051,9 +1051,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::NoSuchElementException)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::removeContentOrStylesFile: "
- "invalid FileName")), *this, 0);
+ "invalid FileName"), *this, 0);
}
try {
@@ -1066,9 +1066,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
uno::UNO_SET_THROW);
if (!xEnum->hasMoreElements()) {
throw container::NoSuchElementException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::removeContentOrStylesFile: "
- "cannot find stream in manifest graph: ")) + i_rFileName,
+ "cannot find stream in manifest graph: ") + i_rFileName,
*this);
}
@@ -1079,8 +1079,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "DocumentMetadataAccess::removeContentOrStylesFile: exception")),
+ ::rtl::OUString(
+ "DocumentMetadataAccess::removeContentOrStylesFile: exception"),
*this, uno::makeAny(e));
}
}
@@ -1093,32 +1093,32 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
if (!i_xStorage.is()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "storage is null")), *this, 0);
+ "storage is null"), *this, 0);
}
if (!i_xBaseURI.is()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI is null")), *this, 1);
+ "base URI is null"), *this, 1);
}
const ::rtl::OUString baseURI( i_xBaseURI->getStringValue());
if (baseURI.indexOf('#') >= 0) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI not absolute")), *this, 1);
+ "base URI not absolute"), *this, 1);
}
if (baseURI.isEmpty() || !baseURI.endsWithAsciiL("/", 1)) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI does not end with slash")), *this, 1);
+ "base URI does not end with slash"), *this, 1);
}
initLoading(*m_pImpl, i_xStorage, i_xBaseURI, i_xHandler);
std::set< ::rtl::OUString > StgFiles;
collectFilesFromStorage(i_xStorage,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), StgFiles);
+ ::rtl::OUString(""), StgFiles);
std::vector< ::rtl::OUString > MfstMetadataFiles;
@@ -1185,9 +1185,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "exception")), *this, uno::makeAny(e));
+ "exception"), *this, uno::makeAny(e));
}
std::for_each(StgFiles.begin(), StgFiles.end(),
@@ -1204,9 +1204,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
if (!i_xStorage.is()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::storeMetadataToStorage: "
- "storage is null")), *this, 0);
+ "storage is null"), *this, 0);
}
// export manifest
@@ -1220,12 +1220,12 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
} catch (const uno::RuntimeException &) {
throw;
} catch (const io::IOException & e) {
- throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e));
+ throw lang::WrappedTargetException( ::rtl::OUString(
+ "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e));
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "storeMetadataToStorage: exception")), *this, uno::makeAny(e));
+ ::rtl::OUString(
+ "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
}
// export metadata streams
@@ -1258,20 +1258,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const io::IOException & e) {
throw lang::WrappedTargetException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "storeMetadataToStorage: IO exception")),
+ ::rtl::OUString(
+ "storeMetadataToStorage: IO exception"),
*this, uno::makeAny(e));
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "storeMetadataToStorage: exception")),
+ ::rtl::OUString(
+ "storeMetadataToStorage: exception"),
*this, uno::makeAny(e));
}
}
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "storeMetadataToStorage: exception")), *this, uno::makeAny(e));
+ ::rtl::OUString(
+ "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
}
}
@@ -1291,9 +1291,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn;
}
if (!xIn.is() && URL.isEmpty()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "inalid medium: no URL, no input stream")), *this, 0);
+ "inalid medium: no URL, no input stream"), *this, 0);
}
uno::Reference<embed::XStorage> xStorage;
try {
@@ -1312,14 +1312,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ ::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "exception")), *this, uno::makeAny(e));
+ "exception"), *this, uno::makeAny(e));
}
if (!xStorage.is()) {
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw uno::RuntimeException(::rtl::OUString(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "cannot get Storage")), *this);
+ "cannot get Storage"), *this);
}
uno::Reference<rdf::XURI> xBaseURI;
try {
@@ -1347,9 +1347,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
::rtl::OUString URL;
md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL;
if (URL.isEmpty()) {
- throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw lang::IllegalArgumentException(::rtl::OUString(
"DocumentMetadataAccess::storeMetadataToMedium: "
- "invalid medium: no URL")), *this, 0);
+ "invalid medium: no URL"), *this, 0);
}
SfxMedium aMedium(i_rMedium);
@@ -1366,9 +1366,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
}
if (!xStorage.is()) {
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ throw uno::RuntimeException(::rtl::OUString(
"DocumentMetadataAccess::storeMetadataToMedium: "
- "cannot get Storage")), *this);
+ "cannot get Storage"), *this);
}
// set MIME type of the storage
::comphelper::MediaDescriptor::const_iterator iter
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 3b48b431b294..2e256a2d20a1 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -572,7 +572,7 @@ String SfxDocumentTemplates::GetPath
uno::Reference< XCommandEnvironment > aCmdEnv;
if ( Content::create( aTemplateObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv, aTemplate ) )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aPropName( TARGET_URL );
getTextProperty_Impl( aTemplate, aPropName, aResult );
aResult = SvtPathOptions().SubstituteVariable( aResult );
}
@@ -835,7 +835,7 @@ sal_Bool SfxDocumentTemplates::CopyTo
aTransferInfo.NameClash = NameClash::OVERWRITE;
Any aArg = makeAny( aTransferInfo );
- OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( COMMAND_TRANSFER ) );
+ OUString aCmd( COMMAND_TRANSFER );
aTarget.executeCommand( aCmd, aArg );
}
@@ -898,12 +898,12 @@ sal_Bool SfxDocumentTemplates::CopyFrom
}
else
{
- OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DESKTOP ) );
+ OUString aService( SERVICENAME_DESKTOP );
uno::Reference< XComponentLoader > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( aService ),
UNO_QUERY );
Sequence< PropertyValue > aArgs( 1 );
- aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
+ aArgs[0].Name = ::rtl::OUString("Hidden");
aArgs[0].Value <<= sal_True;
INetURLObject aTemplURL( rName );
@@ -913,7 +913,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom
{
xStorable = uno::Reference< XStorable >(
xDesktop->loadComponentFromURL( aTemplURL.GetMainURL(INetURLObject::NO_DECODE),
- OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")),
+ OUString("_blank"),
0,
aArgs ),
UNO_QUERY );
@@ -965,7 +965,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom
if( Content::create( aTemplURL, aCmdEnv, aTemplCont ) )
{
OUString aTemplName;
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aPropName( TARGET_URL );
if( getTextProperty_Impl( aTemplCont, aPropName, aTemplName ) )
{
@@ -1676,7 +1676,7 @@ const OUString& DocTempl_EntryData_Impl::GetTargetURL()
if ( Content::create( GetHierarchyURL(), aCmdEnv, aRegion ) )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aPropName( TARGET_URL );
getTextProperty_Impl( aRegion, aPropName, maTargetURL );
}
@@ -1837,7 +1837,7 @@ const OUString& RegionData_Impl::GetTargetURL()
if ( Content::create( GetHierarchyURL(), aCmdEnv, aRegion ) )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
getTextProperty_Impl( aRegion, aPropName, maTargetURL );
// The targeturl must be substituted: $(baseinsturl) (#i32656#)
@@ -1974,8 +1974,8 @@ void SfxDocTemplate_Impl::AddRegion( const OUString& rTitle,
// now get the content of the region
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps(2);
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE ));
- aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ));
+ aProps[0] = OUString(TITLE );
+ aProps[1] = OUString(TARGET_URL );
try
{
@@ -2011,7 +2011,7 @@ void SfxDocTemplate_Impl::CreateFromHierarchy( Content &rTemplRoot )
{
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps(1);
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE ));
+ aProps[0] = OUString(TITLE );
try
{
@@ -2056,11 +2056,11 @@ sal_Bool SfxDocTemplate_Impl::Construct( )
uno::Reference< XMultiServiceFactory > xFactory;
xFactory = ::comphelper::getProcessServiceFactory();
- OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCINFO ) );
+ OUString aService( SERVICENAME_DOCINFO );
uno::Reference< XPersist > xInfo( xFactory->createInstance( aService ), UNO_QUERY );
mxInfo = xInfo;
- aService = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCTEMPLATES ) );
+ aService = OUString( SERVICENAME_DOCTEMPLATES );
uno::Reference< XDocumentTemplates > xTemplates( xFactory->createInstance( aService ), UNO_QUERY );
if ( xTemplates.is() )
@@ -2073,7 +2073,7 @@ sal_Bool SfxDocTemplate_Impl::Construct( )
Sequence< Any > aCompareArg(1);
*(aCompareArg.getArray()) <<= xLocalizable->getLocale();;
m_rCompareFactory = uno::Reference< XAnyCompareFactory >(
- xFactory->createInstanceWithArguments( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.AnyCompareFactory")),
+ xFactory->createInstanceWithArguments( OUString("com.sun.star.ucb.AnyCompareFactory"),
aCompareArg ),
UNO_QUERY );
@@ -2185,7 +2185,7 @@ sal_Bool SfxDocTemplate_Impl::GetTitleFromURL( const OUString& rURL,
uno::Reference< XPropertySet > aPropSet( mxInfo, UNO_QUERY );
if ( aPropSet.is() )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
+ OUString aPropName( TITLE );
Any aValue = aPropSet->getPropertyValue( aPropName );
aValue >>= aTitle;
}
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index cdf6397e389d..ecceed91d4c6 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -419,12 +419,12 @@ void SfxDocTplService_Impl::init_Impl()
// set maRootContent to the root of the templates hierarchy. Create the
// entry if necessary
- maRootURL = OUString( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_ROOT_URL ) );
+ maRootURL = OUString( TEMPLATE_ROOT_URL );
maRootURL += String( '/' );
maRootURL += aLang;
- ::rtl::OUString aTemplVersPropName( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_VERSION ) );
- ::rtl::OUString aTemplVers( RTL_CONSTASCII_USTRINGPARAM( TEMPLATE_VERSION_VALUE ) );
+ ::rtl::OUString aTemplVersPropName( TEMPLATE_VERSION );
+ ::rtl::OUString aTemplVers( TEMPLATE_VERSION_VALUE );
if ( Content::create( maRootURL, maCmdEnv, maRootContent ) )
{
uno::Any aValue;
@@ -450,7 +450,7 @@ void SfxDocTplService_Impl::init_Impl()
if ( bIsInitialized )
{
- OUString aService( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_DOCINFO ) );
+ OUString aService( SERVICENAME_DOCINFO );
try {
mxInfo = uno::Reference< XStandaloneDocumentInfo > (
mxFactory->createInstance( aService ), UNO_QUERY );
@@ -459,7 +459,7 @@ void SfxDocTplService_Impl::init_Impl()
"cannot create DocumentProperties service");
}
- aService = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_TYPEDETECTION ) );
+ aService = OUString( SERVICENAME_TYPEDETECTION );
mxType = uno::Reference< XTypeDetection > ( mxFactory->createInstance( aService ), UNO_QUERY );
getDirList();
@@ -578,7 +578,7 @@ OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName )
//-----------------------------------------------------------------------------
void SfxDocTplService_Impl::getDirList()
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_DIRLIST ) );
+ OUString aPropName( PROPERTY_DIRLIST );
Any aValue;
// Get the template dir list
@@ -593,21 +593,20 @@ void SfxDocTplService_Impl::getDirList()
uno::Reference< util::XMacroExpander > xExpander;
uno::Reference< XPropertySet > xPropSet( mxFactory, UNO_QUERY );
const rtl::OUString aPrefix(
- RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.expand:" ) );
+ "vnd.sun.star.expand:" );
if ( xPropSet.is() )
{
xPropSet->getPropertyValue(
rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) )
+ "DefaultContext" ) )
>>= xCtx;
}
if ( xCtx.is() )
{
xCtx->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/com.sun.star.util.theMacroExpander" ) ) )
+ rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) )
>>= xExpander;
OSL_ENSURE( xExpander.is(),
@@ -639,7 +638,7 @@ void SfxDocTplService_Impl::getDirList()
//-----------------------------------------------------------------------------
sal_Bool SfxDocTplService_Impl::needsUpdate()
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_NEEDSUPDATE ) );
+ OUString aPropName( PROPERTY_NEEDSUPDATE );
sal_Bool bHasProperty = sal_False;
sal_Bool bNeedsUpdate = sal_True;
Any aValue;
@@ -672,7 +671,7 @@ sal_Bool SfxDocTplService_Impl::setTitleForURL( const OUString& rURL, const OUSt
{
mxInfo->loadFromURL( rURL );
uno::Reference< XPropertySet > xPropSet( mxInfo, UNO_QUERY_THROW );
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
+ OUString aPropName( TITLE );
xPropSet->setPropertyValue( aPropName, uno::makeAny( aTitle ) );
mxInfo->storeIntoURL( rURL );
bResult = sal_True;
@@ -707,11 +706,11 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
uno::Reference< XPropertySet > aPropSet( mxInfo, UNO_QUERY );
if ( aPropSet.is() )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
+ OUString aPropName( TITLE );
Any aValue = aPropSet->getPropertyValue( aPropName );
aValue >>= aTitle;
- aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( "MIMEType" ) );
+ aPropName = OUString( "MIMEType" );
aValue = aPropSet->getPropertyValue( aPropName );
aValue >>= aType;
}
@@ -729,7 +728,7 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
uno::Reference< container::XNameAccess > xTypeDetection( mxType, uno::UNO_QUERY_THROW );
SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aDocType ) );
aType = aTypeProps.getUnpackedValueOrDefault(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),
+ ::rtl::OUString("MediaType"),
::rtl::OUString() );
}
catch( uno::Exception& )
@@ -768,17 +767,17 @@ sal_Bool SfxDocTplService_Impl::addEntry( Content& rParentFolder,
if ( ! Content::create( aLinkURL, maCmdEnv, aLink ) )
{
Sequence< OUString > aNames(3);
- aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
- aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) );
- aNames[2] = OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ aNames[0] = OUString( TITLE );
+ aNames[1] = OUString( IS_FOLDER );
+ aNames[2] = OUString( TARGET_URL );
Sequence< Any > aValues(3);
aValues[0] = makeAny( rTitle );
aValues[1] = makeAny( sal_Bool( sal_False ) );
aValues[2] = makeAny( rTargetURL );
- OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_LINK ) );
- OUString aAdditionalProp( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE ) );
+ OUString aType( TYPE_LINK );
+ OUString aAdditionalProp( PROPERTY_TYPE );
try
{
@@ -819,8 +818,8 @@ sal_Bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL,
try
{
Sequence< OUString > aNames(2);
- aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
- aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) );
+ aNames[0] = OUString( TITLE );
+ aNames[1] = OUString( IS_FOLDER );
Sequence< Any > aValues(2);
aValues[0] = makeAny( aFolderName );
@@ -829,9 +828,9 @@ sal_Bool SfxDocTplService_Impl::createFolder( const OUString& rNewFolderURL,
OUString aType;
if ( bFsysFolder )
- aType = OUString( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FOLDER ) );
+ aType = OUString( TYPE_FSYS_FOLDER );
else
- aType = OUString( RTL_CONSTASCII_USTRINGPARAM( TYPE_FOLDER ) );
+ aType = OUString( TYPE_FOLDER );
aParent.insertNewContent( aType, aNames, aValues, rNewFolder );
bCreatedFolder = sal_True;
@@ -884,14 +883,14 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU
try
{
Sequence< OUString > aNames(2);
- aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
- aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_FOLDER ) );
+ aNames[0] = OUString( TITLE );
+ aNames[1] = OUString( IS_FOLDER );
Sequence< Any > aValues(2);
aValues[0] = makeAny( aTryName );
aValues[1] = makeAny( sal_Bool( sal_True ) );
- OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FOLDER ) );
+ OUString aType( TYPE_FSYS_FOLDER );
bCreated = aParent.insertNewContent( aType, aNames, aValues, aNewFolder );
}
@@ -944,20 +943,20 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU
if ( nInd )
aTryName += ::rtl::OUString::valueOf( nInd );
if ( aExt.toChar() != '.' )
- aTryName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) );
+ aTryName += ::rtl::OUString( "." );
aTryName += aExt;
try
{
Sequence< OUString > aNames(2);
- aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
- aNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( IS_DOCUMENT ) );
+ aNames[0] = OUString( TITLE );
+ aNames[1] = OUString( IS_DOCUMENT );
Sequence< Any > aValues(2);
aValues[0] = makeAny( aTryName );
aValues[1] = makeAny( sal_Bool( sal_True ) );
- OUString aType( RTL_CONSTASCII_USTRINGPARAM( TYPE_FSYS_FILE ) );
+ OUString aType( TYPE_FSYS_FILE );
bCreated = aParent.insertNewContent( aType, aNames, aValues, aNewFile );
}
@@ -994,7 +993,7 @@ sal_Bool SfxDocTplService_Impl::removeContent( Content& rContent )
sal_Bool bRemoved = sal_False;
try
{
- OUString aCmd( RTL_CONSTASCII_USTRINGPARAM( COMMAND_DELETE ) );
+ OUString aCmd( COMMAND_DELETE );
Any aArg = makeAny( sal_Bool( sal_True ) );
rContent.executeCommand( aCmd, aArg );
@@ -1233,7 +1232,7 @@ void SfxDocTplService_Impl::doUpdate()
{
::osl::MutexGuard aGuard( maMutex );
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_NEEDSUPDATE ) );
+ OUString aPropName( PROPERTY_NEEDSUPDATE );
Any aValue;
aValue <<= sal_True;
@@ -1277,7 +1276,7 @@ void SfxDocTplService_Impl::doUpdate()
Content aGroup;
if ( Content::create( pGroup->getHierarchyURL(), maCmdEnv, aGroup ) )
setProperty( aGroup,
- OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) ),
+ OUString( TARGET_DIR_URL ),
makeAny( pGroup->getTargetURL() ) );
size_t nCount = pGroup->count();
@@ -1318,7 +1317,7 @@ void SfxDocTplService_Impl::doUpdate()
uno::Sequence< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDir_Impl( const ::rtl::OUString& aUserPath )
{
INetURLObject aLocObj( aUserPath );
- aLocObj.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "groupuinames.xml" ) ), false,
+ aLocObj.insertName( ::rtl::OUString( "groupuinames.xml" ), false,
INetURLObject::LAST_SEGMENT, true,
INetURLObject::ENCODE_ALL );
Content aLocContent;
@@ -1419,11 +1418,11 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
sal_Bool bResult = sal_False;
try {
uno::Reference< beans::XPropertySet > xTempFile(
- mxFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ),
+ mxFactory->createInstance( ::rtl::OUString("com.sun.star.io.TempFile") ),
uno::UNO_QUERY_THROW );
::rtl::OUString aTempURL;
- uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")) );
+ uno::Any aUrl = xTempFile->getPropertyValue( ::rtl::OUString("Uri") );
aUrl >>= aTempURL;
uno::Reference< io::XStream > xStream( xTempFile, uno::UNO_QUERY_THROW );
@@ -1442,7 +1441,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
Content aSourceContent( aTempURL, maCmdEnv );
aTargetContent.transferContent( aSourceContent,
InsertOperation_COPY,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "groupuinames.xml" ) ),
+ ::rtl::OUString( "groupuinames.xml" ),
ucb::NameClash::OVERWRITE );
bResult = sal_True;
}
@@ -1473,7 +1472,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
aResultURL,
aNewFolder )
&& !CreateNewUniqueFolderWithPrefix( aTargetPath,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserGroup" ) ),
+ ::rtl::OUString( "UserGroup" ),
aNewFolderName,
aResultURL,
aNewFolder ) )
@@ -1489,7 +1488,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
}
// Now set the target url for this group and we are done
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
Any aValue = makeAny( aResultURL );
if ( ! setProperty( aGroup, aPropName, aValue ) )
@@ -1551,7 +1550,7 @@ sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName )
aNewFolderURL,
aNewFolder )
&& !CreateNewUniqueFolderWithPrefix( aUserPath,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserGroup" ) ),
+ ::rtl::OUString( "UserGroup" ),
aNewFolderName,
aNewFolderURL,
aNewFolder ) )
@@ -1572,7 +1571,7 @@ sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName )
}
// Now set the target url for this group and we are done
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
Any aValue = makeAny( aNewFolderURL );
if ( ! setProperty( aNewGroup, aPropName, aValue ) )
@@ -1607,7 +1606,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
if ( Content::create( aGroupURL, maCmdEnv, aGroup ) )
{
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
Any aValue;
OUString aGroupTargetURL;
@@ -1632,7 +1631,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps( 1 );
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ));
+ aProps[0] = OUString(TARGET_URL );
try
{
@@ -1723,7 +1722,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
OUString aGroupTargetURL;
// there is no need to check whether target dir url is in target path, since if the target path is changed
// the target dir url should be already generated new
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
Any aValue;
if ( getProperty( aGroup, aPropName, aValue ) )
aValue >>= aGroupTargetURL;
@@ -1749,7 +1748,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps( 1 );
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ));
+ aProps[0] = OUString(TARGET_URL );
ResultSetInclude eInclude = INCLUDE_DOCUMENTS_ONLY;
xResultSet = aGroup.createCursor( aProps, eInclude );
@@ -1783,7 +1782,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
rNewName ) )
{
// rename the group in the hierarchy
- OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
+ OUString aTitleProp( TITLE );
Any aTitleValue;
aTitleValue <<= rNewName;
@@ -1818,7 +1817,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
return sal_False;
::rtl::OUString aGroupTargetURL;
- ::rtl::OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ ::rtl::OUString aPropName( TARGET_DIR_URL );
Any aValue;
if ( getProperty( aGroup, aPropName, aValue ) )
aValue >>= aGroupTargetURL;
@@ -1835,7 +1834,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
if ( Content::create( aTemplateURL, maCmdEnv, aTemplateToRemove ) )
{
- OUString aTargetTemplPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aTargetTemplPropName( TARGET_URL );
bRemoveOldTemplateContent = sal_True;
if ( getProperty( aTemplateToRemove, aTargetTemplPropName, aValue ) )
@@ -1855,7 +1854,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
// get document service name
uno::Reference< frame::XModuleManager > xModuleManager(
xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ),
+ ::rtl::OUString("com.sun.star.frame.ModuleManager") ),
uno::UNO_QUERY_THROW );
sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) );
if ( sDocServiceName.isEmpty() )
@@ -1866,18 +1865,18 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ),
+ ::rtl::OUString("com.sun.star.configuration.ConfigurationProvider") ),
uno::UNO_QUERY_THROW );
uno::Sequence< uno::Any > aArgs( 1 );
beans::PropertyValue aPathProp;
- aPathProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
- aPathProp.Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Setup/Office/Factories/" ) );
+ aPathProp.Name = ::rtl::OUString("nodepath");
+ aPathProp.Value <<= ::rtl::OUString( "/org.openoffice.Setup/Office/Factories/" );
aArgs[0] <<= aPathProp;
uno::Reference< container::XNameAccess > xSOFConfig(
xConfigProvider->createInstanceWithArguments(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
+ ::rtl::OUString("com.sun.star.configuration.ConfigurationAccess"),
aArgs ),
uno::UNO_QUERY_THROW );
@@ -1886,14 +1885,14 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
if ( !xApplConfig.is() )
throw uno::RuntimeException();
- xApplConfig->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualTemplateFilter" ) ) ) >>= aFilterName;
+ xApplConfig->getByName( ::rtl::OUString( "ooSetupFactoryActualTemplateFilter" ) ) >>= aFilterName;
if ( aFilterName.isEmpty() )
throw uno::RuntimeException();
// find the related type name
::rtl::OUString aTypeName;
uno::Reference< container::XNameAccess > xFilterFactory(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory")) ),
+ xFactory->createInstance( ::rtl::OUString("com.sun.star.document.FilterFactory") ),
uno::UNO_QUERY_THROW );
uno::Sequence< beans::PropertyValue > aFilterData;
@@ -1910,16 +1909,16 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
mxType.is() ?
uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) :
uno::Reference< container::XNameAccess >(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ),
+ xFactory->createInstance( ::rtl::OUString("com.sun.star.document.TypeDetection") ),
uno::UNO_QUERY_THROW );
SequenceAsHashMap aTypeProps( xTypeDetection->getByName( aTypeName ) );
uno::Sequence< ::rtl::OUString > aAllExt =
- aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")), Sequence< ::rtl::OUString >() );
+ aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString("Extensions"), Sequence< ::rtl::OUString >() );
if ( !aAllExt.getLength() )
throw uno::RuntimeException();
- ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), ::rtl::OUString() );
+ ::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString("MediaType"), ::rtl::OUString() );
::rtl::OUString aExt = aAllExt[0];
if ( aMediaType.isEmpty() || aExt.isEmpty() )
@@ -1937,7 +1936,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
::rtl::OUString aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, rTemplateName, aExt );
if ( aNewTemplateTargetURL.isEmpty() )
{
- aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserTemplate" ) ), aExt );
+ aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, ::rtl::OUString( "UserTemplate" ), aExt );
if ( aNewTemplateTargetURL.isEmpty() )
throw uno::RuntimeException();
@@ -1945,9 +1944,9 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
// store template
uno::Sequence< PropertyValue > aStoreArgs( 2 );
- aStoreArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
+ aStoreArgs[0].Name = ::rtl::OUString("FilterName");
aStoreArgs[0].Value <<= aFilterName;
- aStoreArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
+ aStoreArgs[1].Name = ::rtl::OUString("DocumentTitle");
aStoreArgs[1].Value <<= rTemplateName;
::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
@@ -2019,7 +2018,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
// get the target url of the group
OUString aTargetURL;
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aPropName( TARGET_DIR_URL );
Any aValue;
if ( getProperty( aGroup, aPropName, aValue ) )
@@ -2097,7 +2096,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
Content aResultContent;
if ( Content::create( aNewTemplateTargetURL, xEnv, aResultContent ) )
{
- ::rtl::OUString aPropertyName( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) );
+ ::rtl::OUString aPropertyName( "IsReadOnly" );
uno::Any aProperty;
sal_Bool bReadOnly = sal_False;
if ( getProperty( aResultContent, aPropertyName, aProperty ) && ( aProperty >>= bReadOnly ) && bReadOnly )
@@ -2169,7 +2168,7 @@ sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
// get the target URL from the template
OUString aTargetURL;
- OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aPropName( TARGET_URL );
Any aValue;
if ( getProperty( aTemplate, aPropName, aValue ) )
@@ -2232,7 +2231,7 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
return sal_False;
OUString aTemplateTargetURL;
- OUString aTargetProp( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ OUString aTargetProp( TARGET_URL );
Any aTargetValue;
if ( getProperty( aTemplate, aTargetProp, aTargetValue ) )
@@ -2242,7 +2241,7 @@ sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
return sal_False;
// rename the template entry in the cache
- OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM( TITLE ) );
+ OUString aTitleProp( TITLE );
Any aTitleValue;
aTitleValue <<= rNewName;
@@ -2454,9 +2453,9 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList,
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps(3);
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE ));
- aProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ));
- aProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE ));
+ aProps[0] = OUString(TITLE );
+ aProps[1] = OUString(TARGET_URL );
+ aProps[2] = OUString(PROPERTY_TYPE );
try
{
@@ -2565,7 +2564,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
Content aContent;
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps(1);
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE ));
+ aProps[0] = OUString(TITLE );
try
{
@@ -2618,7 +2617,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList,
// when scanning the file system, we have to add the 'standard' group, too
if ( ! bHierarchy )
{
- OUString aUIStdTitle = getLongName( OUString( RTL_CONSTASCII_USTRINGPARAM( STANDARD_FOLDER ) ) );
+ OUString aUIStdTitle = getLongName( OUString( STANDARD_FOLDER ) );
addFsysGroup( rList, ::rtl::OUString(), aUIStdTitle, aTargetURL, bWriteableContent );
}
@@ -2632,7 +2631,7 @@ void SfxDocTplService_Impl::createFromContent( GroupList_Impl& rList,
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps(1);
- aProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( TITLE ));
+ aProps[0] = OUString(TITLE );
try
{
@@ -2724,13 +2723,13 @@ void SfxDocTplService_Impl::updateData( DocTemplates_EntryData_Impl *pData )
if ( pData->getUpdateType() )
{
- aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( PROPERTY_TYPE ) );
+ aPropName = OUString( PROPERTY_TYPE );
setProperty( aTemplate, aPropName, makeAny( pData->getType() ) );
}
if ( pData->getUpdateLink() )
{
- aPropName = OUString( RTL_CONSTASCII_USTRINGPARAM( TARGET_URL ) );
+ aPropName = OUString( TARGET_URL );
setProperty( aTemplate, aPropName, makeAny( pData->getTargetURL() ) );
}
}
@@ -2738,7 +2737,7 @@ void SfxDocTplService_Impl::updateData( DocTemplates_EntryData_Impl *pData )
//-----------------------------------------------------------------------------
void SfxDocTplService_Impl::addGroupToHierarchy( GroupData_Impl *pGroup )
{
- OUString aAdditionalProp( RTL_CONSTASCII_USTRINGPARAM( TARGET_DIR_URL ) );
+ OUString aAdditionalProp( TARGET_DIR_URL );
Content aGroup;
INetURLObject aNewGroupObj( maRootURL );
@@ -2878,7 +2877,7 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
{
xPropSet->getPropertyValue(
rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) )
+ "DefaultContext" ) )
>>= xCtx;
}
@@ -2889,9 +2888,9 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
if ( xCtx.is() )
{
xCtx->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ rtl::OUString(
"/singletons/"
- "com.sun.star.util.theOfficeInstallationDirectories" ) ) )
+ "com.sun.star.util.theOfficeInstallationDirectories" ) )
>>= mxOfficeInstDirs;
}