XubString->OUString

Change-Id: Ib5f39e099d238b739e0d6b3d92d3f04ee50022fb
This commit is contained in:
Caolán McNamara 2012-10-12 14:48:34 +01:00
parent a551cad4e3
commit 53acdd29e3
10 changed files with 124 additions and 138 deletions

View File

@ -78,9 +78,12 @@ public:
void ClearPortionInfo();
// StyleSheet support
bool ChangeStyleSheets(const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily);
void ChangeStyleSheetName(SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName);
void SetStyleSheets(sal_uInt16 nLevel, const XubString rNewName, const SfxStyleFamily& rNewFamily);
bool ChangeStyleSheets(const OUString& rOldName, SfxStyleFamily eOldFamily,
const OUString& rNewName, SfxStyleFamily eNewFamily);
void ChangeStyleSheetName(SfxStyleFamily eFamily, const OUString& rOldName,
const OUString& rNewName);
void SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName,
const SfxStyleFamily& rNewFamily);
};
//////////////////////////////////////////////////////////////////////////////

View File

@ -82,7 +82,7 @@ public:
inline sal_Bool IsEsc() const { return 0 != nEsc; }
// Consider Upper case, Lower case letters etc.
String CalcCaseMap( const String &rTxt ) const;
OUString CalcCaseMap(const OUString &rTxt) const;
// The following section is not needed by anyone, so it can be excluded.
#ifndef REDUCEDSVXFONT

View File

