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