diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-06 07:45:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-06 13:51:10 +0200 |
commit | 05050cdb23de586870bf479a9df5ced06828d498 (patch) | |
tree | a34c3bba9a921a5e9abf23d5757c15dfaea0ceac /sfx2 | |
parent | 8f266781a6bd6a629bce65c0f613683047c9a794 (diff) |
use the new OUString::fromUtf8 method
Change-Id: I771004b7ccab3344a67e827e45bc34c22ffa5f77
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconunx.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/bastyp/helper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/mieclip.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/msg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 12 |
11 files changed, 21 insertions, 27 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index e2cb96804f0d..ba98e80d29a5 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -292,7 +292,7 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) if (!rInfo.aModule.isEmpty()) sName = rInfo.aModule + "/" + sName; SvtViewOptions aWinOpt(E_WINDOW, sName); - aWinOpt.SetWindowState(OStringToOUString(rInfo.aWinState, RTL_TEXTENCODING_UTF8)); + aWinOpt.SetWindowState(OUString::fromUtf8(rInfo.aWinState)); ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); aSeq[0].Name = "Data"; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index e9cab42faad7..612f98531782 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -455,7 +455,7 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p while ( pParent ) { aNewHelpId = pParent->GetHelpId(); - sHelpText = SfxHelp_Impl::GetHelpText( OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName ); + sHelpText = SfxHelp_Impl::GetHelpText( OUString::fromUtf8(aNewHelpId), sModuleName ); if (!sHelpText.isEmpty()) pParent = NULL; else @@ -476,7 +476,7 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* p if ( !aNewHelpId.isEmpty() ) { sHelpText += " - "; - sHelpText += OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8); + sHelpText += OUString::fromUtf8(aNewHelpId); } } @@ -568,7 +568,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const while ( pParent ) { OString aHelpId = pParent->GetHelpId(); - aHelpURL = CreateHelpURL( OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName ); + aHelpURL = CreateHelpURL( OUString::fromUtf8(aHelpId), aHelpModuleName ); if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { break; diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index f8f0e2a42ab1..ab4736b8ef45 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -730,8 +730,7 @@ static OUString getAutostartDir( bool bCreate = false ) OUString aShortcut; const char *pConfigHome; if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) ) - aShortcut = OStringToOUString( OString( pConfigHome ), - RTL_TEXTENCODING_UTF8 ); + aShortcut = OUString::fromUtf8( OString( pConfigHome ) ); else { OUString aHomeURL; diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index b716f56d8724..a5da0de290a1 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -164,8 +164,7 @@ static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, OUString *pOverrideLabel, sal_uInt16 nResId, GCallback pFnCallback ) { - OUString *pURL = new OUString (OStringToOUString( pAsciiURL, - RTL_TEXTENCODING_UTF8 )); + OUString *pURL = new OUString (OUString::fromUtf8( pAsciiURL )); OString aLabel; if (pOverrideLabel) aLabel = OUStringToOString (*pOverrideLabel, RTL_TEXTENCODING_UTF8); diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index e00e6cb266d5..de879ad93d73 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -207,7 +207,7 @@ OUString SfxContentHelper::GetActiveHelpString( const OUString& rURL ) while ( nRead > 0 ) { OString sOldString( (sal_Char*)lData.getConstArray(), nRead ); - OUString sString = OStringToOUString( sOldString, RTL_TEXTENCODING_UTF8 ); + OUString sString = OUString::fromUtf8( sOldString ); aRet.append( sString ); nRead = xStream->readBytes( lData, 1024 ); diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx index 8fcc660e7618..18b94389a9fb 100644 --- a/sfx2/source/bastyp/mieclip.cxx +++ b/sfx2/source/bastyp/mieclip.cxx @@ -60,7 +60,7 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) else if (sTmp == "EndFragment") nFragEnd = sLine.copy(nIndex).toInt32(); else if (sTmp == "SourceURL") - sBaseURL = OStringToOUString( sLine.copy(nIndex), RTL_TEXTENCODING_UTF8 ); + sBaseURL = OUString::fromUtf8( sLine.copy(nIndex) ); if (nEnd >= 0 && nStt >= 0 && (!sBaseURL.isEmpty() || rStream.Tell() >= static_cast<sal_Size>(nStt))) diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 8549e9b7c64a..1503ed1c3f32 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -254,7 +254,7 @@ bool SfxHTMLParser::FinishFileDownload( OUString& rStr ) sal_Size nLen = aStream.Tell(); aStream.Seek( 0 ); OString sBuffer = read_uInt8s_ToOString(aStream, nLen); - rStr = OStringToOUString( sBuffer, RTL_TEXTENCODING_UTF8 ); + rStr = OUString::fromUtf8( sBuffer ); } delete pDLMedium; diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 4fc4cbf18e93..de7c107160f5 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -59,7 +59,7 @@ OString SfxSlot::GetCommand() const OUString SfxSlot::GetCommandString() const { - return OStringToOUString(GetCommand(), RTL_TEXTENCODING_UTF8); + return OUString::fromUtf8(GetCommand()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index b8a3a7419596..75845925c128 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -101,7 +101,7 @@ void SfxModalDialog::SetDialogData_Impl() // save settings (position and user data) OUString sConfigId; if (isLayoutEnabled()) - sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); + sConfigId = OUString::fromUtf8(GetHelpId()); else { SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); @@ -128,7 +128,7 @@ void SfxModalDialog::GetDialogData_Impl() { OUString sConfigId; if (isLayoutEnabled()) - sConfigId = OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8); + sConfigId = OUString::fromUtf8(GetHelpId()); else { SAL_WARN("sfx.config", "Dialog needs to be converted to .ui format"); @@ -654,8 +654,7 @@ IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl) pImpl->m_pSfxPage->FillUserData(); OUString sData( pImpl->m_pSfxPage->GetUserData() ); - OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); + OUString sConfigId = OUString::fromUtf8(pImpl->m_pSfxPage->GetConfigId()); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -724,8 +723,7 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage, if ( pImpl->m_pSfxPage ) { // First obtain the user data, only then Reset() - OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); + OUString sConfigId = OUString::fromUtf8(pImpl->m_pSfxPage->GetConfigId()); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 18da893e5823..25d91ae3d4b1 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -271,7 +271,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - aHelpText = pHelp->GetHelpText( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), NULL ); + aHelpText = pHelp->GetHelpText( OUString::fromUtf8(sHelpId), NULL ); return aHelpText; } @@ -1143,7 +1143,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con { while ( *_pControlId ) { - DBG_ASSERT( INetURLObject( OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + DBG_ASSERT( INetURLObject( OUString::fromUtf8( *_pHelpId ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); OUString sId( sHelpIdPrefix ); sId += OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 ); xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 34338673e9ba..d71f62d466ba 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -377,8 +377,7 @@ SfxTabDialog::~SfxTabDialog() if ( !aPageData.isEmpty() ) { // save settings of all pages (user data) - OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); + OUString sConfigId = OUString::fromUtf8(pDataObject->pTabPage->GetConfigId()); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -555,7 +554,7 @@ void SfxTabDialog::Start_Impl() sal_uInt16 nActPage = m_pTabCtrl->GetPageId( 0 ); // load old settings, when exists - SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8)); + SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); if ( aDlgOpt.Exists() ) { SetWindowState(OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US)); @@ -674,8 +673,7 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) if ( !aPageData.isEmpty() ) { // save settings of this page (user data) - OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); + OUString sConfigId = OUString::fromUtf8(pDataObject->pTabPage->GetConfigId()); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); @@ -758,7 +756,7 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const void SfxTabDialog::SavePosAndId() { // save settings (screen position and current page) - SvtViewOptions aDlgOpt(E_TABDIALOG, OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8)); + SvtViewOptions aDlgOpt(E_TABDIALOG, OUString::fromUtf8(GetHelpId())); aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US)); // to-do replace with name of page when all pages are converted to .ui aDlgOpt.SetPageID( m_pTabCtrl->GetCurPageId() ); @@ -1127,7 +1125,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" ); pDataObject->pTabPage = pTabPage; - OUString sConfigId = OStringToOUString(pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8); + OUString sConfigId = OUString::fromUtf8(pTabPage->GetConfigId()); if (sConfigId.isEmpty()) { SAL_WARN("sfx.config", "Tabpage needs to be converted to .ui format"); |