@ -110,10 +110,11 @@ void SvxFont::DrawArrow( OutputDevice &rOut, const Rectangle& rRect,
}
XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const
OUString SvxFont::CalcCaseMap(const OUString &rTxt) const
{
if( !IsCaseMap() || !rTxt.Len() ) return rTxt;
XubString aTxt( rTxt );
if (!IsCaseMap() || rTxt.isEmpty())
return rTxt;
OUString aTxt(rTxt);
// I still have to get the language
const LanguageType eLng = LANGUAGE_DONTKNOW == eLang
? LANGUAGE_SYSTEM : eLang;
@ -139,21 +140,20 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const
// Every beginning of a word is capitalized, the rest of the word
// is taken over as is.
// Bug: if the attribute starts in the middle of the word.
sal_Bool bBlank = sal_True;
bool bBlank = true;
for( sal_uInt16 i = 0; i < aTxt.Len(); ++i )
for (sal_Int32 i = 0; i < aTxt.getLength(); ++i)
{
if( sal_Unicode(' ') == aTxt.GetChar(i) || sal_Unicode('\t') == aTxt.GetChar(i) )
bBlank = sal_True;
if( aTxt[i] == ' ' || aTxt[i] == '\t')
bBlank = true;
else
{
if( bBlank )
if (bBlank)
{
rtl::OUString aTemp(aTxt.GetChar(i));
aTemp = aCharClass.uppercase( aTemp );
aTxt.Replace( i, 1, aTemp );
OUString sTitle(aCharClass.uppercase(OUString(aTxt[i])));
aTxt = aTxt.replaceAt(i, 1, sTitle);
}
bBlank = sal_False;
bBlank = false;
}
}
break;

View File

@ -240,19 +240,22 @@ void OutlinerParaObject::ClearPortionInfo()
mpImplOutlinerParaObject->mpEditTextObject->ClearPortionInfo();
}
bool OutlinerParaObject::ChangeStyleSheets(const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily)
bool OutlinerParaObject::ChangeStyleSheets(const OUString& rOldName,
SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily)
{
ImplMakeUnique();
return mpImplOutlinerParaObject->mpEditTextObject->ChangeStyleSheets(rOldName, eOldFamily, rNewName, eNewFamily);
}
void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName)
void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily,
const OUString& rOldName, const OUString& rNewName)
{
ImplMakeUnique();
mpImplOutlinerParaObject->mpEditTextObject->ChangeStyleSheetName(eFamily, rOldName, rNewName);
}
void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const XubString rNewName, const SfxStyleFamily& rNewFamily)
void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName,
const SfxStyleFamily& rNewFamily)
{
const sal_uInt32 nCount(mpImplOutlinerParaObject->maParagraphDataVector.size());

View File

@ -44,7 +44,7 @@ class SubsetMap;
/**************************************************************************/
void SetFontStyle(const XubString &rStyleName, Font &rFont);
void SetFontStyle(const OUString &rStyleName, Font &rFont);
/**************************************************************************/
@ -382,7 +382,7 @@ public:
SmSymbolManager &rSymbolMgr, SmViewShell &rViewShell, bool bFreeRes = true);
virtual ~SmSymbolDialog();
bool SelectSymbolSet(const XubString &rSymbolSetName);
bool SelectSymbolSet(const OUString &rSymbolSetName);
void SelectSymbol(sal_uInt16 nSymbolPos);
sal_uInt16 GetSelectedSymbol() const { return aSymbolSetDisplay.GetSelectSymbol(); }
};
@ -462,16 +462,16 @@ class SmSymDefineDialog : public ModalDialog
void FillStyles(bool bDeleteText = true);
void SetSymbolSetManager(const SmSymbolManager &rMgr);
void SetFont(const XubString &rFontName, const XubString &rStyleName);
void SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName);
void SetFont(const OUString &rFontName, const OUString &rStyleName);
void SetOrigSymbol(const SmSym *pSymbol, const OUString &rSymbolSetName);
void UpdateButtons();
bool SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName,
bool SelectSymbolSet(ComboBox &rComboBox, const OUString &rSymbolSetName,
bool bDeleteText);
bool SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName,
bool SelectSymbol(ComboBox &rComboBox, const OUString &rSymbolName,
bool bDeleteText);
bool SelectFont(const XubString &rFontName, bool bApplyFont);
bool SelectStyle(const XubString &rStyleName, bool bApplyFont);
bool SelectFont(const OUString &rFontName, bool bApplyFont);
bool SelectStyle(const OUString &rStyleName, bool bApplyFont);
SmSym * GetSymbol(const ComboBox &rComboBox);
const SmSym * GetSymbol(const ComboBox &rComboBox) const
@ -492,28 +492,28 @@ public:
// Dialog
virtual short Execute();
bool SelectOldSymbolSet(const XubString &rSymbolSetName)
bool SelectOldSymbolSet(const OUString &rSymbolSetName)
{
return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, false);
}
bool SelectOldSymbol(const XubString &rSymbolName)
bool SelectOldSymbol(const OUString &rSymbolName)
{
return SelectSymbol(aOldSymbols, rSymbolName, false);
}
bool SelectSymbolSet(const XubString &rSymbolSetName)
bool SelectSymbolSet(const OUString &rSymbolSetName)
{
return SelectSymbolSet(aSymbolSets, rSymbolSetName, false);
}
bool SelectSymbol(const XubString &rSymbolName)
bool SelectSymbol(const OUString &rSymbolName)
{
return SelectSymbol(aSymbols, rSymbolName, false);
}
bool SelectFont(const XubString &rFontName) { return SelectFont(rFontName, true); }
bool SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, true); };
bool SelectFont(const OUString &rFontName) { return SelectFont(rFontName, true); }
bool SelectStyle(const OUString &rStyleName) { return SelectStyle(rStyleName, true); };
void SelectChar(xub_Unicode cChar);
};

View File

