Kaydet (Commit) aa1ccde1 authored tarafından Noel Grandin's avatar Noel Grandin

convert include/svx/svdmodel.hxx from String to OUString

Change-Id: If1d472cdc79c593a0e5e87319e064123d8143e67
üst 672aee12
......@@ -159,13 +159,13 @@ protected:
std::vector<SdrPage*> maPages;
Link aUndoLink; // Link fuer einen NotifyUndo-Handler
Link aIOProgressLink;
String aTablePath;
OUString aTablePath;
Size aMaxObjSize; // z.B. fuer Autogrowing Text
Fraction aObjUnit; // Beschreibung der Koordinateneinheiten fuer ClipBoard, Drag&Drop, ...
MapUnit eObjUnit; // see above
FieldUnit eUIUnit; // Masseinheit, Masstab (z.B. 1/1000) fuer die UI (Statuszeile) wird von ImpSetUIUnit() gesetzt
Fraction aUIScale; // see above
String aUIUnitStr; // see above
OUString aUIUnitStr; // see above
Fraction aUIUnitFact; // see above
int nUIUnitKomma; // see above
......@@ -300,9 +300,9 @@ public:
// Basisobjekt SdrObject abgeleitete Objekte ein, so ist man frei in der
// Wahl des Pools.
explicit SdrModel(SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
explicit SdrModel(const String& rPath, SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
explicit SdrModel(const OUString& rPath, SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
SdrModel(const OUString& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
virtual ~SdrModel();
void ClearModel(sal_Bool bCalledFromDestructor);
......@@ -406,14 +406,14 @@ public:
void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
const String& GetUIUnitStr() const { return aUIUnitStr; }
const OUString& GetUIUnitStr() const { return aUIUnitStr; }
int GetUIUnitKomma() const { return nUIUnitKomma; }
bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
static void TakeUnitStr(FieldUnit eUnit, String& rStr);
static void TakeUnitStr(FieldUnit eUnit, OUString& rStr);
void TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
void TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar = false) const;
void TakePercentStr(const Fraction& rVal, String& rStr, bool bNoPercentChar = false) const;
void TakePercentStr(const Fraction& rVal, OUString& rStr, bool bNoPercentChar = false) const;
// RecalcPageNums wird idR. nur von der Page gerufen.
bool IsPagNumsDirty() const { return bPagNumsDirty; };
......@@ -552,15 +552,15 @@ public:
// Alle direkten Aktionen am SdrModel erzeugen keine UndoActions, die
// Aktionen an der SdrView dagegen generieren solche.
void BegUndo(); // Undo-Klammerung auf
void BegUndo(const String& rComment); // Undo-Klammerung auf
void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
void BegUndo(const OUString& rComment); // Undo-Klammerung auf
void BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
void EndUndo(); // Undo-Klammerung zu
void AddUndo(SdrUndoAction* pUndo);
sal_uInt16 GetUndoBracketLevel() const { return nUndoLevel; }
const SdrUndoGroup* GetAktUndoGroup() const { return pAktUndoGroup; }
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
void SetUndoComment(const String& rComment);
void SetUndoComment(const String& rComment, const String& rObjDescr);
void SetUndoComment(const OUString& rComment);
void SetUndoComment(const OUString& rComment, const OUString& rObjDescr);
// Das Undo-Management findet nur statt, wenn kein NotifyUndoAction-Handler
// gesetzt ist.
......
......@@ -1798,7 +1798,7 @@ void SdrDragResize::TakeSdrDragComment(OUString& rStr) const
if(bX || bY)
{
XubString aStr;
OUString aStr;
rStr += " (";
......
......@@ -227,7 +227,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal
ImpCtor(pPool, pPers, false, (bool)bLoadRefCounts);
}
SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
SdrModel::SdrModel(const OUString& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
maPages(),
......@@ -254,7 +254,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, boo
ImpCtor(pPool,pPers,bUseExtColorTable, (bool)bLoadRefCounts);
}
SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
SdrModel::SdrModel(const OUString& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable, sal_Bool bLoadRefCounts):
aReadDate( DateTime::EMPTY ),
maMaPag(),
maPages(),
......@@ -554,7 +554,7 @@ void SdrModel::BegUndo()
}
}
void SdrModel::BegUndo(const XubString& rComment)
void SdrModel::BegUndo(const OUString& rComment)
{
if( mpImpl->mpUndoManager )
{
......@@ -572,15 +572,14 @@ void SdrModel::BegUndo(const XubString& rComment)
}
}
void SdrModel::BegUndo(const XubString& rComment, const XubString& rObjDescr, SdrRepeatFunc eFunc)
void SdrModel::BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrRepeatFunc eFunc)
{
if( mpImpl->mpUndoManager )
{
String aComment(rComment);
if( aComment.Len() && rObjDescr.Len() )
OUString aComment(rComment);
if( !aComment.isEmpty() && !rObjDescr.isEmpty() )
{
String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
aComment.SearchAndReplace(aSearchString, rObjDescr);
aComment = aComment.replaceFirst("%1", rObjDescr);
}
const String aEmpty;
mpImpl->mpUndoManager->EnterListAction( aComment,aEmpty );
......@@ -633,7 +632,7 @@ void SdrModel::EndUndo()
}
}
void SdrModel::SetUndoComment(const XubString& rComment)
void SdrModel::SetUndoComment(const OUString& rComment)
{
DBG_ASSERT(nUndoLevel!=0,"SdrModel::SetUndoComment(): UndoLevel is already 0!");
......@@ -650,7 +649,7 @@ void SdrModel::SetUndoComment(const XubString& rComment)
}
}
void SdrModel::SetUndoComment(const XubString& rComment, const XubString& rObjDescr)
void SdrModel::SetUndoComment(const OUString& rComment, const OUString& rObjDescr)
{
DBG_ASSERT(nUndoLevel!=0,"SdrModel::SetUndoComment(): UndoLevel is already 0!");
if( mpImpl->mpUndoManager )
......@@ -1166,7 +1165,7 @@ void SdrModel::SetUIUnit(FieldUnit eUnit, const Fraction& rScale)
}
}
void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
void SdrModel::TakeUnitStr(FieldUnit eUnit, OUString& rStr)
{
switch(eUnit)
{
......@@ -1179,65 +1178,62 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
case FUNIT_100TH_MM:
{
rStr = OUString("/100mm");
rStr = "/100mm";
break;
}
case FUNIT_MM :
{
rStr = OUString("mm");
rStr = "mm";
break;
}
case FUNIT_CM :
{
rStr = OUString("cm");
rStr = "cm";
break;
}
case FUNIT_M :
{
rStr = String();
rStr += sal_Unicode('m');
rStr = "m";
break;
}
case FUNIT_KM :
{
rStr = OUString("km");
rStr ="km";
break;
}
case FUNIT_TWIP :
{
rStr = OUString("twip");
rStr = "twip";
break;
}
case FUNIT_POINT :
{
rStr = OUString("pt");
rStr = "pt";
break;
}
case FUNIT_PICA :
{
rStr = OUString("pica");
rStr = "pica";
break;
}
case FUNIT_INCH :
{
rStr = String();
rStr += sal_Unicode('"');
rStr = "\"";
break;
}
case FUNIT_FOOT :
{
rStr = OUString("ft");
rStr = "ft";
break;
}
case FUNIT_MILE :
{
rStr = OUString("mile(s)");
rStr = "mile(s)";
break;
}
case FUNIT_PERCENT:
{
rStr = String();
rStr += sal_Unicode('%');
rStr = "%";
break;
}
}
......@@ -1390,7 +1386,7 @@ void SdrModel::TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar) const
rStr = aBuf.makeStringAndClear();
}
void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, bool bNoPercentChar) const
void SdrModel::TakePercentStr(const Fraction& rVal, OUString& rStr, bool bNoPercentChar) const
{
sal_Int32 nMul(rVal.GetNumerator());
sal_Int32 nDiv(rVal.GetDenominator());
......@@ -1412,10 +1408,10 @@ void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, bool bNoPer
rStr = OUString::number(nMul);
if(bNeg)
rStr.Insert(sal_Unicode('-'), 0);
rStr = "-" + rStr;
if(!bNoPercentChar)
rStr += sal_Unicode('%');
rStr += "%";
}
void SdrModel::SetChanged(sal_Bool bFlg)
......
......@@ -80,7 +80,7 @@ SdrMeasureObjGeoData::~SdrMeasureObjGeoData() {}
OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind) const
{
String aStr;
OUString aStr;
Fraction aMeasureScale(1, 1);
sal_Bool bTextRota90(sal_False);
sal_Bool bShowUnit(sal_False);
......@@ -131,37 +131,36 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
if(!aFact.IsValid())
{
aStr = String();
aStr += sal_Unicode('?');
aStr = "";
aStr += "?";
}
sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]);
if(aStr.Search(cDec) != STRING_NOTFOUND)
if(aStr.indexOf(cDec) != -1)
{
xub_StrLen nLen2(aStr.Len() - 1);
sal_Int32 nLen2(aStr.getLength() - 1);
while(aStr.GetChar(nLen2) == sal_Unicode('0'))
while(aStr[nLen2] == '0')
{
aStr.Erase(nLen2);
aStr = aStr.copy(0, nLen2);
nLen2--;
}
if(aStr.GetChar(nLen2) == cDec)
if(aStr[nLen2] == cDec)
{
aStr.Erase(nLen2);
aStr = aStr.copy(0, nLen2);
nLen2--;
}
if(!aStr.Len())
aStr += sal_Unicode('0');
if(aStr.isEmpty())
aStr += "0";
}
}
else
{
// if there's no Model ... (e. g. preview in dialog)
aStr = String();
aStr.AppendAscii("4711");
aStr = "4711";
}
break;
......@@ -188,8 +187,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
{
if(bTextRota90)
{
aStr = String();
aStr += sal_Unicode(' ');
aStr = " ";
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment