summaryrefslogtreecommitdiff
path: root/sot/source/sdstor
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-13 15:17:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-13 20:11:36 +0200
commita9cf09844ee35610cbf102895014a7f03f8de100 (patch)
tree24094bcbacbc16b3988bb7c296d6fcfb4c78be12 /sot/source/sdstor
parent16a9092595761acca0392b4e177b309371d04f15 (diff)
loplugin:ostr in sot
Change-Id: I782a071672b8c1fa2a843637fc5d7e993dbe0ef2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot/source/sdstor')
-rw-r--r--sot/source/sdstor/stgelem.cxx2
-rw-r--r--sot/source/sdstor/stgole.cxx4
-rw-r--r--sot/source/sdstor/storage.cxx6
-rw-r--r--sot/source/sdstor/ucbstorage.cxx34
4 files changed, 23 insertions, 23 deletions
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index ff41d8d70f9c..a4d06eb55d5a 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -308,7 +308,7 @@ void StgEntry::Init()
static OUString ToUpperUnicode( const OUString & rStr )
{
// I don't know the locale, so en_US is hopefully fine
- static CharClass aCC( LanguageTag( css::lang::Locale( "en", "US", "" )) );
+ static CharClass aCC( LanguageTag( css::lang::Locale( u"en"_ustr, u"US"_ustr, u""_ustr )) );
return aCC.uppercase( rStr );
}
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index ac23f7a14555..98743626f491 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -91,7 +91,7 @@ void StgInternalStream::Commit()
///////////////////////// class StgCompObjStream
StgCompObjStream::StgCompObjStream( BaseStorage& rStg, bool bWr )
- : StgInternalStream( rStg, "\1CompObj", bWr )
+ : StgInternalStream( rStg, u"\1CompObj"_ustr, bWr )
{
}
@@ -158,7 +158,7 @@ bool StgCompObjStream::Store()
/////////////////////////// class StgOleStream
StgOleStream::StgOleStream( BaseStorage& rStg )
- : StgInternalStream( rStg, "\1Ole", true )
+ : StgInternalStream( rStg, u"\1Ole"_ustr, true )
{
}
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index a91c6f516a0b..cb9569db498e 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -633,8 +633,8 @@ rtl::Reference<SotStorage> SotStorage::OpenOLEStorage( const css::uno::Reference
if ( nMode & StreamMode::WRITE )
{
uno::Reference < beans::XPropertySet > xStreamProps( xStream, uno::UNO_QUERY_THROW );
- xStreamProps->setPropertyValue( "MediaType",
- uno::Any( OUString( "application/vnd.sun.star.oleobject" ) ) );
+ xStreamProps->setPropertyValue( u"MediaType"_ustr,
+ uno::Any( u"application/vnd.sun.star.oleobject"_ustr ) );
}
pStream = utl::UcbStreamHelper::CreateStream( xStream );
@@ -658,7 +658,7 @@ SotClipboardFormatId SotStorage::GetFormatID( const css::uno::Reference < css::e
OUString aMediaType;
try
{
- xProps->getPropertyValue("MediaType") >>= aMediaType;
+ xProps->getPropertyValue(u"MediaType"_ustr) >>= aMediaType;
}
catch (uno::Exception const&)
{
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 41e134a345a6..a6aa800e2436 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1051,7 +1051,7 @@ sal_Int16 UCBStorageStream_Impl::Commit()
// create wrapper to stream that is only used while reading inside package component
aArg.Data.set(new FileStreamWrapper_Impl(m_aTempURL));
aArg.ReplaceExisting = true;
- m_pContent->executeCommand( "insert", Any(aArg) );
+ m_pContent->executeCommand( u"insert"_ustr, Any(aArg) );
// wrapper now controls lifetime of temporary file
m_aTempURL.clear();
@@ -1600,7 +1600,7 @@ void UCBStorage_Impl::Init()
{
// get the manifest information from the package
try {
- Any aAny = m_oContent->getPropertyValue("MediaType");
+ Any aAny = m_oContent->getPropertyValue(u"MediaType"_ustr);
OUString aTmp;
if ( ( aAny >>= aTmp ) && !aTmp.isEmpty() )
m_aContentType = m_aOriginalContentType = aTmp;
@@ -1676,7 +1676,7 @@ void UCBStorage_Impl::ReadContent()
return;
// create cursor for access to children
- Reference< XResultSet > xResultSet = m_oContent->createCursor( { "Title", "IsFolder", "MediaType", "Size" }, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
+ Reference< XResultSet > xResultSet = m_oContent->createCursor( { u"Title"_ustr, u"IsFolder"_ustr, u"MediaType"_ustr, u"Size"_ustr }, ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
Reference< XRow > xRow( xResultSet, UNO_QUERY );
if ( xResultSet.is() )
{
@@ -1720,7 +1720,7 @@ void UCBStorage_Impl::ReadContent()
::ucbhelper::Content aContent( aName, xComEnv, comphelper::getProcessComponentContext() );
OUString aMediaType;
- Any aAny = aContent.getPropertyValue("MediaType");
+ Any aAny = aContent.getPropertyValue(u"MediaType"_ustr);
if ( ( aAny >>= aMediaType ) && ( aMediaType == "application/vnd.sun.star.oleobject" ) )
pElement->m_bIsStorage = true;
else if ( aMediaType.isEmpty() )
@@ -1875,8 +1875,8 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert
if ( !m_bIsRoot )
aPath += m_aName;
aPath += "/";
- Sequence < PropertyValue > aProps{ comphelper::makePropertyValue("MediaType", m_aContentType),
- comphelper::makePropertyValue("FullPath", aPath) };
+ Sequence < PropertyValue > aProps{ comphelper::makePropertyValue(u"MediaType"_ustr, m_aContentType),
+ comphelper::makePropertyValue(u"FullPath"_ustr, aPath) };
pSequence[nProps++] = aProps;
if ( m_bIsRoot )
@@ -1894,8 +1894,8 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert
{
// properties of streams
OUString aElementPath = aPath + pElement->m_aName;
- aProps = { comphelper::makePropertyValue("MediaType", pElement->GetContentType()),
- comphelper::makePropertyValue("FullPath", aElementPath) };
+ aProps = { comphelper::makePropertyValue(u"MediaType"_ustr, pElement->GetContentType()),
+ comphelper::makePropertyValue(u"FullPath"_ustr, aElementPath) };
pSequence[ nProps++ ] = aProps;
}
}
@@ -1935,7 +1935,7 @@ bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
continue;
Content aNewFolder;
- if ( !pContent->insertNewContent( rCurr.Type, { "Title" }, { Any(m_aName) }, aNewFolder ) )
+ if ( !pContent->insertNewContent( rCurr.Type, { u"Title"_ustr }, { Any(m_aName) }, aNewFolder ) )
continue;
// remove old content, create an "empty" new one and initialize it with the new inserted
@@ -1996,7 +1996,7 @@ sal_Int16 UCBStorage_Impl::Commit()
// first remove all open stream handles
if (pContent && (!pElement->m_xStream.is() || pElement->m_xStream->Clear()))
{
- pContent->executeCommand( "delete", Any( true ) );
+ pContent->executeCommand( u"delete"_ustr, Any( true ) );
nRet = COMMIT_RESULT_SUCCESS;
}
else
@@ -2031,7 +2031,7 @@ sal_Int16 UCBStorage_Impl::Commit()
pElement->m_xStream->m_aContentType = "application/vnd.sun.star.oleobject";
Any aValue;
aValue <<= true;
- pElement->m_xStream->m_pContent->setPropertyValue("Encrypted", aValue );
+ pElement->m_xStream->m_pContent->setPropertyValue(u"Encrypted"_ustr, aValue );
}
pContent = pElement->GetContent();
@@ -2041,14 +2041,14 @@ sal_Int16 UCBStorage_Impl::Commit()
{
// name ( title ) of the element was changed
nLocalRet = COMMIT_RESULT_SUCCESS;
- pContent->setPropertyValue("Title", Any(pElement->m_aName) );
+ pContent->setPropertyValue(u"Title"_ustr, Any(pElement->m_aName) );
}
if (pContent && pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType())
{
// mediatype of the element was changed
nLocalRet = COMMIT_RESULT_SUCCESS;
- pContent->setPropertyValue("MediaType", Any(pElement->GetContentType()) );
+ pContent->setPropertyValue(u"MediaType"_ustr, Any(pElement->GetContentType()) );
}
if ( nLocalRet != COMMIT_RESULT_NOTHING_TO_DO )
@@ -2095,14 +2095,14 @@ sal_Int16 UCBStorage_Impl::Commit()
// clipboard format and ClassId will be retrieved from the media type when the file is loaded again
Any aType;
aType <<= m_aContentType;
- m_oContent->setPropertyValue("MediaType", aType );
+ m_oContent->setPropertyValue(u"MediaType"_ustr, aType );
if ( m_bIsLinked )
{
// write a manifest file
// first create a subfolder "META-inf"
Content aNewSubFolder;
- bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_oContent, "META-INF", aNewSubFolder );
+ bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_oContent, u"META-INF"_ustr, aNewSubFolder );
if ( bRet )
{
// create a stream to write the manifest file - use a temp file
@@ -2128,7 +2128,7 @@ sal_Int16 UCBStorage_Impl::Commit()
xWriter = nullptr;
xOutputStream = nullptr;
pTempFile.reset();
- aNewSubFolder.transferContent( aSource, InsertOperation::Move, "manifest.xml", NameClash::OVERWRITE );
+ aNewSubFolder.transferContent( aSource, InsertOperation::Move, u"manifest.xml"_ustr, NameClash::OVERWRITE );
}
}
else
@@ -2139,7 +2139,7 @@ sal_Int16 UCBStorage_Impl::Commit()
#endif
// force writing
Any aAny;
- m_oContent->executeCommand( "flush", aAny );
+ m_oContent->executeCommand( u"flush"_ustr, aAny );
if ( m_pSource != nullptr )
{
std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READ ));