diff options
-rw-r--r-- | dtrans/source/win32/dtobj/DataFmtTransl.cxx | 14 | ||||
-rw-r--r-- | dtrans/source/win32/ftransl/ftransl.cxx | 2 | ||||
-rw-r--r-- | embedserv/source/embed/ed_ipersiststr.cxx | 28 | ||||
-rw-r--r-- | fpicker/source/win32/WinImplHelper.cxx | 6 | ||||
-rw-r--r-- | sal/osl/w32/path_helper.cxx | 4 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.cxx | 37 |
6 files changed, 35 insertions, 56 deletions
diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/dtrans/source/win32/dtobj/DataFmtTransl.cxx index b8513c6e75d4..f0a1601f8dfb 100644 --- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx +++ b/dtrans/source/win32/dtobj/DataFmtTransl.cxx @@ -47,12 +47,6 @@ const Type CPPUTYPE_OUSTRING = cppu::UnoType<OUString>::get(); const Type CPPUTYPE_SEQSALINT8 = cppu::UnoType<Sequence< sal_Int8>>::get(); const sal_Int32 MAX_CLIPFORMAT_NAME = 256; -const OUString TEXT_PLAIN_CHARSET ("text/plain;charset="); -const OUString HPNAME_OEM_ANSI_TEXT ("OEM/ANSI Text"); - -const OUString HTML_FORMAT_NAME_WINDOWS ("HTML Format"); -const OUString HTML_FORMAT_NAME_SOFFICE ("HTML (HyperText Markup Language)"); - CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext >& rxContext ) { m_XDataFormatTranslator = DataFormatTranslator::create( rxContext ); @@ -111,10 +105,10 @@ DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const FORMATETC& a if ( isOemOrAnsiTextFormat( aClipformat ) ) { - aFlavor.MimeType = TEXT_PLAIN_CHARSET; + aFlavor.MimeType = "text/plain;charset="; aFlavor.MimeType += getTextCharsetFromLCID( lcid, aClipformat ); - aFlavor.HumanPresentableName = HPNAME_OEM_ANSI_TEXT; + aFlavor.HumanPresentableName = "OEM/ANSI Text"; aFlavor.DataType = CPPUTYPE_SEQSALINT8; } else if ( CF_INVALID != aClipformat ) @@ -222,13 +216,13 @@ bool CDataFormatTranslator::isTextFormat( CLIPFORMAT cf ) bool CDataFormatTranslator::isHTMLFormat( CLIPFORMAT cf ) { OUString clipFormatName = getClipboardFormatName( cf ); - return ( clipFormatName == HTML_FORMAT_NAME_WINDOWS ); + return ( clipFormatName == "HTML Format" ); } bool CDataFormatTranslator::isTextHtmlFormat( CLIPFORMAT cf ) { OUString clipFormatName = getClipboardFormatName( cf ); - return clipFormatName.equalsIgnoreAsciiCase( HTML_FORMAT_NAME_SOFFICE ); + return clipFormatName.equalsIgnoreAsciiCase( "HTML (HyperText Markup Language)" ); } OUString CDataFormatTranslator::getTextCharsetFromLCID( LCID lcid, CLIPFORMAT aClipformat ) diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx index 991bc2d2c10f..0a40a5b75b72 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -34,7 +34,7 @@ #define CPPUTYPE_SEQSALINT8 cppu::UnoType<Sequence< sal_Int8 >>::get() #define CPPUTYPE_DEFAULT CPPUTYPE_SEQSALINT8 -const OUString Windows_FormatName ("windows_formatname"); +const char Windows_FormatName[] = "windows_formatname"; const css::uno::Type CppuType_ByteSequence = cppu::UnoType<css::uno::Sequence<sal_Int8>>::get(); const css::uno::Type CppuType_String = ::cppu::UnoType<OUString>::get(); diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx index 905055cc9513..2302bc2380ce 100644 --- a/embedserv/source/embed/ed_ipersiststr.cxx +++ b/embedserv/source/embed/ed_ipersiststr.cxx @@ -56,8 +56,8 @@ const sal_Int32 nConstBufferSize = 32000; using namespace ::com::sun::star; -const OUString aOfficeEmbedStreamName( "package_stream" ); -const OUString aExtentStreamName( "properties_stream" ); +const wchar_t aOfficeEmbedStreamName[] = L"package_stream"; +const wchar_t aExtentStreamName[] = L"properties_stream"; static uno::Reference< io::XInputStream > createTempXInStreamFromIStream( uno::Reference< lang::XMultiServiceFactory > const & xFactory, @@ -430,7 +430,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg ) if ( hr == S_OK ) { - hr = pStg->CreateStream( o3tl::toW(aOfficeEmbedStreamName.getStr()), + hr = pStg->CreateStream( aOfficeEmbedStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -438,7 +438,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg ) if ( hr == S_OK && m_pOwnStream ) { - hr = pStg->CreateStream( o3tl::toW(aExtentStreamName.getStr()), + hr = pStg->CreateStream( aExtentStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -484,7 +484,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg ) if ( FAILED( hr ) ) return E_FAIL; DWORD nStreamMode = aStat.grfMode; - hr = pStg->OpenStream( o3tl::toW(aOfficeEmbedStreamName.getStr()), + hr = pStg->OpenStream( aOfficeEmbedStreamName, nullptr, nStreamMode & 0x73, 0, @@ -493,7 +493,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg ) if ( SUCCEEDED( hr ) ) { - hr = pStg->OpenStream( o3tl::toW(aExtentStreamName.getStr()), + hr = pStg->OpenStream( aExtentStreamName, nullptr, nStreamMode & 0x73, 0, @@ -566,8 +566,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg ) { m_pOwnStream = CComPtr< IStream >(); m_pExtStream = CComPtr< IStream >(); - hr = pStg->DestroyElement( o3tl::toW(aOfficeEmbedStreamName.getStr()) ); - hr = pStg->DestroyElement( o3tl::toW(aExtentStreamName.getStr()) ); + hr = pStg->DestroyElement( aOfficeEmbedStreamName ); + hr = pStg->DestroyElement( aExtentStreamName ); OSL_ENSURE( SUCCEEDED( hr ), "Can not destroy created stream!" ); if ( FAILED( hr ) ) @@ -596,14 +596,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Save( IStorage *pStgSave, if ( FAILED( hr ) ) return E_FAIL; DWORD nStreamMode = aStat.grfMode; - hr = pStgSave->CreateStream( o3tl::toW(aOfficeEmbedStreamName.getStr()), + hr = pStgSave->CreateStream( aOfficeEmbedStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, &pTargetStream ); if ( FAILED( hr ) || !pTargetStream ) return E_FAIL; - hr = pStgSave->CreateStream( o3tl::toW(aExtentStreamName.getStr()), + hr = pStgSave->CreateStream( aExtentStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, @@ -691,14 +691,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::SaveCompleted( IStorage *p if ( FAILED( hr ) ) return E_OUTOFMEMORY; DWORD nStreamMode = aStat.grfMode; - hr = m_pMasterStorage->OpenStream( o3tl::toW(aOfficeEmbedStreamName.getStr()), + hr = m_pMasterStorage->OpenStream( aOfficeEmbedStreamName, nullptr, nStreamMode & 0x73, 0, &m_pOwnStream ); if ( FAILED( hr ) || !m_pOwnStream ) return E_OUTOFMEMORY; - hr = m_pMasterStorage->OpenStream( o3tl::toW(aExtentStreamName.getStr()), + hr = m_pMasterStorage->OpenStream( aExtentStreamName, nullptr, nStreamMode & 0x73, 0, @@ -752,14 +752,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileNam hr = m_pMasterStorage->SetClass( m_guid ); if ( FAILED( hr ) ) return E_FAIL; - hr = m_pMasterStorage->CreateStream( o3tl::toW(aOfficeEmbedStreamName.getStr()), + hr = m_pMasterStorage->CreateStream( aOfficeEmbedStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, &m_pOwnStream ); if ( FAILED( hr ) || !m_pOwnStream ) return E_FAIL; - hr = m_pMasterStorage->CreateStream( o3tl::toW(aExtentStreamName.getStr()), + hr = m_pMasterStorage->CreateStream( aExtentStreamName, STGM_CREATE | ( nStreamMode & 0x73 ), 0, 0, diff --git a/fpicker/source/win32/WinImplHelper.cxx b/fpicker/source/win32/WinImplHelper.cxx index ab1dcbe007a9..5d6e20d92319 100644 --- a/fpicker/source/win32/WinImplHelper.cxx +++ b/fpicker/source/win32/WinImplHelper.cxx @@ -30,9 +30,7 @@ using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; -const OUString TILDE( "~" ); const sal_Unicode TILDE_SIGN = L'~'; -const OUString AMPERSAND( "&" ); const sal_Unicode AMPERSAND_SIGN = L'&'; // OS NAME Platform Major Minor @@ -113,7 +111,7 @@ OUString SOfficeToWindowsLabel( const OUString& aSOLabel ) { OUString aWinLabel = aSOLabel; - if ( (aWinLabel.indexOf( TILDE ) > -1) || (aWinLabel.indexOf( AMPERSAND ) > -1) ) + if ( (aWinLabel.indexOf( TILDE_SIGN ) > -1) || (aWinLabel.indexOf( AMPERSAND_SIGN ) > -1) ) { sal_Int32 nStrLen = aWinLabel.getLength( ); @@ -142,7 +140,7 @@ OUString WindowsToSOfficeLabel( const OUString& aWinLabel ) { OUString aSOLabel = aWinLabel; - if ( (aSOLabel.indexOf( TILDE ) > -1) || (aSOLabel.indexOf( AMPERSAND ) > -1) ) + if ( (aSOLabel.indexOf( TILDE_SIGN ) > -1) || (aSOLabel.indexOf( AMPERSAND_SIGN ) > -1) ) { sal_Int32 nStrLen = aSOLabel.getLength( ); diff --git a/sal/osl/w32/path_helper.cxx b/sal/osl/w32/path_helper.cxx index 9538254659dd..eeb45ce885be 100644 --- a/sal/osl/w32/path_helper.cxx +++ b/sal/osl/w32/path_helper.cxx @@ -25,8 +25,8 @@ #include <algorithm> #include <wchar.h> -const OUString BACKSLASH ("\\"); -const OUString SLASH ("/"); +const OUStringLiteral BACKSLASH ("\\"); +const OUStringLiteral SLASH ("/"); void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath) { diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 97c040321519..205b3eb5344d 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -56,19 +56,6 @@ using css::system::XSimpleMailMessage2; using css::system::SimpleMailClientFlags::NO_USER_INTERFACE; using css::system::SimpleMailClientFlags::NO_LOGON_DIALOG; -const OUString TO("--to"); -const OUString CC("--cc"); -const OUString BCC("--bcc"); -const OUString FROM("--from"); -const OUString SUBJECT("--subject"); -const OUString BODY("--body"); -const OUString ATTACH("--attach"); -const OUString ATTACH_NAME("--attach-name"); -const OUString FLAG_MAPI_DIALOG("--mapi-dialog"); -const OUString FLAG_MAPI_LOGON_UI("--mapi-logon-ui"); -const OUString FLAG_LANGTAG("--langtag"); -const OUString FLAG_BOOTSTRAP("--bootstrap"); - namespace /* private */ { /** @internal @@ -263,7 +250,7 @@ void CSmplMailClient::assembleCommandLine( OUString body = xMessage->getBody(); if (body.getLength()>0) { - rCommandArgs.push_back(BODY); + rCommandArgs.push_back("--body"); rCommandArgs.push_back(body); } } @@ -271,35 +258,35 @@ void CSmplMailClient::assembleCommandLine( OUString to = xSimpleMailMessage->getRecipient(); if (to.getLength() > 0) { - rCommandArgs.push_back(TO); + rCommandArgs.push_back("--to"); rCommandArgs.push_back(to); } const Sequence<OUString> ccRecipients = xSimpleMailMessage->getCcRecipient(); for (OUString const & s : ccRecipients) { - rCommandArgs.push_back(CC); + rCommandArgs.push_back("--cc"); rCommandArgs.push_back(s); } const Sequence<OUString> bccRecipients = xSimpleMailMessage->getBccRecipient(); for (OUString const & s : bccRecipients) { - rCommandArgs.push_back(BCC); + rCommandArgs.push_back("--bcc"); rCommandArgs.push_back(s); } OUString from = xSimpleMailMessage->getOriginator(); if (from.getLength() > 0) { - rCommandArgs.push_back(FROM); + rCommandArgs.push_back("--from"); rCommandArgs.push_back(from); } OUString subject = xSimpleMailMessage->getSubject(); if (subject.getLength() > 0) { - rCommandArgs.push_back(SUBJECT); + rCommandArgs.push_back("--subject"); rCommandArgs.push_back(subject); } @@ -316,22 +303,22 @@ void CSmplMailClient::assembleCommandLine( static_cast<XSimpleMailClient*>(this), 1); - rCommandArgs.push_back(ATTACH); + rCommandArgs.push_back("--attach"); rCommandArgs.push_back(sysPath); if (!sDisplayName.isEmpty()) { - rCommandArgs.push_back(ATTACH_NAME); + rCommandArgs.push_back("--attach-name"); rCommandArgs.push_back(sDisplayName); } } if (!(aFlag & NO_USER_INTERFACE)) - rCommandArgs.push_back(FLAG_MAPI_DIALOG); + rCommandArgs.push_back("--mapi-dialog"); if (!(aFlag & NO_LOGON_DIALOG)) - rCommandArgs.push_back(FLAG_MAPI_LOGON_UI); + rCommandArgs.push_back("--mapi-logon-ui"); - rCommandArgs.push_back(FLAG_LANGTAG); + rCommandArgs.push_back("--langtag"); rCommandArgs.push_back(SvtSysLocale().GetUILanguageTag().getBcp47()); rtl::Bootstrap aBootstrap; @@ -339,7 +326,7 @@ void CSmplMailClient::assembleCommandLine( aBootstrap.getIniName(sBootstrapPath); if (!sBootstrapPath.isEmpty()) { - rCommandArgs.push_back(FLAG_BOOTSTRAP); + rCommandArgs.push_back("--bootstrap"); rCommandArgs.push_back(sBootstrapPath); } |