diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-09-03 18:29:30 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-04 09:57:11 +0000 |
commit | 9a0d753b84aed53083bed3ed460308b771f432a8 (patch) | |
tree | c4c27c8f8eb8c1a08df3f6e87e230918a1784eb1 /starmath | |
parent | ed87e4c4b09d0f623c350528a4f6a6d049735bd1 (diff) |
String to OUString
Change-Id: I8c51db8fce8c5eea1ac7bd5751aa7f3212ef1166
Reviewed-on: https://gerrit.libreoffice.org/5790
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/document.hxx | 4 | ||||
-rw-r--r-- | starmath/inc/format.hxx | 2 | ||||
-rw-r--r-- | starmath/inc/parse.hxx | 2 | ||||
-rw-r--r-- | starmath/inc/smmod.hxx | 8 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 8 | ||||
-rw-r--r-- | starmath/source/accessibility.cxx | 12 | ||||
-rw-r--r-- | starmath/source/accessibility.hxx | 8 | ||||
-rw-r--r-- | starmath/source/cfgitem.cxx | 52 | ||||
-rw-r--r-- | starmath/source/cfgitem.hxx | 20 | ||||
-rw-r--r-- | starmath/source/document.cxx | 28 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 2 | ||||
-rw-r--r-- | starmath/source/format.cxx | 2 | ||||
-rw-r--r-- | starmath/source/mathmlexport.cxx | 6 | ||||
-rw-r--r-- | starmath/source/mathmlexport.hxx | 2 | ||||
-rw-r--r-- | starmath/source/node.cxx | 6 | ||||
-rw-r--r-- | starmath/source/smdetect.cxx | 58 | ||||
-rw-r--r-- | starmath/source/smmod.cxx | 24 | ||||
-rw-r--r-- | starmath/source/view.cxx | 16 |
18 files changed, 128 insertions, 132 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index 4446ad0d86fd..778171927b50 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -130,7 +130,7 @@ class SmDocShell : public SfxObjectShell, public SfxListener sal_Int32 nFileFormat, sal_Bool bTemplate = sal_False ) const; - virtual sal_Bool SetData( const String& rData ); + virtual sal_Bool SetData( const OUString& rData ); virtual sal_uLong GetMiscStatus() const; virtual void OnDocumentPrinterChanged( Printer * ); virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); @@ -179,7 +179,7 @@ public: SfxPrinter *GetPrinter() { GetPrt(); return pPrinter; } void SetPrinter( SfxPrinter * ); - const String GetComment() const; + const OUString GetComment() const; // to replace chars that can not be saved with the document... sal_Bool ReplaceBadChars(); diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 394f7fb9926e..378cc3de9e85 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -90,7 +90,7 @@ enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; -String GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ); +OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ); class SmFormat : public SfxBroadcaster { diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx index 163009904136..e5cc5a4b55bc 100644 --- a/starmath/inc/parse.hxx +++ b/starmath/inc/parse.hxx @@ -19,9 +19,7 @@ #ifndef PARSE_HXX #define PARSE_HXX - #include <vcl/svapp.hxx> -#include <tools/string.hxx> #include <set> #include <stack> diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index f05c6a52e5c3..637600a08212 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -98,13 +98,13 @@ public: const ResStringArray& GetUiSymbolNamesArray() const { return aUiSymbolNamesAry; } const ResStringArray& GetExportSymbolNamesArray() const { return aExportSymbolNamesAry; } - const String GetUiSymbolName( const String &rExportName ) const; - const String GetExportSymbolName( const String &rUiName ) const; + const OUString GetUiSymbolName( const OUString &rExportName ) const; + const OUString GetExportSymbolName( const OUString &rUiName ) const; const ResStringArray& GetUiSymbolSetNamesArray() const { return aUiSymbolSetNamesAry; } const ResStringArray& GetExportSymbolSetNamesArray() const { return aExportSymbolSetNamesAry; } - const String GetUiSymbolSetName( const String &rExportName ) const; - const String GetExportSymbolSetName( const String &rUiName ) const; + const OUString GetUiSymbolSetName( const OUString &rExportName ) const; + const OUString GetExportSymbolSetName( const OUString &rUiName ) const; const ResStringArray* Get50NamesArray( LanguageType nLang ); const ResStringArray* Get60NamesArray( LanguageType nLang ); diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index e3071373651c..60e36fb24037 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -243,16 +243,16 @@ class SmViewShell: public SfxViewShell protected: Size GetTextLineSize(OutputDevice& rDevice, - const String& rLine); + const OUString& rLine); Size GetTextSize(OutputDevice& rDevice, - const String& rText, + const OUString& rText, long MaxWidth); void DrawTextLine(OutputDevice& rDevice, const Point& rPosition, - const String& rLine); + const OUString& rLine); void DrawText(OutputDevice& rDevice, const Point& rPosition, - const String& rText, + const OUString& rText, sal_uInt16 MaxWidth); virtual sal_uInt16 Print(SfxProgress &rProgress, sal_Bool bIsAPI); diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 6aa86f583383..ca8b35de0f56 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -988,10 +988,10 @@ sal_uInt16 SmTextForwarder::GetTextLen( sal_Int32 nParagraph ) const return pEditEngine ? pEditEngine->GetTextLen( nParagraph ) : 0; } -String SmTextForwarder::GetText( const ESelection& rSel ) const +OUString SmTextForwarder::GetText( const ESelection& rSel ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); - String aRet; + OUString aRet; if (pEditEngine) aRet = pEditEngine->GetText( rSel, LINEEND_LF ); return convertLineEnd(aRet, GetSystemLineEnd()); @@ -1075,7 +1075,7 @@ void SmTextForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rLi pEditEngine->GetPortions( nPara, rList ); } -void SmTextForwarder::QuickInsertText( const String& rText, const ESelection& rSel ) +void SmTextForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel ) { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); if (pEditEngine) @@ -1413,7 +1413,7 @@ sal_Bool SmTextForwarder::Delete( const ESelection& rSelection ) return bRes; } -sal_Bool SmTextForwarder::InsertText( const String& rStr, const ESelection& rSelection ) +sal_Bool SmTextForwarder::InsertText( const OUString& rStr, const ESelection& rSelection ) { sal_Bool bRes = sal_False; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); @@ -1444,11 +1444,11 @@ void SmTextForwarder::AppendParagraph() if (pEditEngine) { sal_Int32 nParaCount = pEditEngine->GetParagraphCount(); - pEditEngine->InsertParagraph( nParaCount, String() ); + pEditEngine->InsertParagraph( nParaCount, OUString() ); } } -xub_StrLen SmTextForwarder::AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet ) +sal_uInt16 SmTextForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) { xub_StrLen nRes = 0; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index df0745b4aaef..4614ae13251c 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -203,7 +203,7 @@ public: virtual sal_Int32 GetParagraphCount() const; virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const; - virtual String GetText( const ESelection& rSel ) const; + virtual OUString GetText( const ESelection& rSel ) const; virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ); @@ -213,7 +213,7 @@ public: virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const; - virtual void QuickInsertText( const String& rText, const ESelection& rSel ); + virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ); virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); virtual void QuickInsertLineBreak( const ESelection& rSel ); @@ -240,7 +240,7 @@ public: virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const; virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nLine ) const; virtual sal_Bool Delete( const ESelection& ); - virtual sal_Bool InsertText( const String&, const ESelection& ); + virtual sal_Bool InsertText( const OUString&, const ESelection& ); virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ); virtual sal_Int16 GetDepth( sal_Int32 nPara ) const; @@ -249,7 +249,7 @@ public: virtual const SfxItemSet* GetEmptyItemSetPtr(); // implementation functions for XParagraphAppend and XTextPortionAppend virtual void AppendParagraph(); - virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet ); + virtual sal_uInt16 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ); virtual void CopyText(const SvxTextForwarder& rSource); }; diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 3d12fc927aac..53ba5ded40e6 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -212,7 +212,7 @@ SmCfgOther::SmCfgOther() SmFontFormat::SmFontFormat() { - aName.AssignAscii( FONTNAME_MATH ); + aName = OUString( FONTNAME_MATH ); nCharSet = RTL_TEXTENCODING_UNICODE; nFamily = FAMILY_DONTKNOW; nPitch = PITCH_DONTKNOW; @@ -258,7 +258,7 @@ bool SmFontFormat::operator == ( const SmFontFormat &rFntFmt ) const ///////////////////////////////////////////////////////////////// -SmFntFmtListEntry::SmFntFmtListEntry( const String &rId, const SmFontFormat &rFntFmt ) : +SmFntFmtListEntry::SmFntFmtListEntry( const OUString &rId, const SmFontFormat &rFntFmt ) : aId (rId), aFntFmt (rFntFmt) { @@ -281,7 +281,7 @@ void SmFontFormatList::Clear() } -void SmFontFormatList::AddFontFormat( const String &rFntFmtId, +void SmFontFormatList::AddFontFormat( const OUString &rFntFmtId, const SmFontFormat &rFntFmt ) { const SmFontFormat *pFntFmt = GetFontFormat( rFntFmtId ); @@ -295,7 +295,7 @@ void SmFontFormatList::AddFontFormat( const String &rFntFmtId, } -void SmFontFormatList::RemoveFontFormat( const String &rFntFmtId ) +void SmFontFormatList::RemoveFontFormat( const OUString &rFntFmtId ) { // search for entry @@ -312,7 +312,7 @@ void SmFontFormatList::RemoveFontFormat( const String &rFntFmtId ) } -const SmFontFormat * SmFontFormatList::GetFontFormat( const String &rFntFmtId ) const +const SmFontFormat * SmFontFormatList::GetFontFormat( const OUString &rFntFmtId ) const { const SmFontFormat *pRes = 0; @@ -339,9 +339,9 @@ const SmFontFormat * SmFontFormatList::GetFontFormat( size_t nPos ) const } -const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const +const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const { - String aRes; + OUString aRes; for (size_t i = 0; i < aEntries.size(); ++i) { @@ -356,10 +356,10 @@ const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) co } -const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd ) +const OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd ) { - String aRes( GetFontFormatId( rFntFmt) ); - if (0 == aRes.Len() && bAdd) + OUString aRes( GetFontFormatId( rFntFmt) ); + if (aRes.isEmpty() && bAdd) { aRes = GetNewFontFormatId(); AddFontFormat( aRes, rFntFmt ); @@ -368,9 +368,9 @@ const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, boo } -const String SmFontFormatList::GetFontFormatId( size_t nPos ) const +const OUString SmFontFormatList::GetFontFormatId( size_t nPos ) const { - String aRes; + OUString aRes; if (nPos < aEntries.size()) aRes = aEntries[nPos].aId; return aRes; @@ -464,7 +464,7 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol, const Any * pValue = aValues.getConstArray(); Font aFont; sal_UCS4 cChar = '\0'; - String aSet; + OUString aSet; bool bPredefined = false; OUString aTmpStr; @@ -500,23 +500,23 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol, if (bOK) { - String aUiName( rSymbolName ); - String aUiSetName( aSet ); + OUString aUiName( rSymbolName ); + OUString aUiSetName( aSet ); if (bPredefined) { - String aTmp; + OUString aTmp; aTmp = GetUiSymbolName( rSymbolName ); - OSL_ENSURE( aTmp.Len(), "localized symbol-name not found" ); - if (aTmp.Len()) + OSL_ENSURE( !aTmp.isEmpty(), "localized symbol-name not found" ); + if (!aTmp.isEmpty()) aUiName = aTmp; aTmp = GetUiSymbolSetName( aSet ); - OSL_ENSURE( aTmp.Len(), "localized symbolset-name not found" ); - if (aTmp.Len()) + OSL_ENSURE( !aTmp.isEmpty(), "localized symbolset-name not found" ); + if (!aTmp.isEmpty()) aUiSetName = aTmp; } rSymbol = SmSym( aUiName, aFont, cChar, aUiSetName, bPredefined ); - if (aUiName != String(rSymbolName)) + if (aUiName != rSymbolName) rSymbol.SetExportName( rSymbolName ); } else @@ -613,11 +613,11 @@ void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols ) pVal++; // FontFormatId SmFontFormat aFntFmt( rSymbol.GetFace() ); - String aFntFmtId( GetFontFormatList().GetFontFormatId( aFntFmt, true ) ); - OSL_ENSURE( aFntFmtId.Len(), "FontFormatId not found" ); + OUString aFntFmtId( GetFontFormatList().GetFontFormatId( aFntFmt, true ) ); + OSL_ENSURE( !aFntFmtId.isEmpty(), "FontFormatId not found" ); pVal->Name = aNodeNameDelim; pVal->Name += *pName++; - pVal->Value <<= OUString( aFntFmtId ); + pVal->Value <<= aFntFmtId; pVal++; } OSL_ENSURE( pVal - pValues == sal::static_int_cast< ptrdiff_t >(nCount * nSymbolProps), "properties missing" ); @@ -749,7 +749,7 @@ void SmMathConfig::SaveFontFormatList() OUString aDelim( OUString( (sal_Unicode) '/' ) ); for (size_t i = 0; i < nCount; ++i) { - String aFntFmtId( rFntFmtList.GetFontFormatId( i ) ); + OUString aFntFmtId( rFntFmtList.GetFontFormatId( i ) ); const SmFontFormat aFntFmt( *rFntFmtList.GetFontFormat( aFntFmtId ) ); OUString aNodeNameDelim( FONT_FORMAT_LIST ); @@ -828,7 +828,7 @@ void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols ) } for (k = 0; k < nCnt; ++k) { - if (0 == aUsedList.GetFontFormatId( pTmpFormat[k] ).Len()) + if (aUsedList.GetFontFormatId( pTmpFormat[k] ).isEmpty()) { rFntFmtList.RemoveFontFormat( pId[k] ); } diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx index 590621ccb3f2..9cbc089e4921 100644 --- a/starmath/source/cfgitem.hxx +++ b/starmath/source/cfgitem.hxx @@ -49,7 +49,7 @@ struct SmCfgOther; struct SmFontFormat { - String aName; + OUString aName; sal_Int16 nCharSet; sal_Int16 nFamily; sal_Int16 nPitch; @@ -66,10 +66,10 @@ struct SmFontFormat struct SmFntFmtListEntry { - String aId; + OUString aId; SmFontFormat aFntFmt; - SmFntFmtListEntry( const String &rId, const SmFontFormat &rFntFmt ); + SmFntFmtListEntry( const OUString &rId, const SmFontFormat &rFntFmt ); }; class SmFontFormatList @@ -85,15 +85,15 @@ public: SmFontFormatList(); void Clear(); - void AddFontFormat( const String &rFntFmtId, const SmFontFormat &rFntFmt ); - void RemoveFontFormat( const String &rFntFmtId ); + void AddFontFormat( const OUString &rFntFmtId, const SmFontFormat &rFntFmt ); + void RemoveFontFormat( const OUString &rFntFmtId ); - const SmFontFormat * GetFontFormat( const String &rFntFmtId ) const; + const SmFontFormat * GetFontFormat( const OUString &rFntFmtId ) const; const SmFontFormat * GetFontFormat( size_t nPos ) const; - const String GetFontFormatId( const SmFontFormat &rFntFmt ) const; - const String GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd ); - const String GetFontFormatId( size_t nPos ) const; - const OUString GetNewFontFormatId() const; + const OUString GetFontFormatId( const SmFontFormat &rFntFmt ) const; + const OUString GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd ); + const OUString GetFontFormatId( size_t nPos ) const; + const OUString GetNewFontFormatId() const; size_t GetCount() const { return aEntries.size(); } bool IsModified() const { return bModified; } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 6e91900c35e4..c33c0d569e94 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -139,7 +139,7 @@ void SmDocShell::LoadSymbols() } -const String SmDocShell::GetComment() const +const OUString SmDocShell::GetComment() const { SAL_INFO( "starmath", "starmath: SmDocShell::GetComment" ); uno::Reference<document::XDocumentPropertiesSupplier> xDPS( @@ -402,8 +402,8 @@ EditEngine& SmDocShell::GetEditEngine() // set initial text if the document already has some... // (may be the case when reloading a doc) - String aTxt( GetText() ); - if (aTxt.Len()) + OUString aTxt( GetText() ); + if (!aTxt.isEmpty()) pEditEngine->SetText( aTxt ); pEditEngine->ClearModifyFlag(); @@ -729,7 +729,7 @@ SmDocShell::~SmDocShell() } -sal_Bool SmDocShell::SetData( const String& rData ) +sal_Bool SmDocShell::SetData( const OUString& rData ) { SAL_INFO( "starmath", "starmath: SmDocShell::SetData" ); @@ -743,11 +743,11 @@ sal_Bool SmDocShell::ConvertFrom(SfxMedium &rMedium) SAL_INFO( "starmath", "starmath: SmDocShell::ConvertFrom" ); bool bSuccess = false; - const String& rFltName = rMedium.GetFilter()->GetFilterName(); + const OUString& rFltName = rMedium.GetFilter()->GetFilterName(); - OSL_ENSURE( !rFltName.EqualsAscii( STAROFFICE_XML ), "Wrong filter!"); + OSL_ENSURE( !rFltName.equals( STAROFFICE_XML ), "Wrong filter!"); - if ( rFltName.EqualsAscii( MATHML_XML ) ) + if ( rFltName.equals( MATHML_XML ) ) { if (pTree) { @@ -952,15 +952,15 @@ sal_Bool SmDocShell::ConvertTo( SfxMedium &rMedium ) if( pTree && !IsFormulaArranged() ) ArrangeFormula(); - const String& rFltName = pFlt->GetFilterName(); - if(rFltName.EqualsAscii( STAROFFICE_XML )) + const OUString& rFltName = pFlt->GetFilterName(); + if(rFltName.equals( STAROFFICE_XML )) { Reference<com::sun::star::frame::XModel> xModel(GetModel()); SmXMLExportWrapper aEquation(xModel); aEquation.SetFlat(sal_False); bRet = aEquation.Export(rMedium); } - else if(rFltName.EqualsAscii( MATHML_XML )) + else if(rFltName.equals( MATHML_XML )) { Reference<com::sun::star::frame::XModel> xModel(GetModel()); SmXMLExportWrapper aEquation(xModel); @@ -1406,15 +1406,15 @@ void SmDocShell::FillClass(SvGlobalName* pClassName, { *pClassName = SvGlobalName(SO3_SM_CLASSID_60); *pFormat = SOT_FORMATSTR_ID_STARMATH_60; - *pFullTypeName = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT)); - *pShortTypeName = String(SmResId(RID_DOCUMENTSTR)); + *pFullTypeName = OUString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT)); + *pShortTypeName = OUString(SmResId(RID_DOCUMENTSTR)); } else if (nFileFormat == SOFFICE_FILEFORMAT_8 ) { *pClassName = SvGlobalName(SO3_SM_CLASSID_60); *pFormat = bTemplate ? SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE : SOT_FORMATSTR_ID_STARMATH_8; - *pFullTypeName = String(SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT)); - *pShortTypeName = String(SmResId(RID_DOCUMENTSTR)); + *pFullTypeName = OUString(SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT)); + *pShortTypeName = OUString(SmResId(RID_DOCUMENTSTR)); } } diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index ce3dd4b91a68..fa32b8fc33c2 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -653,7 +653,7 @@ void SmEditWindow::InitScrollBars() OUString SmEditWindow::GetText() const { - String aText; + OUString aText; EditEngine *pEditEngine = const_cast< SmEditWindow* >(this)->GetEditEngine(); OSL_ENSURE( pEditEngine, "EditEngine missing" ); if (pEditEngine) diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index c18b4923077e..5d75ef9ee8e1 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -67,7 +67,7 @@ static const sal_uInt16 aCTLDefFnts[FNT_END] = }; -String GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ) +OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ) { OSL_ENSURE( /*FNT_BEGIN <= nIdent &&*/ nIdent <= FNT_END, "index out opd range" ); diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index ae337634136f..c53c7d8bec99 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -607,7 +607,7 @@ void SmXMLExport::_ExportContent() SvXMLElementExport aEquation(*this, XML_NAMESPACE_MATH, XML_MATH, sal_True, sal_True); SvXMLElementExport *pSemantics=0; - if (aText.Len()) + if (!aText.isEmpty()) { pSemantics = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_SEMANTICS, sal_True, sal_True); @@ -615,7 +615,7 @@ void SmXMLExport::_ExportContent() ExportNodes(pTree, 0); - if (aText.Len()) + if (!aText.isEmpty()) { // Convert symbol names if (pDocShell) @@ -633,7 +633,7 @@ void SmXMLExport::_ExportContent() OUString("StarMath 5.0")); SvXMLElementExport aAnnotation(*this, XML_NAMESPACE_MATH, XML_ANNOTATION, sal_True, sal_False); - GetDocHandler()->characters(OUString( aText )); + GetDocHandler()->characters( aText ); } delete pSemantics; } diff --git a/starmath/source/mathmlexport.hxx b/starmath/source/mathmlexport.hxx index d7ca75a7f534..4f97bb403b43 100644 --- a/starmath/source/mathmlexport.hxx +++ b/starmath/source/mathmlexport.hxx @@ -77,7 +77,7 @@ public: class SmXMLExport : public SvXMLExport { const SmNode * pTree; - String aText; + OUString aText; sal_Bool bSuccess; protected: diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 3f029bb31e8b..edf32af659c0 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2868,14 +2868,14 @@ void SmAttributNode::CreateTextFromNode(OUString &rText) /**************************************************************************/ -static bool lcl_IsFromGreekSymbolSet( const String &rTokenText ) +static bool lcl_IsFromGreekSymbolSet( const OUString &rTokenText ) { bool bRes = false; // valid symbol name needs to have a '%' at pos 0 and at least an additonal char - if (rTokenText.Len() > 2 && rTokenText.GetBuffer()[0] == (sal_Unicode)'%') + if (rTokenText.getLength() > 2 && rTokenText.getStr()[0] == (sal_Unicode)'%') { - String aName( rTokenText.Copy(1) ); + OUString aName( rTokenText.copy(1) ); SmSym *pSymbol = SM_MOD()->GetSymbolManager().GetSymbolByName( aName ); if (pSymbol && GetExportSymbolSetName(pSymbol->GetSymbolSetName()) == "Greek") bRes = true; diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index a0fc6ecb8c43..be21c53e727b 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -80,10 +80,10 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor Reference< XInputStream > xStream; Reference< XContent > xContent; Reference< XInteractionHandler > xInteraction; - String aURL; + OUString aURL; OUString sTemp; - String aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection) - String aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) + OUString aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection) + OUString aPreselectedFilterName; // a name describing the filter to use (from MediaDescriptor, usually from UI action) OUString aDocumentTitle; // interesting only if set in this method @@ -114,7 +114,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; } - else if( !aURL.Len() && lDescriptor[nProperty].Name == "FileName" ) + else if( aURL.isEmpty() && lDescriptor[nProperty].Name == "FileName" ) { lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; @@ -160,14 +160,14 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor bWasReadOnly = pItem && pItem->GetValue(); - String aFilterName; - String aPrefix = OUString( "private:factory/" ); - if( aURL.Match( aPrefix ) == aPrefix.Len() ) + OUString aFilterName; + OUString aPrefix( "private:factory/" ); + if( aURL.startsWith( aPrefix ) ) { const SfxFilter* pFilter = 0; - String aPattern( aPrefix ); - aPattern += OUString("smath"); - if ( aURL.Match( aPattern ) >= aPattern.Len() ) + OUString aPattern( aPrefix ); + aPattern += "smath"; + if ( aURL.startsWith( aPattern ) ) { pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL ); aTypeName = pFilter->GetTypeName(); @@ -219,13 +219,13 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor } else { - aFilterName.Erase(); + aFilterName = OUString(); try { - const SfxFilter* pFilter = aPreselectedFilterName.Len() ? - SfxFilterMatcher().GetFilter4FilterName( aPreselectedFilterName ) : aTypeName.Len() ? - SfxFilterMatcher(OUString("smath")).GetFilter4EA( aTypeName ) : 0; + const SfxFilter* pFilter = !aPreselectedFilterName.isEmpty() ? + SfxFilterMatcher().GetFilter4FilterName( aPreselectedFilterName ) : !aTypeName.isEmpty() ? + SfxFilterMatcher( "smath" ).GetFilter4EA( aTypeName ) : 0; OUString aTmpFilterName; if ( pFilter ) aTmpFilterName = pFilter->GetName(); @@ -240,7 +240,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor packages::zip::ZipIOException aZipException; // repairing is done only if this type is requested from outside - if ( ( aWrap.TargetException >>= aZipException ) && aTypeName.Len() ) + if ( ( aWrap.TargetException >>= aZipException ) && !aTypeName.isEmpty() ) { if ( xInteraction.is() ) { @@ -267,7 +267,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor } if ( !bRepairAllowed ) - aTypeName.Erase(); + aTypeName = OUString(); } } catch( RuntimeException& ) @@ -276,13 +276,13 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor } catch( Exception& ) { - aTypeName.Erase(); + aTypeName = OUString(); } - if ( aTypeName.Len() ) + if ( !aTypeName.isEmpty() ) { const SfxFilter* pFilter = - SfxFilterMatcher( OUString("smath") ).GetFilter4EA( aTypeName ); + SfxFilterMatcher( "smath" ).GetFilter4EA( aTypeName ); if ( pFilter ) aFilterName = pFilter->GetName(); } @@ -294,17 +294,17 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor //the MathML filter. There are all sorts of things wrong with //this approach, to be fixed at a better level than here SvStream *pStrm = aMedium.GetInStream(); - aTypeName.Erase(); + aTypeName = OUString(); if (pStrm && !pStrm->GetError()) { SotStorageRef aStorage = new SotStorage ( pStrm, sal_False ); if ( !aStorage->GetError() ) { - if (aStorage->IsStream(OUString("Equation Native"))) + if (aStorage->IsStream("Equation Native")) { sal_uInt8 nVersion; if (GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3) - aTypeName.AssignAscii( "math_MathType_3x" ); + aTypeName = "math_MathType_3x"; } } else @@ -335,17 +335,15 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor bIsMathType = true; if (bIsMathType){ - static const sal_Char sFltrNm_2[] = MATHML_XML; - static const sal_Char sTypeNm_2[] = "math_MathML_XML_Math"; - aFilterName.AssignAscii( sFltrNm_2 ); - aTypeName.AssignAscii( sTypeNm_2 ); + aFilterName = OUString( MATHML_XML ); + aTypeName = "math_MathML_XML_Math"; } } } - if ( aTypeName.Len() ) + if ( !aTypeName.isEmpty() ) { - const SfxFilter* pFilt = SfxFilterMatcher( OUString("smath") ).GetFilter4EA( aTypeName ); + const SfxFilter* pFilt = SfxFilterMatcher( "smath" ).GetFilter4EA( aTypeName ); if ( pFilt ) aFilterName = pFilt->GetName(); } @@ -424,8 +422,8 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor lDescriptor[nIndexOfDocumentTitle].Value <<= aDocumentTitle; } - if ( !aFilterName.Len() ) - aTypeName.Erase(); + if ( aFilterName.isEmpty() ) + aTypeName = OUString(); return aTypeName; } diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 8fd26f90959e..35f546959ebd 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -79,15 +79,15 @@ SmLocalizedSymbolData::~SmLocalizedSymbolData() } -const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName ) const +const OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportName ) const { - String aRes; + OUString aRes; const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData(); const ResStringArray &rUiNames = rData.GetUiSymbolNamesArray(); const ResStringArray &rExportNames = rData.GetExportSymbolNamesArray(); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count()); - for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) + for (sal_uInt16 i = 0; i < nCount && aRes.isEmpty(); ++i) { if (rExportNames.GetString(i).equals(rExportName)) { @@ -100,15 +100,15 @@ const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName ) } -const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName ) const +const OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiName ) const { - String aRes; + OUString aRes; const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData(); const ResStringArray &rUiNames = rData.GetUiSymbolNamesArray(); const ResStringArray &rExportNames = rData.GetExportSymbolNamesArray(); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count()); - for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) + for (sal_uInt16 i = 0; i < nCount && aRes.isEmpty(); ++i) { if (rUiNames.GetString(i).equals(rUiName)) { @@ -121,15 +121,15 @@ const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName ) } -const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportName ) const +const OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExportName ) const { - String aRes; + OUString aRes; const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData(); const ResStringArray &rUiNames = rData.GetUiSymbolSetNamesArray(); const ResStringArray &rExportNames = rData.GetExportSymbolSetNamesArray(); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count()); - for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) + for (sal_uInt16 i = 0; i < nCount && aRes.isEmpty(); ++i) { if (rExportNames.GetString(i).equals(rExportName)) { @@ -142,15 +142,15 @@ const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportNam } -const String SmLocalizedSymbolData::GetExportSymbolSetName( const String &rUiName ) const +const OUString SmLocalizedSymbolData::GetExportSymbolSetName( const OUString &rUiName ) const { - String aRes; + OUString aRes; const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData(); const ResStringArray &rUiNames = rData.GetUiSymbolSetNamesArray(); const ResStringArray &rExportNames = rData.GetExportSymbolSetNamesArray(); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count()); - for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) + for (sal_uInt16 i = 0; i < nCount && aRes.isEmpty(); ++i) { if (rUiNames.GetString(i).equals(rUiName)) { diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 9a291a98ff9e..7b4685f75665 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1003,7 +1003,7 @@ void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY ) } -Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) +Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const OUString& rLine) { SAL_INFO( "starmath", "starmath: SmViewShell::GetTextLineSize" ); @@ -1021,7 +1021,7 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) if (i > 0) aSize.Width() = ((aSize.Width() / TabPos) + 1) * TabPos; - OUString aText = rLine.GetToken(i, '\t'); + OUString aText = rLine.getToken(i, '\t'); aText = comphelper::string::stripStart(aText, '\t'); aText = comphelper::string::stripEnd(aText, '\t'); aSize.Width() += rDevice.GetTextWidth(aText); @@ -1032,7 +1032,7 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) } -Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long MaxWidth) +Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long MaxWidth) { SAL_INFO( "starmath", "starmath: SmViewShell::GetTextSize" ); @@ -1042,7 +1042,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M for (sal_uInt16 i = 0; i < nLines; i++) { - OUString aLine = rText.GetToken(i, '\n'); + OUString aLine = rText.getToken(i, '\n'); aLine = comphelper::string::remove(aLine, '\r'); aLine = comphelper::string::stripStart(aLine, '\n'); aLine = comphelper::string::stripEnd(aLine, '\n'); @@ -1093,7 +1093,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M } -void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, const String& rLine) +void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, const OUString& rLine) { SAL_INFO( "starmath", "starmath: SmViewShell::DrawTextLine" ); @@ -1109,7 +1109,7 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co if (i > 0) aPoint.X() = ((aPoint.X() / TabPos) + 1) * TabPos; - OUString aText = rLine.GetToken(i, '\t'); + OUString aText = rLine.getToken(i, '\t'); aText = comphelper::string::stripStart(aText, '\t'); aText = comphelper::string::stripEnd(aText, '\t'); rDevice.DrawText(aPoint, aText); @@ -1121,7 +1121,7 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co } -void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const String& rText, sal_uInt16 MaxWidth) +void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const OUString& rText, sal_uInt16 MaxWidth) { SAL_INFO( "starmath", "starmath: SmViewShell::DrawText" ); @@ -1131,7 +1131,7 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const for (sal_uInt16 i = 0; i < nLines; i++) { - OUString aLine = rText.GetToken(i, '\n'); + OUString aLine = rText.getToken(i, '\n'); aLine = comphelper::string::remove(aLine, '\r'); aLine = comphelper::string::stripEnd(aLine, '\n'); aLine = comphelper::string::stripEnd(aLine, '\n'); |