@ -40,24 +40,24 @@
////////////////////////////////////////////////////////////////////////////////
inline const String GetExportSymbolName( const String &rUiSymbolName )
inline const OUString GetExportSymbolName( const OUString &rUiSymbolName )
{
return SM_MOD()->GetLocSymbolData().GetExportSymbolName( rUiSymbolName );
}
inline const String GetUiSymbolName( const String &rExportSymbolName )
inline const OUString GetUiSymbolName( const OUString &rExportSymbolName )
{
return SM_MOD()->GetLocSymbolData().GetUiSymbolName( rExportSymbolName );
}
inline const String GetExportSymbolSetName( const String &rUiSymbolSetName )
inline const OUString GetExportSymbolSetName( const OUString &rUiSymbolSetName )
{
return SM_MOD()->GetLocSymbolData().GetExportSymbolSetName( rUiSymbolSetName );
}
inline const String GetUiSymbolSetName( const String &rExportSymbolSetName )
inline const OUString GetUiSymbolSetName( const OUString &rExportSymbolSetName )
{
return SM_MOD()->GetLocSymbolData().GetUiSymbolSetName( rExportSymbolSetName );
}
@ -68,37 +68,33 @@ class SmSym
{
private:
SmFace m_aFace;
String m_aName;
String m_aExportName;
String m_aSetName;
OUString m_aName;
OUString m_aExportName;
OUString m_aSetName;
sal_UCS4 m_cChar;
bool m_bPredefined;
bool m_bDocSymbol;
public:
SmSym();
SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar,
const String& rSet, bool bIsPredefined = false);
SmSym(const OUString& rName, const Font& rFont, sal_UCS4 cChar,
const OUString& rSet, bool bIsPredefined = false);
SmSym(const SmSym& rSymbol);
SmSym& operator = (const SmSym& rSymbol);
const Font& GetFace() const { return m_aFace; }
sal_UCS4 GetCharacter() const { return m_cChar; }
const String& GetName() const { return m_aName; }
const OUString& GetName() const { return m_aName; }
void SetFace( const Font& rFont ) { m_aFace = rFont; }
void SetCharacter( sal_UCS4 cChar ) { m_cChar = cChar; }
//! since the symbol name is also used as key in the map it should not be possible to change the name
//! because ten the key would not be the same as its supposed copy here
// void SetName( const String &rTxt ) { m_aName = rTxt; }
bool IsPredefined() const { return m_bPredefined; }
const String & GetSymbolSetName() const { return m_aSetName; }
void SetSymbolSetName( const String &rName ) { m_aSetName = rName; }
const String & GetExportName() const { return m_aExportName; }
void SetExportName( const String &rName ) { m_aExportName = rName; }
const OUString& GetSymbolSetName() const { return m_aSetName; }
void SetSymbolSetName( const OUString &rName ) { m_aSetName = rName; }
const OUString& GetExportName() const { return m_aExportName; }
void SetExportName( const OUString &rName ) { m_aExportName = rName; }
bool IsDocSymbol() const { return m_bDocSymbol; }
void SetDocSymbol( bool bVal ) { m_bDocSymbol = bVal; }
@ -107,20 +103,8 @@ public:
bool IsEqualInUI( const SmSym& rSymbol ) const;
};
/**************************************************************************/
struct lt_String
{
bool operator()( const String &r1, const String &r2 ) const
{
// r1 < r2 ?
return r1.CompareTo( r2 ) == COMPARE_LESS;
}
};
// type of the actual container to hold the symbols
typedef std::map< String, SmSym, lt_String > SymbolMap_t;
typedef std::map< OUString, SmSym > SymbolMap_t;
// vector of pointers to the actual symbols in the above container
typedef std::vector< const SmSym * > SymbolPtrVec_t;
@ -151,16 +135,16 @@ public:
SmSymbolManager & operator = (const SmSymbolManager& rSymbolSetManager);
// symbol sets are for UI purpose only, thus we assemble them here
std::set< String > GetSymbolSetNames() const;
const SymbolPtrVec_t GetSymbolSet( const String& rSymbolSetName );
std::set< OUString > GetSymbolSetNames() const;
const SymbolPtrVec_t GetSymbolSet( const OUString& rSymbolSetName );
sal_uInt16 GetSymbolCount() const { return static_cast< sal_uInt16 >(m_aSymbols.size()); }
const SymbolPtrVec_t GetSymbols() const;
bool AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false );
void RemoveSymbol( const String & rSymbolName );
void RemoveSymbol( const OUString & rSymbolName );
SmSym * GetSymbolByName(const String& rSymbolName);
const SmSym * GetSymbolByName(const String& rSymbolName) const
SmSym * GetSymbolByName(const OUString& rSymbolName);
const SmSym * GetSymbolByName(const OUString& rSymbolName) const
{
return ((SmSymbolManager *) this)->GetSymbolByName(rSymbolName);
}

View File

@ -809,7 +809,7 @@ void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols )
SmFontFormatList aUsedList;
for (i = 0; i < rSymbols.size(); ++i)
{
OSL_ENSURE( rSymbols[i].GetName().Len() > 0, "non named symbol" );
OSL_ENSURE( rSymbols[i].GetName().getLength() > 0, "non named symbol" );
aUsedList.GetFontFormatId( SmFontFormat( rSymbols[i].GetFace() ) , true );
}
const SmFormat & rStdFmt = GetStandardFormat();

