summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rtl/ustring.hxx20
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx2
-rw-r--r--sw/source/uibase/uno/unomod.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx2
4 files changed, 23 insertions, 3 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index f59d646dc41d..45508695a4b4 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -2075,6 +2075,26 @@ public:
}
/**
+ * Convert an OString to an OUString, assuming that the OString is
+ * UTF-8-encoded.
+ *
+ * @param rStr
+ * an OString to convert
+ *
+ * @param convertFlags
+ * flags which control the conversion.
+ *
+ * @see rtl::OStringToOUString for more info on convertFlags.
+ *
+ * @since LibreOffice 4.4
+ */
+ static inline OUString fromUtf8(const OString& rStr,
+ sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS)
+ {
+ return OUString(rStr.getStr(), rStr.getLength(), RTL_TEXTENCODING_UTF8, convertFlags);
+ }
+
+ /**
Returns the string representation of the integer argument.
This function can't be used for language specific conversion.
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index cd623185758a..2213373dc58b 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -55,7 +55,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
: SfxTabDialog(pViewFrame, pParent, sResType,
OUString("modules/swriter/ui/") +
- OStringToOUString(sResType.toAsciiLowerCase(), RTL_TEXTENCODING_UTF8) +
+ OUString::fromUtf8(sResType.toAsciiLowerCase()) +
(".ui"), &rCoreSet, pStr != 0)
, m_bFormat(bFormat)
, m_bNew(bNewFrm)
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index a0b27cd4ac89..2614c3574d6b 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -934,7 +934,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
OUStringBuffer sHelpURL;
sHelpURL.appendAscii ( INET_HID_SCHEME );
SwEditWin &rEditWin = pView->GetEditWin();
- sHelpURL.append( OStringToOUString( rEditWin.GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ sHelpURL.append( OUString::fromUtf8( rEditWin.GetHelpId() ) );
rValue <<= sHelpURL.makeStringAndClear();
}
else
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index fc3108076921..aa58f59d2166 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -374,7 +374,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
aCmd += pSlot->GetUnoName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<SfxAbstractInsertObjectDialog> pDlg(
- pFact->CreateInsertObjectDialog( GetWin(), OStringToOUString( aCmd, RTL_TEXTENCODING_UTF8 ), xStor, &aServerList ));
+ pFact->CreateInsertObjectDialog( GetWin(), OUString::fromUtf8( aCmd ), xStor, &aServerList ));
if ( pDlg )
{
pDlg->Execute();