View File

@ -59,18 +59,18 @@ using ::rtl::OUString;
class SmFontStyles
{
String aNormal;
String aBold;
String aItalic;
String aBoldItalic;
String aEmpty;
OUString aNormal;
OUString aBold;
OUString aItalic;
OUString aBoldItalic;
OUString aEmpty;
public:
SmFontStyles();
sal_uInt16 GetCount() const { return 4; }
const String & GetStyleName( const Font &rFont ) const;
const String & GetStyleName( sal_uInt16 nIdx ) const;
const OUString& GetStyleName( const Font &rFont ) const;
const OUString& GetStyleName( sal_uInt16 nIdx ) const;
};
@ -81,12 +81,12 @@ SmFontStyles::SmFontStyles() :
{
aBoldItalic = aBold;
aBoldItalic.AppendAscii( ", " );
aBoldItalic += ", ";
aBoldItalic += aItalic;
}
const String & SmFontStyles::GetStyleName( const Font &rFont ) const
const OUString& SmFontStyles::GetStyleName( const Font &rFont ) const
{
//! compare also SmSpecialNode::Prepare
bool bBold = IsBold( rFont ),
@ -98,12 +98,11 @@ const String & SmFontStyles::GetStyleName( const Font &rFont ) const
return aItalic;
else if (bBold)
return aBold;
else
return aNormal;
return aNormal;
}
const String & SmFontStyles::GetStyleName( sal_uInt16 nIdx ) const
const OUString& SmFontStyles::GetStyleName( sal_uInt16 nIdx ) const
{
// 0 = "normal", 1 = "italic",
// 2 = "bold", 3 = "bold italic"
@ -130,17 +129,17 @@ const SmFontStyles & GetFontStyles()
/////////////////////////////////////////////////////////////////
void SetFontStyle(const XubString &rStyleName, Font &rFont)
void SetFontStyle(const OUString &rStyleName, Font &rFont)
{
// Find index related to StyleName. For an empty StyleName it's assumed to be
// 0 (neither bold nor italic).
sal_uInt16 nIndex = 0;
if (rStyleName.Len())
if (!rStyleName.isEmpty())
{
sal_uInt16 i;
const SmFontStyles &rStyles = GetFontStyles();
for (i = 0; i < rStyles.GetCount(); i++)
if (rStyleName.CompareTo( rStyles.GetStyleName(i) ) == COMPARE_EQUAL)
for (i = 0; i < rStyles.GetCount(); ++i)
if (rStyleName == rStyles.GetStyleName(i))
break;
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE(i < rStyles.GetCount(), "style-name unknown");
@ -242,7 +241,7 @@ void SmShowFont::Paint(const Rectangle& rRect )
{
Control::Paint( rRect );
XubString Text (GetFont().GetName());
OUString Text (GetFont().GetName());
Size TextSize(GetTextWidth(Text), GetTextHeight());
DrawText(Point((GetOutputSize().Width() - TextSize.Width()) / 2,
@ -801,10 +800,7 @@ void SmDistanceDialog::SetHelpId(MetricField &rField, const rtl::OString& sHelpI
// HelpIDs which are explicitly set in this way have to be defined in the
// util directory in the file "hidother.src" with the help of "hidspecial"!
const XubString aEmptyText;
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE(aEmptyText.Len() == 0, "Sm: Ooops...");
#endif
const OUString aEmptyText;
rField.SetHelpId(sHelpId);
rField.SetHelpText(aEmptyText);
@ -1360,7 +1356,7 @@ void SmShowSymbol::Paint(const Rectangle &rRect)
{
Control::Paint( rRect );
const XubString &rText = GetText();
const OUString &rText = GetText();
Size aTextSize(GetTextWidth(rText), GetTextHeight());
DrawText(Point((GetOutputSize().Width() - aTextSize.Width()) / 2,
@ -1407,8 +1403,8 @@ void SmSymbolDialog::FillSymbolSets(bool bDeleteText)
if (bDeleteText)
aSymbolSets.SetNoSelection();
std::set< String > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() );
std::set< String >::const_iterator aIt( aSybolSetNames.begin() );
std::set< OUString > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() );
std::set< OUString >::const_iterator aIt( aSybolSetNames.begin() );
for ( ; aIt != aSybolSetNames.end(); ++aIt)
aSymbolSets.InsertEntry( *aIt );
}
@ -1447,7 +1443,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton )
SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymbolMgr);
// set current symbol and SymbolSet for the new dialog
const XubString aSymSetName (aSymbolSets.GetSelectEntry()),
const OUString aSymSetName (aSymbolSets.GetSelectEntry()),
aSymName (aSymbolName.GetText());
pDialog->SelectOldSymbolSet(aSymSetName);
pDialog->SelectOldSymbol(aSymName);
@ -1455,7 +1451,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton )
pDialog->SelectSymbol(aSymName);
// remember old SymbolSet
XubString aOldSymbolSet (aSymbolSets.GetSelectEntry());
OUString aOldSymbolSet (aSymbolSets.GetSelectEntry());
sal_uInt16 nSymPos = GetSelectedSymbol();
@ -1625,7 +1621,7 @@ void SmSymbolDialog::DataChanged( const DataChangedEvent& rDCEvt )
}
bool SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName)
bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName)
{
bool bRet = false;
sal_uInt16 nPos = aSymbolSets.GetEntryPos(rSymbolSetName);
@ -1663,7 +1659,7 @@ void SmSymbolDialog::SelectSymbol(sal_uInt16 nSymbolNo)
aSymbolSetDisplay.SelectSymbol(nSymbolNo);
aSymbolDisplay.SetSymbol(pSym);
aSymbolName.SetText(pSym ? pSym->GetName() : XubString());
aSymbolName.SetText(pSym ? pSym->GetName() : OUString());
}
@ -1751,8 +1747,8 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, bool bDeleteText)
if (bDeleteText)
rComboBox.SetText(rtl::OUString());
const std::set< String > aSymbolSetNames( aSymbolMgrCopy.GetSymbolSetNames() );
std::set< String >::const_iterator aIt( aSymbolSetNames.begin() );
const std::set< OUString > aSymbolSetNames( aSymbolMgrCopy.GetSymbolSetNames() );
std::set< OUString >::const_iterator aIt( aSymbolSetNames.begin() );
for ( ; aIt != aSymbolSetNames.end(); ++aIt)
rComboBox.InsertEntry( *aIt );
}
@ -1782,8 +1778,8 @@ void SmSymDefineDialog::FillStyles(bool bDeleteText)
if (bDeleteText)
aStyles.SetText(rtl::OUString());
XubString aText (aFonts.GetSelectEntry());
if (aText.Len() != 0)
OUString aText (aFonts.GetSelectEntry());
if (!aText.isEmpty())
{
// use own StyleNames
const SmFontStyles &rStyles = GetFontStyles();
@ -2040,16 +2036,16 @@ void SmSymDefineDialog::UpdateButtons()
bool bAdd = false,
bChange = false,
bDelete = false;
XubString aTmpSymbolName (aSymbols.GetText()),
OUString aTmpSymbolName (aSymbols.GetText()),
aTmpSymbolSetName (aSymbolSets.GetText());
if (aTmpSymbolName.Len() > 0 && aTmpSymbolSetName.Len() > 0)
if (aTmpSymbolName.getLength() > 0 && aTmpSymbolSetName.getLength() > 0)
{
// are all settings equal?
//! (Font-, Style- und SymbolSet name comparison is not case sensitive)
bool bEqual = pOrigSymbol
&& aTmpSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText())
&& aTmpSymbolName.Equals(pOrigSymbol->GetName())
&& aTmpSymbolSetName.equalsIgnoreAsciiCase(aOldSymbolSetName.GetText())
&& aTmpSymbolName.equals(pOrigSymbol->GetName())
&& aFonts.GetSelectEntry().EqualsIgnoreCaseAscii(
pOrigSymbol->GetFace().GetName())
&& aStyles.GetText().EqualsIgnoreCaseAscii(
@ -2245,7 +2241,7 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymbolManager &rMgr)
bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox,
const XubString &rSymbolSetName, bool bDeleteText)
const OUString &rSymbolSetName, bool bDeleteText)
{
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets,
@ -2253,7 +2249,7 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox,
#endif
// trim SymbolName (no leading and trailing blanks)
XubString aNormName (rSymbolSetName);
OUString aNormName (rSymbolSetName);
aNormName = comphelper::string::stripStart(aNormName, ' ');
aNormName = comphelper::string::stripEnd(aNormName, ' ');
// and remove possible deviations within the input
@ -2283,7 +2279,7 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox,
// display a valid respectively no symbol when changing the SymbolSets
if (bIsOld)
{
XubString aTmpOldSymbolName;
OUString aTmpOldSymbolName;
if (aOldSymbols.GetEntryCount() > 0)
aTmpOldSymbolName = aOldSymbols.GetEntry(0);
SelectSymbol(aOldSymbols, aTmpOldSymbolName, true);
@ -2296,13 +2292,13 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox,
void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol,
const XubString &rSymbolSetName)
const OUString &rSymbolSetName)
{
// clear old symbol
delete pOrigSymbol;
pOrigSymbol = 0;
XubString aSymName,
OUString aSymName,
aSymSetName;
if (pSymbol)
{
@ -2324,7 +2320,7 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol,
bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
const XubString &rSymbolName, bool bDeleteText)
const OUString &rSymbolName, bool bDeleteText)
{
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols,
@ -2332,7 +2328,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
#endif
// trim SymbolName (no blanks)
XubString aNormName(comphelper::string::remove(rSymbolName, ' '));
OUString aNormName(comphelper::string::remove(rSymbolName, ' '));
// and remove possible deviations within the input
rComboBox.SetText(aNormName);
@ -2379,7 +2375,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
{
// if there's a change of the old symbol, show only the available ones, otherwise show none
const SmSym *pOldSymbol = NULL;
XubString aTmpOldSymbolSetName;
OUString aTmpOldSymbolSetName;
if (nPos != COMBOBOX_ENTRY_NOTFOUND)
{
pOldSymbol = aSymbolMgrCopy.GetSymbolByName(aNormName);
@ -2396,7 +2392,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
}
void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rStyleName)
void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyleName)
{
// get Font (FontInfo) matching name and style
FontInfo aFI;
@ -2432,7 +2428,7 @@ void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rSt
}
bool SmSymDefineDialog::SelectFont(const XubString &rFontName, bool bApplyFont)
bool SmSymDefineDialog::SelectFont(const OUString &rFontName, bool bApplyFont)
{
bool bRet = false;
sal_uInt16 nPos = aFonts.GetEntryPos(rFontName);
@ -2460,7 +2456,7 @@ bool SmSymDefineDialog::SelectFont(const XubString &rFontName, bool bApplyFont)
}
bool SmSymDefineDialog::SelectStyle(const XubString &rStyleName, bool bApplyFont)
bool SmSymDefineDialog::SelectStyle(const OUString &rStyleName, bool bApplyFont)
{
bool bRet = false;
sal_uInt16 nPos = aStyles.GetEntryPos(rStyleName);

View File

@ -2869,7 +2869,7 @@ static bool lcl_IsFromGreekSymbolSet( const String &rTokenText )
{
String aName( rTokenText.Copy(1) );
SmSym *pSymbol = SM_MOD()->GetSymbolManager().GetSymbolByName( aName );
if (pSymbol && GetExportSymbolSetName( pSymbol->GetSymbolSetName() ).EqualsAscii( "Greek" ) )
if (pSymbol && GetExportSymbolSetName(pSymbol->GetSymbolSetName()) == "Greek")
bRes = true;
}

View File

@ -47,8 +47,8 @@ using namespace ::rtl;
/**************************************************************************/
SmSym::SmSym() :
m_aName(rtl::OUString("unknown")),
m_aSetName(rtl::OUString("unknown")),
m_aName(OUString("unknown")),
m_aSetName(OUString("unknown")),
m_cChar('\0'),
m_bPredefined(false),
m_bDocSymbol(false)
@ -65,8 +65,8 @@ SmSym::SmSym(const SmSym& rSymbol)
}
SmSym::SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar,
const String& rSet, bool bIsPredefined)
SmSym::SmSym(const OUString& rName, const Font& rFont, sal_UCS4 cChar,
const OUString& rSet, bool bIsPredefined)
{
m_aName = m_aExportName = rName;
@ -141,7 +141,7 @@ SmSymbolManager& SmSymbolManager::operator = (const SmSymbolManager& rSymbolSetM
}
SmSym *SmSymbolManager::GetSymbolByName(const String& rSymbolName)
SmSym *SmSymbolManager::GetSymbolByName(const OUString& rSymbolName)
{
SmSym *pRes = NULL;
SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) );
@ -166,8 +166,8 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
{
bool bAdded = false;
const String aSymbolName( rSymbol.GetName() );
if (aSymbolName.Len() > 0 && rSymbol.GetSymbolSetName().Len() > 0)
const OUString aSymbolName( rSymbol.GetName() );
if (aSymbolName.getLength() > 0 && rSymbol.GetSymbolSetName().getLength() > 0)
{
const SmSym *pFound = GetSymbolByName( aSymbolName );
const bool bSymbolConflict = pFound && !pFound->IsEqualInUI( rSymbol );
@ -198,9 +198,9 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
}
void SmSymbolManager::RemoveSymbol( const String & rSymbolName )
void SmSymbolManager::RemoveSymbol( const OUString & rSymbolName )
{
if (rSymbolName.Len() > 0)
if (rSymbolName.getLength() > 0)
{
size_t nOldSize = m_aSymbols.size();
m_aSymbols.erase( rSymbolName );
@ -209,9 +209,9 @@ void SmSymbolManager::RemoveSymbol( const String & rSymbolName )
}
std::set< String > SmSymbolManager::GetSymbolSetNames() const
std::set< OUString > SmSymbolManager::GetSymbolSetNames() const
{
std::set< String > aRes;
std::set< OUString > aRes;
SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
for ( ; aIt != m_aSymbols.end(); ++aIt )
aRes.insert( aIt->second.GetSymbolSetName() );
@ -219,10 +219,10 @@ std::set< String > SmSymbolManager::GetSymbolSetNames() const
}
const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const String& rSymbolSetName )
const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& rSymbolSetName )
{
SymbolPtrVec_t aRes;
if (rSymbolSetName.Len() > 0)
if (rSymbolSetName.getLength() > 0)
{
SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
for ( ; aIt != m_aSymbols.end(); ++aIt )
@ -246,8 +246,8 @@ void SmSymbolManager::Load()
for (size_t i = 0; i < nSymbolCount; ++i)
{
const SmSym &rSym = aSymbols[i];
OSL_ENSURE( rSym.GetName().Len() > 0, "symbol without name!" );
if (rSym.GetName().Len() > 0)
OSL_ENSURE( rSym.GetName().getLength() > 0, "symbol without name!" );
if (rSym.GetName().getLength() > 0)
AddOrReplaceSymbol( rSym );
}
m_bModified = true;
@ -260,9 +260,9 @@ void SmSymbolManager::Load()
// now add a %i... symbol to the 'iGreek' set for every symbol found in the 'Greek' set.
SmLocalizedSymbolData aLocalizedData;
const String aGreekSymbolSetName( aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" ) ));
const OUString aGreekSymbolSetName(aLocalizedData.GetUiSymbolSetName(OUString("Greek")));
const SymbolPtrVec_t aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) );
String aSymbolSetName = rtl::OUString('i');
String aSymbolSetName = OUString('i');
aSymbolSetName += aGreekSymbolSetName;
size_t nSymbols = aGreekSymbols.size();
for (size_t i = 0; i < nSymbols; ++i)
@ -272,7 +272,7 @@ void SmSymbolManager::Load()
Font aFont( rSym.GetFace() );
OSL_ENSURE( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." );
aFont.SetItalic( ITALIC_NORMAL );
String aSymbolName = rtl::OUString('i');
String aSymbolName = OUString('i');
aSymbolName += rSym.GetName();
SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(),
aSymbolSetName, true /*bIsPredefined*/ );
@ -289,8 +289,8 @@ void SmSymbolManager::Save()
// prepare to skip symbols from iGreek on saving
SmLocalizedSymbolData aLocalizedData;
String aSymbolSetName = rtl::OUString('i');
aSymbolSetName += aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" ));
OUString aSymbolSetName('i');
aSymbolSetName += aLocalizedData.GetUiSymbolSetName(OUString("Greek"));
SymbolPtrVec_t aTmp( GetSymbols() );
std::vector< SmSym > aSymbols;