[Libreoffice-commits] .: 14 commits - chart2/source filter/source sc/source sd/source svx/inc svx/source sw/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jan 31 18:38:51 PST 2012
chart2/source/controller/main/ElementSelector.cxx | 2
chart2/source/controller/main/ShapeController.cxx | 8
filter/source/msfilter/eschesdo.cxx | 6
filter/source/msfilter/msdffimp.cxx | 2
sc/source/core/data/drwlayer.cxx | 4
sc/source/ui/drawfunc/drawsh5.cxx | 10
sd/source/core/drawdoc2.cxx | 4
svx/inc/svx/svdmodel.hxx | 42 -
svx/inc/svx/svdobj.hxx | 357 +++++--------
svx/inc/svx/svdorect.hxx | 2
svx/inc/svx/svdovirt.hxx | 2
svx/source/svdraw/svddrgmt.cxx | 31 -
svx/source/svdraw/svdedtv1.cxx | 6
svx/source/svdraw/svdmodel.cxx | 63 +-
svx/source/svdraw/svdoashp.cxx | 2
svx/source/svdraw/svdobj.cxx | 580 ++++++++++++++++------
svx/source/svdraw/svdocapt.cxx | 2
svx/source/svdraw/svdocirc.cxx | 22
svx/source/svdraw/svdoedge.cxx | 2
svx/source/svdraw/svdomeas.cxx | 4
svx/source/svdraw/svdopath.cxx | 36 -
svx/source/svdraw/svdorect.cxx | 14
svx/source/svdraw/svdotxdr.cxx | 2
svx/source/svdraw/svdovirt.cxx | 2
svx/source/unodraw/unoshape.cxx | 6
sw/source/ui/shells/drwbassh.cxx | 2
sw/source/ui/utlui/content.cxx | 6
27 files changed, 728 insertions(+), 491 deletions(-)
New commits:
commit c987912cacfd16bbeab64dccfa1c9fa66254d814
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 20:58:17 2012 -0500
More on string conversion.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 30b8385..0349444 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -478,7 +478,7 @@ protected:
Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
// Fuer GetDragComment
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
+ void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, rtl::OUString& rStr, sal_uInt16 nVal=0) const;
void ImpForcePlusData();
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index f5dd2b7..5ce27e6 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1096,31 +1096,23 @@ void SdrObject::TakeObjNamePlural(XubString& rName) const
rName=ImpGetResStr(STR_ObjNamePluralNONE);
}
-void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal) const
+void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, rtl::OUString& rStr, sal_uInt16 nVal) const
{
rStr = ImpGetResStr(nStrCacheID);
-
- sal_Char aSearchText1[] = "%1";
- sal_Char aSearchText2[] = "%2";
- xub_StrLen nPos = rStr.SearchAscii(aSearchText1);
-
- if(nPos != STRING_NOTFOUND)
+ sal_Int32 nPos = rStr.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%1")));
+ if (nPos >= 0)
{
- rStr.Erase(nPos, 2);
-
+ // Replace '%1' with the object name.
XubString aObjName;
-
TakeObjNameSingul(aObjName);
- rStr.Insert(aObjName, nPos);
+ rStr = rStr.replaceAt(nPos, 2, aObjName);
}
- nPos = rStr.SearchAscii(aSearchText2);
-
- if(nPos != STRING_NOTFOUND)
- {
- rStr.Erase(nPos, 2);
- rStr.Insert(UniString::CreateFromInt32(nVal), nPos);
- }
+ nPos = rStr.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%2")));
+ if (nPos >= 0)
+ // Replace '%2' with the passed value.
+ rStr = rStr.replaceAt(
+ nPos, 2, rtl::OUString::valueOf(static_cast<sal_Int32>(nVal)));
}
void SdrObject::ImpForcePlusData()
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index cf261d8..54ee2a1 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -403,7 +403,7 @@ String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- XubString aStr;
+ rtl::OUString aStr;
if(!pHdl)
{
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index cafb87d..083426c 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -570,8 +570,9 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(bCreateComment)
{
- XubString aStr;
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
+ rtl::OUStringBuffer aBuf(aStr);
const sal_uInt32 nPntAnz(rDrag.GetPointAnz());
if(OBJ_CIRC != meCircleKind && nPntAnz > 2)
@@ -579,7 +580,7 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser();
sal_Int32 nWink;
- aStr.AppendAscii(" (");
+ aBuf.appendAscii(" (");
if(3 == nPntAnz)
{
@@ -590,11 +591,11 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
nWink = pU->nEnd;
}
- aStr += GetWinkStr(nWink,sal_False);
- aStr += sal_Unicode(')');
+ aBuf.append(GetWinkStr(nWink,false));
+ aBuf.append(sal_Unicode(')'));
}
- return aStr;
+ return aBuf.makeStringAndClear();
}
else
{
@@ -602,15 +603,16 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(bWink)
{
- XubString aStr;
const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink);
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
- aStr.AppendAscii(" (");
- aStr += GetWinkStr(nWink,sal_False);
- aStr += sal_Unicode(')');
+ rtl::OUStringBuffer aBuf(aStr);
+ aBuf.appendAscii(" (");
+ aBuf.append(GetWinkStr(nWink,false));
+ aBuf.append(sal_Unicode(')'));
- return aStr;
+ return aBuf.makeStringAndClear();
}
else
{
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index b56b1d5..4312ae4 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1939,7 +1939,7 @@ String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- XubString aStr;
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_DragEdgeTail, aStr);
return aStr;
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 867eab9..d816b55 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -942,7 +942,9 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser();
const SdrObjKind eKindMerk(meObjectKind);
mrSdrPathObject.meKind = pU->eAktKind;
- mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
+ rtl::OUString aTmp;
+ mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aTmp);
+ aStr = aTmp;
mrSdrPathObject.meKind = eKindMerk;
Point aPrev(rDrag.GetPrev());
@@ -992,7 +994,9 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
{
// #i103058# fallback when no model and/or Handle, both needed
// for else-path
- mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aStr);
+ rtl::OUString aTmp;
+ mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aTmp);
+ aStr = aTmp;
}
else
{
@@ -1015,7 +1019,9 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
{
// point of ...
- mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewMarkedPoint, aStr);
+ rtl::OUString aTmp;
+ mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewMarkedPoint, aTmp);
+ aStr = aTmp;
// delete %O
XubString aStr2(ImpGetResStr(STR_EditDelete));
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index d684ae3..fa1b129 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -448,14 +448,14 @@ String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(nRad < 0)
nRad = 0;
- XubString aStr;
-
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_DragRectEckRad, aStr);
- aStr.AppendAscii(" (");
- aStr += GetMetrStr(nRad);
- aStr += sal_Unicode(')');
+ rtl::OUStringBuffer aBuf(aStr);
+ aBuf.appendAscii(" (");
+ aBuf.append(GetMetrStr(nRad));
+ aBuf.append(sal_Unicode(')'));
- return aStr;
+ return aBuf.makeStringAndClear();
}
else
{
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index d6bbb3e..972c1f5 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -182,7 +182,7 @@ bool SdrTextObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrTextObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
{
- XubString aStr;
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_DragRectResize,aStr);
return aStr;
}
commit 32999004421994e205f25d1b5268f85f1e7f35ac
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 20:20:07 2012 -0500
XubString to rtl::OUString.
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 59fbf17..1885382 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -419,8 +419,8 @@ public:
bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
static void TakeUnitStr(FieldUnit eUnit, String& rStr);
- void TakeMetricStr(long nVal, String& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
- void TakeWinkStr(long nWink, String& rStr, bool bNoDegChar = false) const;
+ void TakeMetricStr(long nVal, rtl::OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
+ void TakeWinkStr(long nWink, rtl::OUString& rStr, bool bNoDegChar = false) const;
void TakePercentStr(const Fraction& rVal, String& rStr, bool bNoPercentChar = false) const;
// RecalcPageNums wird idR. nur von der Page gerufen.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 1508e3b..30b8385 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -482,8 +482,8 @@ protected:
void ImpForcePlusData();
- String GetWinkStr(long nWink, bool bNoDegChar = false) const;
- String GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
+ rtl::OUString GetWinkStr(long nWink, bool bNoDegChar = false) const;
+ rtl::OUString GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
// bNotMyself=true bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
// Wird z.B. benoetigt fuer NbcMove, denn da movt man SnapRect und aOutRect
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 29b21f1..84de9bf 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1411,15 +1411,15 @@ SdrDragMove::SdrDragMove(SdrDragView& rNewView)
void SdrDragMove::TakeSdrDragComment(XubString& rStr) const
{
- XubString aStr;
+ rtl::OUString aStr;
ImpTakeDescriptionStr(STR_DragMethMove, rStr);
rStr.AppendAscii(" (x=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr.AppendAscii(" y=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
if(getSdrDragView().IsDragWithCopy())
@@ -2015,7 +2015,6 @@ void SdrDragRotate::TakeSdrDragComment(XubString& rStr) const
{
ImpTakeDescriptionStr(STR_DragMethRotate, rStr);
rStr.AppendAscii(" (");
- XubString aStr;
sal_Int32 nTmpWink(NormAngle360(nWink));
if(bRight && nWink)
@@ -2023,8 +2022,9 @@ void SdrDragRotate::TakeSdrDragComment(XubString& rStr) const
nTmpWink -= 36000;
}
+ rtl::OUString aStr;
getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
if(getSdrDragView().IsDragWithCopy())
@@ -2159,10 +2159,9 @@ void SdrDragShear::TakeSdrDragComment(XubString& rStr) const
nTmpWink = NormAngle180(nTmpWink);
- XubString aStr;
-
+ rtl::OUString aStr;
getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
if(getSdrDragView().IsDragWithCopy())
@@ -2742,15 +2741,15 @@ void SdrDragCrook::TakeSdrDragComment(XubString& rStr) const
{
rStr.AppendAscii(" (");
- XubString aStr;
sal_Int32 nVal(nWink);
if(bAtCenter)
nVal *= 2;
nVal = Abs(nVal);
+ rtl::OUString aStr;
getSdrDragView().GetModel()->TakeWinkStr(nVal, aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
}
@@ -3399,14 +3398,14 @@ void SdrDragDistort::TakeSdrDragComment(XubString& rStr) const
{
ImpTakeDescriptionStr(STR_DragMethDistort, rStr);
- XubString aStr;
+ rtl::OUString aStr;
rStr.AppendAscii(" (x=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr.AppendAscii(" y=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
if(getSdrDragView().IsDragWithCopy())
@@ -3554,14 +3553,14 @@ void SdrDragCrop::TakeSdrDragComment(XubString& rStr) const
{
ImpTakeDescriptionStr(STR_DragMethCrop, rStr);
- XubString aStr;
+ rtl::OUString aStr;
rStr.AppendAscii(" (x=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr.AppendAscii(" y=");
getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
- rStr += aStr;
+ rStr.Append(aStr);
rStr += sal_Unicode(')');
if(getSdrDragView().IsDragWithCopy())
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 079162b..27ac271 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1233,7 +1233,7 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
}
-void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_Int32 nNumDigits) const
+void SdrModel::TakeMetricStr(long nVal, rtl::OUString& rStr, bool bNoUnitChars, sal_Int32 nNumDigits) const
{
// #i22167#
// change to double precision usage to not lose decimal places
@@ -1271,7 +1271,8 @@ void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_
nKomma = nNumDigits;
}
- rStr = UniString::CreateFromInt32(static_cast<sal_Int32>(fLocalValue + 0.5));
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(static_cast<sal_Int32>(fLocalValue + 0.5));
if(nKomma < 0)
{
@@ -1279,40 +1280,42 @@ void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_
sal_Int32 nAnz(-nKomma);
for(sal_Int32 i=0; i<nAnz; i++)
- rStr += sal_Unicode('0');
+ aBuf.append(sal_Unicode('0'));
nKomma = 0;
}
// the second condition needs to be <= since inside this loop
// also the leading zero is inserted.
- if(nKomma > 0 && rStr.Len() <= nKomma)
+ if (nKomma > 0 && aBuf.getLength() <= nKomma)
{
// if necessary, add zeros before the decimal point
- sal_Int32 nAnz(nKomma - rStr.Len());
+ sal_Int32 nAnz = nKomma - aBuf.getLength();
if(nAnz >= 0 && rLoc.isNumLeadingZero())
nAnz++;
for(sal_Int32 i=0; i<nAnz; i++)
- rStr.Insert(sal_Unicode('0'), 0);
+ aBuf.insert(0, sal_Unicode('0'));
}
sal_Unicode cDec( rLoc.getNumDecimalSep().GetChar(0) );
// insert KommaChar (decimal point character)
- sal_Int32 nVorKomma(rStr.Len() - nKomma);
+ sal_Int32 nVorKomma = aBuf.getLength() - nKomma;
if(nKomma > 0)
- rStr.Insert(cDec, (xub_StrLen) nVorKomma);
+ aBuf.insert(nVorKomma, cDec);
if(!rLoc.isNumTrailingZeros())
{
- while(rStr.Len() && rStr.GetChar(rStr.Len() - 1) == sal_Unicode('0'))
- rStr.Erase(rStr.Len() - 1);
+ // Remove all trailing zeros.
+ while (aBuf.getLength() && aBuf[aBuf.getLength()-1] == sal_Unicode('0'))
+ aBuf.remove(aBuf.getLength()-1, 1);
- if(rStr.Len() && rStr.GetChar(rStr.Len() - 1) == cDec)
- rStr.Erase(rStr.Len() - 1);
+ // Remove decimal if it's the last character.
+ if (aBuf.getLength() && aBuf[aBuf.getLength()-1] == cDec)
+ aBuf.remove(aBuf.getLength()-1, 1);
}
// if necessary, add separators before every third digit
@@ -1326,53 +1329,55 @@ void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_
while(i > 0)
{
- rStr.Insert(cTho, (xub_StrLen)i);
+ aBuf.insert(i, cTho);
i -= 3;
}
}
}
- if(!rStr.Len())
- {
- rStr = String();
- rStr += sal_Unicode('0');
- }
+ if (!aBuf.getLength())
+ aBuf.append(sal_Unicode('0'));
if(bNegative)
{
- rStr.Insert(sal_Unicode('-'), 0);
+ aBuf.insert(0, sal_Unicode('-'));
}
if(!bNoUnitChars)
- rStr += aUIUnitStr;
+ aBuf.append(aUIUnitStr);
+
+ rStr = aBuf.makeStringAndClear();
}
-void SdrModel::TakeWinkStr(long nWink, XubString& rStr, bool bNoDegChar) const
+void SdrModel::TakeWinkStr(long nWink, rtl::OUString& rStr, bool bNoDegChar) const
{
- sal_Bool bNeg(nWink < 0);
+ bool bNeg = nWink < 0;
if(bNeg)
nWink = -nWink;
- rStr = UniString::CreateFromInt32(nWink);
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(static_cast<sal_Int32>(nWink));
SvtSysLocale aSysLoc;
const LocaleDataWrapper& rLoc = aSysLoc.GetLocaleData();
- xub_StrLen nAnz(2);
+ sal_Int32 nAnz = 2;
if(rLoc.isNumLeadingZero())
nAnz++;
- while(rStr.Len() < nAnz)
- rStr.Insert(sal_Unicode('0'), 0);
+ while(aBuf.getLength() < nAnz)
+ aBuf.insert(0, sal_Unicode('0'));
- rStr.Insert(rLoc.getNumDecimalSep().GetChar(0), rStr.Len() - 2);
+ aBuf.insert(aBuf.getLength()-2, rLoc.getNumDecimalSep().GetChar(0));
if(bNeg)
- rStr.Insert(sal_Unicode('-'), 0);
+ aBuf.insert(0, sal_Unicode('-'));
if(!bNoDegChar)
- rStr += DEGREE_CHAR;
+ aBuf.append(DEGREE_CHAR);
+
+ rStr = aBuf.makeStringAndClear();
}
void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, bool bNoPercentChar) const
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 58cc0c8..f5dd2b7 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1129,18 +1129,18 @@ void SdrObject::ImpForcePlusData()
pPlusData = NewPlusData();
}
-XubString SdrObject::GetWinkStr(long nWink, bool bNoDegChar) const
+rtl::OUString SdrObject::GetWinkStr(long nWink, bool bNoDegChar) const
{
- XubString aStr;
+ rtl::OUString aStr;
if (pModel!=NULL) {
pModel->TakeWinkStr(nWink,aStr,bNoDegChar);
}
return aStr;
}
-XubString SdrObject::GetMetrStr(long nVal, MapUnit /*eWantMap*/, bool bNoUnitChars) const
+rtl::OUString SdrObject::GetMetrStr(long nVal, MapUnit /*eWantMap*/, bool bNoUnitChars) const
{
- XubString aStr;
+ rtl::OUString aStr;
if (pModel!=NULL) {
pModel->TakeMetricStr(nVal,aStr,bNoUnitChars);
}
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 42ffe63..6535b11 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -120,7 +120,9 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe
nLen = BigMulDiv(nLen, aFact.GetNumerator(), aFact.GetDenominator());
}
- pModel->TakeMetricStr(nLen, rStr, sal_True, nNumDigits);
+ rtl::OUString aTmp;
+ pModel->TakeMetricStr(nLen, aTmp, true, nNumDigits);
+ rStr = aTmp;
if(!aFact.IsValid())
{
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 2fca8bc..867eab9 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -954,36 +954,36 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
aNow -= aPrev;
aStr.AppendAscii(" (");
- XubString aMetr;
+ rtl::OUString aMetr;
if(pU->bCircle)
{
mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr);
- aStr += aMetr;
+ aStr.Append(aMetr);
aStr.AppendAscii(" r=");
mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
}
aStr.AppendAscii("dx=");
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
aStr.AppendAscii(" dy=");
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
if(!IsFreeHand(meObjectKind))
{
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
- aStr += aMetr;
+ aStr.Append(aMetr);
}
aStr += sal_Unicode(')');
@@ -1029,18 +1029,18 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
// dx=0.00 dy=0.00 -- both sides bezier
// dx=0.00 dy=0.00 l=0.00 0.00° -- one bezier/lever on one side, a start, or an ending
// dx=0.00 dy=0.00 l=0.00 0.00° / l=0.00 0.00° -- in between
- XubString aMetr;
+ rtl::OUString aMetr;
Point aBeg(rDrag.GetStart());
Point aNow(rDrag.GetNow());
aStr = String();
aStr.AppendAscii("dx=");
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X() - aBeg.X(), aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
aStr.AppendAscii(" dy=");
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y() - aBeg.Y(), aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
if(!pDragData->IsMultiPointDrag())
{
@@ -1067,12 +1067,12 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
- aStr += aMetr;
+ aStr.Append(aMetr);
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
- aStr += aMetr;
+ aStr.Append(aMetr);
}
else if(nPntAnz > 1)
{
commit f068f50b5a35ed281cc50fa4570bcaf83fdb1af8
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 17:13:50 2012 -0500
Re-organized boolean data members.
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 2b74913..59fbf17 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -178,11 +178,9 @@ protected:
String aUIUnitStr; // see above
Fraction aUIUnitFact; // see above
int nUIUnitKomma; // see above
- bool bUIOnlyKomma; // see above
SdrLayerAdmin* pLayerAdmin;
SfxItemPool* pItemPool;
- bool bMyPool; // zum Aufraeumen von pMyPool ab 303a
comphelper::IEmbeddedHelper*
m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
SdrOutliner* pDrawOutliner; // ein Outliner zur Textausgabe
@@ -199,29 +197,31 @@ protected:
Container* pRedoStack;
SdrUndoGroup* pAktUndoGroup; // Fuer mehrstufige
sal_uInt16 nUndoLevel; // Undo-Klammerung
- bool mbUndoEnabled; // If false no undo is recorded or we are during the execution of an undo action
sal_uInt16 nProgressPercent; // fuer den ProgressBar-Handler
sal_uInt16 nLoadVersion; // Versionsnummer der geladenen Datei
- bool bExtColorTable; // Keinen eigenen ColorTable
- sal_Bool mbChanged;
- bool bInfoChanged;
- bool bPagNumsDirty;
- bool bMPgNumsDirty;
- bool bPageNotValid; // TRUE=Doc ist nur ObjektTraeger. Page ist nicht gueltig.
- bool bSavePortable; // Metafiles portabel speichern
- bool bNoBitmapCaching; // Bitmaps fuer Screenoutput cachen
- bool bReadOnly;
- bool bTransparentTextFrames;
- bool bSaveCompressed;
- bool bSwapGraphics;
- bool bPasteResize; // Objekte werden gerade resized wegen Paste mit anderem MapMode
- bool bSaveOLEPreview; // save preview metafile of OLE objects
+ bool bMyPool:1; // zum Aufraeumen von pMyPool ab 303a
+ bool bUIOnlyKomma:1; // see eUIUnit
+ bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action
+ bool bExtColorTable:1; // Keinen eigenen ColorTable
+ bool mbChanged:1;
+ bool bInfoChanged:1;
+ bool bPagNumsDirty:1;
+ bool bMPgNumsDirty:1;
+ bool bPageNotValid:1; // TRUE=Doc ist nur ObjektTraeger. Page ist nicht gueltig.
+ bool bSavePortable:1; // Metafiles portabel speichern
+ bool bNoBitmapCaching:1; // Bitmaps fuer Screenoutput cachen
+ bool bReadOnly:1;
+ bool bTransparentTextFrames:1;
+ bool bSaveCompressed:1;
+ bool bSwapGraphics:1;
+ bool bPasteResize:1; // Objekte werden gerade resized wegen Paste mit anderem MapMode
+ bool bSaveOLEPreview:1; // save preview metafile of OLE objects
+ bool bSaveNative:1;
+ bool bStarDrawPreviewMode:1;
sal_uInt16 nStreamCompressMode; // Komprimiert schreiben?
sal_uInt16 nStreamNumberFormat;
sal_uInt16 nDefaultTabulator;
sal_uInt32 nMaxUndoCount;
- bool bSaveNative;
- sal_Bool bStarDrawPreviewMode;
//////////////////////////////////////////////////////////////////////////////
commit fb495f4eb16f13f34eaacbb3d6bec7aece8e8149
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 16:34:48 2012 -0500
One more method to non-inline. I guess this is the last one...
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 7acba1d..1508e3b 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -480,7 +480,7 @@ protected:
// Fuer GetDragComment
void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
- void ImpForcePlusData() { if (pPlusData==NULL) pPlusData=NewPlusData(); }
+ void ImpForcePlusData();
String GetWinkStr(long nWink, bool bNoDegChar = false) const;
String GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 4018e65..58cc0c8 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1123,6 +1123,12 @@ void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, s
}
}
+void SdrObject::ImpForcePlusData()
+{
+ if (!pPlusData)
+ pPlusData = NewPlusData();
+}
+
XubString SdrObject::GetWinkStr(long nWink, bool bNoDegChar) const
{
XubString aStr;
commit 90d27afdd8e2488a9757da978d96081e35bb0e3f
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 16:16:18 2012 -0500
Simplified & non-inlined setUnoShape().
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 7da0ddd..7acba1d 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -1014,22 +1014,10 @@ public:
static SdrObject* getSdrObjectFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt );
- // helper struct for granting access exclusive to SvxShape
- struct GrantXShapeAccess
- {
- friend class SvxShape;
- private:
- GrantXShapeAccess() { }
- };
-
// setting the UNO representation is allowed for the UNO representation itself only!
void setUnoShape(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape,
- GrantXShapeAccess /*aGrant*/
- )
- {
- impl_setUnoShape( _rxUnoShape );
- }
+ const com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface>& _rxUnoShape);
/** retrieves the instance responsible for notifying changes in the properties of the shape associated with
the SdrObject
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 568b88d..4018e65 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -3027,6 +3027,11 @@ SvxShape* SdrObject::getSvxShape() const
return xShape;
}
+void SdrObject::setUnoShape(const uno::Reference<uno::XInterface >& _rxUnoShape)
+{
+ impl_setUnoShape( _rxUnoShape );
+}
+
::svx::PropertyChangeNotifier& SdrObject::getShapePropertyChangeNotifier()
{
DBG_TESTSOLARMUTEX();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 6a15396..f1a3c37 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -257,7 +257,7 @@ SvxShape::~SvxShape() throw()
mpImpl->mpMaster->dispose();
if ( mpObj.is() )
- mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() );
+ mpObj->setUnoShape(NULL);
if( HasSdrObjectOwnership() && mpObj.is() )
{
@@ -385,7 +385,7 @@ void SvxShape::impl_initFromSdrObject()
osl_incrementInterlockedCount( &m_refCount );
{
- mpObj->setUnoShape( *this, SdrObject::GrantXShapeAccess() );
+ mpObj->setUnoShape(*this);
}
osl_decrementInterlockedCount( &m_refCount );
@@ -1382,7 +1382,7 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException)
}
}
- mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() );
+ mpObj->setUnoShape(NULL);
if ( bFreeSdrObject )
{
commit c5bb73cae7c172ad0f02f8c67dd57b53337f1d78
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 16:03:46 2012 -0500
Get the whole thing to build after the method sig change in SdrObject.
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index e795a7d..71e84b3 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -154,7 +154,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
{
ListBoxEntryData aEntry;
SdrObject* pSelectedObj = DrawViewWrapper::getSdrObject( aSelectedOID.getAdditionalShape() );
- ::rtl::OUString aName( pSelectedObj ? pSelectedObj->GetName() : String() );
+ rtl::OUString aName = pSelectedObj ? pSelectedObj->GetName() : rtl::OUString();
aEntry.UIName = ( aName.isEmpty() ? ::rtl::OUString( String( SchResId( STR_OBJECT_SHAPE ) ) ) : aName );
aEntry.OID = aSelectedOID;
m_aEntries.push_back( aEntry );
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 5878e4c..a4c5f82 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -479,7 +479,7 @@ void ShapeController::executeDispatch_RenameObject()
SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
if ( pSelectedObj )
{
- String aName( pSelectedObj->GetName() );
+ rtl::OUString aName = pSelectedObj->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -488,8 +488,10 @@ void ShapeController::executeDispatch_RenameObject()
pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
- pDlg->GetName( aName );
- if ( aName != pSelectedObj->GetName() )
+ String aTmp;
+ pDlg->GetName(aTmp);
+ aName = aTmp;
+ if (pSelectedObj->GetName().equals(aName))
{
pSelectedObj->SetName( aName );
}
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 256b06a..08ef01d 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -176,9 +176,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
break;
// #i51348# get shape name
- String aShapeName;
+ rtl::OUString aShapeName;
if( const SdrObject* pSdrObj = rObj.GetSdrObject() )
- if( pSdrObj->GetName().Len() > 0 )
+ if (!pSdrObj->GetName().isEmpty())
aShapeName = pSdrObj->GetName();
Point aTextRefPoint;
@@ -223,7 +223,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
// #i51348# shape name
- if( aShapeName.Len() > 0 )
+ if (!aShapeName.isEmpty())
aPropOpt.AddOpt( ESCHER_Prop_wzName, aShapeName );
if ( InteractionInfo* pInteraction = mpHostAppData ? mpHostAppData->GetInteractionInfo():NULL )
{
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 406b153..8f25ac8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4375,7 +4375,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if ( pRet && bGrfRead && !aVisArea.IsEmpty() )
pRet->SetBLIPSizeRectangle( aVisArea );
- if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
+ if (pRet->GetName().isEmpty()) // SJ 22.02.00 : PPT OLE IMPORT:
{ // name is already set in ImportOLE !!
// JP 01.12.99: SetName before SetModel - because in the other order the Bug 70098 is active
if ( ( eFlags & mso_blipflagType ) != mso_blipflagComment )
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 82fbf7b..6493513 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1648,7 +1648,7 @@ inline sal_Bool IsNamedObject( SdrObject* pObj, const String& rName )
// sal_True if rName is the object's Name or PersistName
// (used to find a named object)
- return ( pObj->GetName() == rName ||
+ return ( pObj->GetName().equals(rName) ||
( pObj->GetObjIdentifier() == OBJ_OLE2 &&
static_cast<SdrOle2Obj*>(pObj)->GetPersistName() == rName ) );
}
@@ -1725,7 +1725,7 @@ void ScDrawLayer::EnsureGraphicNames()
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_GRAF && pObject->GetName().Len() == 0 )
+ if ( pObject->GetObjIdentifier() == OBJ_GRAF && pObject->GetName().isEmpty())
pObject->SetName( GetNewGraphicName( &nCounter ) );
pObject = aIter.Next();
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index a146b42..410ac01 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -500,7 +500,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
if(SC_LAYER_INTERN != pSelected->GetLayer())
{
- String aName(pSelected->GetName());
+ rtl::OUString aName = pSelected->GetName();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -512,14 +512,16 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
if(RET_OK == pDlg->Execute())
{
ScDocShell* pDocSh = pViewData->GetDocShell();
- pDlg->GetName(aName);
+ String aTmp;
+ pDlg->GetName(aTmp);
+ aName = aTmp;
- if(aName != pSelected->GetName())
+ if (!aName.equals(pSelected->GetName()))
{
// handle name change
const sal_uInt16 nObjType(pSelected->GetObjIdentifier());
- if(OBJ_GRAF == nObjType && 0L == aName.Len())
+ if (OBJ_GRAF == nObjType && aName.isEmpty())
{
// graphics objects must have names
// (all graphics are supposed to be in the navigator)
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 35fe4e9..59a73d0 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -111,7 +111,7 @@ SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
{
pObj = aIter.Next();
- if( ( rObjName == pObj->GetName() ) ||
+ if( ( pObj->GetName().equals(rObjName) ) ||
( SdrInventor == pObj->GetObjInventor() &&
OBJ_OLE2 == pObj->GetObjIdentifier() &&
rObjName == static_cast< SdrOle2Obj* >( pObj )->GetPersistName() ) )
@@ -138,7 +138,7 @@ SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
{
pObj = aIter.Next();
- if( ( rObjName == pObj->GetName() ) ||
+ if( ( pObj->GetName().equals(rObjName) ) ||
( SdrInventor == pObj->GetObjInventor() &&
OBJ_OLE2 == pObj->GetObjIdentifier() &&
rObjName == static_cast< SdrOle2Obj* >( pObj )->GetPersistName() ) )
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 4b1ee4e..d6bee66 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -640,7 +640,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
while( aIter.IsMore() )
{
SdrObject* pTempObj = aIter.Next();
- if ( pObj != pTempObj && pTempObj->GetName() == sNewName )
+ if ( pObj != pTempObj && pTempObj->GetName().equals(sNewName) )
{
nRet = 0;
break;
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 32a383f..c81301f 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -434,7 +434,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
SdrObject* pTemp = pPage->GetObj(i);
// #i51726# - all drawing objects can be named now
- if ( pTemp->GetName().Len() )
+ if (!pTemp->GetName().isEmpty())
nMemberCount++;
}
}
@@ -766,7 +766,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
{
SdrObject* pTemp = pPage->GetObj(i);
// #i51726# - all drawing objects can be named now
- if ( pTemp->GetName().Len() )
+ if (!pTemp->GetName().isEmpty())
{
SwContact* pContact = (SwContact*)pTemp->GetUserCall();
long nYPos = 0;
@@ -3052,7 +3052,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
{
SdrObject* pTemp = pPage->GetObj(i);
// #i51726# - all drawing objects can be named now
- if ( pTemp->GetName() == pCnt->GetName() )
+ if (pTemp->GetName().equals(pCnt->GetName()))
{
SdrPageView* pPV = pDrawView->GetSdrPageView();
if( pPV )
commit 90413af046d22d1ea7376da4856846744049d613
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 16:03:16 2012 -0500
More implicit inline methods to non-inline.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 8127040..7da0ddd 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -511,7 +511,7 @@ public:
TYPEINFO();
SdrObject();
- /** fres the SdrObject pointed to by the argument
+ /** frees the SdrObject pointed to by the argument
In case the object has an SvxShape, which has the ownership of the object, it
is actually *not* deleted.
@@ -522,18 +522,18 @@ public:
virtual void SetBoundRectDirty();
virtual void SetObjList(SdrObjList* pNewObjList);
- SdrObjList* GetObjList() const { return pObjList; }
+ SdrObjList* GetObjList() const;
virtual void SetPage(SdrPage* pNewPage);
- SdrPage* GetPage() const { return pPage; }
+ SdrPage* GetPage() const;
virtual void SetModel(SdrModel* pNewModel);
- SdrModel* GetModel() const { return pModel; }
+ SdrModel* GetModel() const;
SdrItemPool* GetObjectItemPool() const;
void AddListener(SfxListener& rListener);
void RemoveListener(SfxListener& rListener);
- const SfxBroadcaster* GetBroadcaster() const { return pPlusData!=NULL ? pPlusData->pBroadcast : NULL; }
+ const SfxBroadcaster* GetBroadcaster() const;
virtual void AddReference(SdrVirtObj& rVrtObj);
virtual void DelReference(SdrVirtObj& rVrtObj);
@@ -549,8 +549,8 @@ public:
virtual void getMergedHierarchyLayerSet(SetOfByte& rSet) const;
// UserCall interface
- void SetUserCall(SdrObjUserCall* pUser) { pUserCall=pUser; }
- SdrObjUserCall* GetUserCall() const { return pUserCall; }
+ void SetUserCall(SdrObjUserCall* pUser);
+ SdrObjUserCall* GetUserCall() const;
void SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const;
// Ein solcher Referenzpunkt ist z.B. der Punkt eines Symbols, der
@@ -572,7 +572,7 @@ public:
rtl::OUString GetDescription() const;
// Fuer Gruppenobjekte
- bool IsGroupObject() const { return GetSubList()!=NULL; }
+ bool IsGroupObject() const;
virtual SdrObjList* GetSubList() const;
SdrObject* GetUpGroup() const;
@@ -586,11 +586,11 @@ public:
// Diese Methode sollte nur verwendet werden, wenn man ganz genau weiss,
// was man macht:
- sal_uInt32 GetOrdNumDirect() const { return nOrdNum; }
+ sal_uInt32 GetOrdNumDirect() const;
// Das Setzen der Ordnungsnummer sollte nur vom Model bzw. von der Page
// geschehen.
- void SetOrdNum(sal_uInt32 nNum) { nOrdNum=nNum; }
+ void SetOrdNum(sal_uInt32 nNum);
/** Return the position in the navigation order for the called object.
Note that this method may update the navigation position of the
@@ -751,7 +751,7 @@ public:
virtual void NbcSetRelativePos(const Point& rPnt);
virtual void SetRelativePos(const Point& rPnt);
virtual Point GetRelativePos() const;
- void ImpSetAnchorPos(const Point& rPnt) { aAnchor=rPnt; }
+ void ImpSetAnchorPos(const Point& rPnt);
virtual void NbcSetAnchorPos(const Point& rPnt);
virtual void SetAnchorPos(const Point& rPnt);
virtual const Point& GetAnchorPos() const;
@@ -856,7 +856,7 @@ public:
virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
- bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
+ bool IsMacroHit(const SdrObjMacroHitRec& rRec) const;
// Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
// sowie SvdGlue.HXX und SvdGlEV.HXX)
@@ -954,43 +954,43 @@ public:
SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
// TRUE: Referenz auf ein Obj
- bool IsVirtualObj() const { return bVirtObj; }
+ bool IsVirtualObj() const;
// true=Obj kann warsch. gefuellt werden; false=Obj kann warsch. Linienenden haben.
// ungueltig, wenn es sich um ein GroupObj handelt.
- bool IsClosedObj() const { return bClosedObj; }
-
- bool IsEdgeObj() const { return bIsEdge; }
- bool Is3DObj() const { return bIs3DObj; }
- bool IsUnoObj() const { return bIsUnoObj; }
- bool IsMasterCachable() const { return !bNotMasterCachable; }
- bool ShareLock() { bool r=!bNetLock; bNetLock=true; return r; }
- void ShareUnlock() { bNetLock=false; }
- bool IsShareLock() const { return bNetLock; }
- void SetMarkProtect(bool bProt) { bMarkProt=bProt; }
- bool IsMarkProtect() const { return bMarkProt; }
+ bool IsClosedObj() const;
+
+ bool IsEdgeObj() const;
+ bool Is3DObj() const;
+ bool IsUnoObj() const;
+ bool IsMasterCachable() const;
+ bool ShareLock();
+ void ShareUnlock();
+ bool IsShareLock() const;
+ void SetMarkProtect(bool bProt);
+ bool IsMarkProtect() const;
void SetInserted(bool bIns);
- bool IsInserted() const { return bInserted; }
- void SetGrouped(bool bGrp) { bGrouped=bGrp; }
- bool IsGrouped() const { return bGrouped; }
+ bool IsInserted() const;
+ void SetGrouped(bool bGrp);
+ bool IsGrouped() const;
void SetMoveProtect(bool bProt);
- bool IsMoveProtect() const { return bMovProt; }
+ bool IsMoveProtect() const;
void SetResizeProtect(bool bProt);
- bool IsResizeProtect() const { return bSizProt; }
+ bool IsResizeProtect() const;
void SetPrintable(bool bPrn);
- bool IsPrintable() const { return !bNoPrint; }
+ bool IsPrintable() const;
void SetVisible(bool bVisible);
- bool IsVisible() const { return mbVisible; }
- void SetEmptyPresObj(bool bEpt) { bEmptyPresObj=bEpt; }
- bool IsEmptyPresObj() const { return bEmptyPresObj; }
- void SetNotVisibleAsMaster(bool bFlg) { bNotVisibleAsMaster=bFlg; }
- bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster; }
+ bool IsVisible() const;
+ void SetEmptyPresObj(bool bEpt);
+ bool IsEmptyPresObj() const;
+ void SetNotVisibleAsMaster(bool bFlg);
+ bool IsNotVisibleAsMaster() const;
// #i25616#
- bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry; }
+ bool LineIsOutsideGeometry() const;
// #i25616#
- bool DoesSupportTextIndentingOnLineWidthChange() const { return mbSupportTextIndentingOnLineWidthChange; }
+ bool DoesSupportTextIndentingOnLineWidthChange() const;
// applikationsspeziefische Daten
sal_uInt16 GetUserDataCount() const;
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 2b36cc7..568b88d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -568,11 +568,21 @@ void SdrObject::SetModel(SdrModel* pNewModel)
pModel = pNewModel;
}
+SdrModel* SdrObject::GetModel() const
+{
+ return pModel;
+}
+
void SdrObject::SetObjList(SdrObjList* pNewObjList)
{
pObjList=pNewObjList;
}
+SdrObjList* SdrObject::GetObjList() const
+{
+ return pObjList;
+}
+
void SdrObject::SetPage(SdrPage* pNewPage)
{
pPage=pNewPage;
@@ -583,6 +593,11 @@ void SdrObject::SetPage(SdrPage* pNewPage)
}}
}
+SdrPage* SdrObject::GetPage() const
+{
+ return pPage;
+}
+
// init global static itempool
SdrItemPool* SdrObject::mpGlobalItemPool = NULL;
@@ -684,6 +699,11 @@ void SdrObject::RemoveListener(SfxListener& rListener)
}
}
+const SfxBroadcaster* SdrObject::GetBroadcaster() const
+{
+ return pPlusData!=NULL ? pPlusData->pBroadcast : NULL;
+}
+
void SdrObject::AddReference(SdrVirtObj& rVrtObj)
{
AddListener(rVrtObj);
@@ -708,6 +728,11 @@ void SdrObject::SetRefPoint(const Point& /*rPnt*/)
{
}
+bool SdrObject::IsGroupObject() const
+{
+ return GetSubList()!=NULL;
+}
+
SdrObjList* SdrObject::GetSubList() const
{
return NULL;
@@ -860,6 +885,16 @@ sal_uInt32 SdrObject::GetOrdNum() const
return nOrdNum;
}
+sal_uInt32 SdrObject::GetOrdNumDirect() const
+{
+ return nOrdNum;
+}
+
+void SdrObject::SetOrdNum(sal_uInt32 nNum)
+{
+ nOrdNum = nNum;
+}
+
sal_uInt32 SdrObject::GetNavigationPosition (void)
{
if (pObjList!=NULL && pObjList->RecalcNavigationPositions())
@@ -1597,6 +1632,11 @@ Point SdrObject::GetRelativePos() const
return GetSnapRect().TopLeft()-aAnchor;
}
+void SdrObject::ImpSetAnchorPos(const Point& rPnt)
+{
+ aAnchor = rPnt;
+}
+
void SdrObject::NbcSetAnchorPos(const Point& rPnt)
{
Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
@@ -1859,6 +1899,11 @@ rtl::OUString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) con
return rtl::OUString();
}
+bool SdrObject::IsMacroHit(const SdrObjMacroHitRec& rRec) const
+{
+ return CheckMacroHit(rRec) != NULL;
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrObjGeoData* SdrObject::NewGeoData() const
@@ -2525,6 +2570,128 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
return pRet;
}
+bool SdrObject::IsVirtualObj() const
+{
+ return bVirtObj;
+}
+
+bool SdrObject::IsClosedObj() const
+{
+ return bClosedObj;
+}
+
+bool SdrObject::IsEdgeObj() const
+{
+ return bIsEdge;
+}
+
+bool SdrObject::Is3DObj() const
+{
+ return bIs3DObj;
+}
+
+bool SdrObject::IsUnoObj() const
+{
+ return bIsUnoObj;
+}
+
+bool SdrObject::IsMasterCachable() const
+{
+ return !bNotMasterCachable;
+}
+
+bool SdrObject::ShareLock()
+{
+ bool r = !bNetLock;
+ bNetLock = true;
+ return r;
+}
+
+void SdrObject::ShareUnlock()
+{
+ bNetLock = false;
+}
+
+bool SdrObject::IsShareLock() const
+{
+ return bNetLock;
+}
+
+void SdrObject::SetMarkProtect(bool bProt)
+{
+ bMarkProt = bProt;
+}
+
+bool SdrObject::IsMarkProtect() const
+{
+ return bMarkProt;
+}
+
+bool SdrObject::IsInserted() const
+{
+ return bInserted;
+}
+
+void SdrObject::SetGrouped(bool bGrp)
+{
+ bGrouped = bGrp;
+}
+
+bool SdrObject::IsGrouped() const
+{
+ return bGrouped;
+}
+
+bool SdrObject::IsMoveProtect() const
+{
+ return bMovProt;
+}
+
+bool SdrObject::IsResizeProtect() const
+{
+ return bSizProt;
+}
+
+bool SdrObject::IsPrintable() const
+{
+ return !bNoPrint;
+}
+
+bool SdrObject::IsVisible() const
+{
+ return mbVisible;
+}
+
+void SdrObject::SetEmptyPresObj(bool bEpt)
+{
+ bEmptyPresObj = bEpt;
+}
+
+bool SdrObject::IsEmptyPresObj() const
+{
+ return bEmptyPresObj;
+}
+
+void SdrObject::SetNotVisibleAsMaster(bool bFlg)
+{
+ bNotVisibleAsMaster=bFlg;
+}
+
+bool SdrObject::IsNotVisibleAsMaster() const
+{
+ return bNotVisibleAsMaster;
+}
+
+bool SdrObject::LineIsOutsideGeometry() const
+{
+ return mbLineIsOutsideGeometry;
+}
+
+bool SdrObject::DoesSupportTextIndentingOnLineWidthChange() const
+{
+ return mbSupportTextIndentingOnLineWidthChange;
+}
+
// convert this path object to contour object, even when it is a group
SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash) const
{
@@ -2710,6 +2877,16 @@ void SdrObject::DeleteUserData(sal_uInt16 nNum)
}
}
+void SdrObject::SetUserCall(SdrObjUserCall* pUser)
+{
+ pUserCall = pUser;
+}
+
+SdrObjUserCall* SdrObject::GetUserCall() const
+{
+ return pUserCall;
+}
+
void SdrObject::SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const
{
SdrObjGroup* pGroup = NULL;
commit 960b61a1bce06f3a3bb59caa5e5757732cc1b9e8
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 15:04:51 2012 -0500
XubString to rtl::OUString.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index f261c99..8127040 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -230,7 +230,7 @@ public:
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
virtual bool DoMacro (const SdrObjMacroHitRec& rRec, SdrObject* pObj);
- virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+ virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
};
//************************************************************
@@ -855,7 +855,7 @@ public:
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
- virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+ virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
// Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx
index cb99a3d..4c775cd 100644
--- a/svx/inc/svx/svdorect.hxx
+++ b/svx/inc/svx/svdorect.hxx
@@ -120,7 +120,7 @@ public:
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
virtual bool DoMacro(const SdrObjMacroHitRec& rRec);
- virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+ virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx
index 95536ef..a2f66e7 100644
--- a/svx/inc/svx/svdovirt.hxx
+++ b/svx/inc/svx/svdovirt.hxx
@@ -152,7 +152,7 @@ public:
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
- virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+ virtual rtl::OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
// OD 30.06.2003 #108784# - virtual <GetOffset()> returns Point(0,0)
// #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 6d248c2..2b36cc7 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -219,9 +219,9 @@ bool SdrObjUserData::DoMacro(const SdrObjMacroHitRec& /*rRec*/, SdrObject* /*pOb
return false;
}
-XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const
+rtl::OUString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const
{
- return String();
+ return rtl::OUString();
}
SdrObjUserDataList::SdrObjUserDataList() {}
@@ -1850,13 +1850,13 @@ bool SdrObject::DoMacro(const SdrObjMacroHitRec& rRec)
return false;
}
-XubString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
+rtl::OUString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
{
SdrObjUserData* pData=ImpGetMacroUserData();
if (pData!=NULL) {
return pData->GetMacroPopupComment(rRec,this);
}
- return String();
+ return rtl::OUString();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 34e8d4e..d684ae3 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -518,7 +518,7 @@ bool SdrRectObj::DoMacro(const SdrObjMacroHitRec& rRec)
return SdrTextObj::DoMacro(rRec);
}
-XubString SdrRectObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
+rtl::OUString SdrRectObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
{
return SdrTextObj::GetMacroPopupComment(rRec);
}
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index f3294de..8bb8190 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -633,7 +633,7 @@ bool SdrVirtObj::DoMacro(const SdrObjMacroHitRec& rRec)
return rRefObj.DoMacro(rRec); // TODO: positioning offset
}
-XubString SdrVirtObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
+rtl::OUString SdrVirtObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
{
return rRefObj.GetMacroPopupComment(rRec); // TODO: positioning offset
}
commit 5f47d3323987ab68f64b2e3a45449820391f09ba
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 14:51:15 2012 -0500
More implicit inline method to hide.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 55dabc8..f261c99 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -178,7 +178,7 @@ public:
// Hilfsklasse SdrObjMacroHitRec
//************************************************************
-class SdrObjMacroHitRec
+class SVX_DLLPUBLIC SdrObjMacroHitRec
{
public:
Point aPos;
@@ -186,17 +186,10 @@ public:
OutputDevice* pOut;
const SetOfByte* pVisiLayer;
const SdrPageView* pPageView;
- sal_uInt16 nTol;
+ sal_uInt16 nTol;
bool bDown;
-public:
- SdrObjMacroHitRec()
- : pOut(NULL),
- pVisiLayer(NULL),
- pPageView(NULL),
- nTol(0),
- bDown(false)
- {}
+ SdrObjMacroHitRec();
};
//************************************************************
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 57a8de5..6d248c2 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -137,6 +137,13 @@ void SdrObjUserCall::Changed(const SdrObject& /*rObj*/, SdrUserCallType /*eType*
{
}
+SdrObjMacroHitRec::SdrObjMacroHitRec() :
+ pOut(NULL),
+ pVisiLayer(NULL),
+ pPageView(NULL),
+ nTol(0),
+ bDown(false) {}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
TYPEINIT0(SdrObjUserData);
commit 5d24ffdcbeeed0bcc51ecff3b18bfa5ba07d6c1c
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 14:34:00 2012 -0500
Container to ptr_vector.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 445ba60..55dabc8 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -47,6 +47,8 @@
#include "svx/svxdllapi.h"
#include "svx/shapeproperty.hxx"
+#include <boost/ptr_container/ptr_vector.hpp>
+
//************************************************************
// Vorausdeklarationen
//************************************************************
@@ -244,17 +246,19 @@ public:
class SdrObjUserDataList
{
- Container aList;
+ typedef boost::ptr_vector<SdrObjUserData> ListType;
+ ListType maList;
public:
SdrObjUserDataList();
~SdrObjUserDataList();
- void Clear();
- sal_uInt16 GetUserDataCount() const;
- SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
- void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF);
- void DeleteUserData(sal_uInt16 nNum);
+ size_t GetUserDataCount() const;
+ const SdrObjUserData* GetUserData(size_t nNum) const;
+ SdrObjUserData* GetUserData(size_t nNum);
+ void InsertUserData(SdrObjUserData* pData, size_t nPos);
+ void AppendUserData(SdrObjUserData* pData);
+ void DeleteUserData(size_t nNum);
};
//************************************************************
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0858a8a..57a8de5 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -217,38 +217,37 @@ XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/
return String();
}
-SdrObjUserDataList::SdrObjUserDataList() :
- aList(1024,4,4) {}
+SdrObjUserDataList::SdrObjUserDataList() {}
+SdrObjUserDataList::~SdrObjUserDataList() {}
-SdrObjUserDataList::~SdrObjUserDataList() { Clear(); }
+size_t SdrObjUserDataList::GetUserDataCount() const
+{
+ return static_cast<sal_uInt16>(maList.size());
+}
-void SdrObjUserDataList::Clear()
+const SdrObjUserData* SdrObjUserDataList::GetUserData(size_t nNum) const
{
- sal_uInt16 nAnz=GetUserDataCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- delete GetUserData(i);
- }
- aList.Clear();
+ return &maList.at(nNum);
}
-sal_uInt16 SdrObjUserDataList::GetUserDataCount() const
+SdrObjUserData* SdrObjUserDataList::GetUserData(size_t nNum)
{
- return sal_uInt16(aList.Count());
+ return &maList.at(nNum);
}
-SdrObjUserData* SdrObjUserDataList::GetUserData(sal_uInt16 nNum) const
+void SdrObjUserDataList::InsertUserData(SdrObjUserData* pData, size_t nPos)
{
- return (SdrObjUserData*)aList.GetObject(nNum);
+ maList.insert(maList.begin()+nPos, pData);
}
-void SdrObjUserDataList::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos)
+void SdrObjUserDataList::AppendUserData(SdrObjUserData* pData)
{
- aList.Insert(pData,nPos);
+ maList.push_back(pData);
}
-void SdrObjUserDataList::DeleteUserData(sal_uInt16 nNum)
+void SdrObjUserDataList::DeleteUserData(size_t nNum)
{
- delete (SdrObjUserData*)aList.Remove(nNum);
+ maList.erase(maList.begin()+nNum);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -301,7 +300,7 @@ SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
for (sal_uInt16 i=0; i<nAnz; i++) {
SdrObjUserData* pNeuUserData=pUserDataList->GetUserData(i)->Clone(pObj1);
if (pNeuUserData!=NULL) {
- pNeuPlusData->pUserDataList->InsertUserData(pNeuUserData);
+ pNeuPlusData->pUserDataList->AppendUserData(pNeuUserData);
} else {
OSL_FAIL("SdrObjPlusData::Clone(): UserData.Clone() returns NULL.");
}
@@ -2673,11 +2672,19 @@ SdrObjUserData* SdrObject::GetUserData(sal_uInt16 nNum) const
void SdrObject::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos)
{
- if (pData!=NULL) {
+ if (pData!=NULL)
+ {
ImpForcePlusData();
- if (pPlusData->pUserDataList==NULL) pPlusData->pUserDataList=new SdrObjUserDataList;
- pPlusData->pUserDataList->InsertUserData(pData,nPos);
- } else {
+ if (!pPlusData->pUserDataList)
+ pPlusData->pUserDataList = new SdrObjUserDataList;
+
+ if (nPos == 0xFFFF)
+ pPlusData->pUserDataList->AppendUserData(pData);
+ else
+ pPlusData->pUserDataList->InsertUserData(pData, nPos);
+ }
+ else
+ {
OSL_FAIL("SdrObject::InsertUserData(): pData is NULL pointer.");
}
}
commit af2cf56599fd23485bf570f44f65399fad681eba
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 14:00:35 2012 -0500
One less method that nobody uses.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 20116f1..445ba60 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -254,7 +254,6 @@ public:
sal_uInt16 GetUserDataCount() const;
SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF);
- SdrObjUserData* RemoveUserData(sal_uInt16 nNum);
void DeleteUserData(sal_uInt16 nNum);
};
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 40c5873..0858a8a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -246,14 +246,9 @@ void SdrObjUserDataList::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos)
aList.Insert(pData,nPos);
}
-SdrObjUserData* SdrObjUserDataList::RemoveUserData(sal_uInt16 nNum)
-{
- return (SdrObjUserData*)aList.Remove(nNum);
-}
-
void SdrObjUserDataList::DeleteUserData(sal_uInt16 nNum)
{
- delete RemoveUserData(nNum);
+ delete (SdrObjUserData*)aList.Remove(nNum);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
commit d44bbfc5d00128d005ed896e4a4227276093e221
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 13:51:53 2012 -0500
No implicit inlining in the header file.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 4ad7ae2..20116f1 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -215,28 +215,20 @@ protected:
sal_uInt16 nVersion;
private:
- SVX_DLLPRIVATE void operator=(const SdrObjUserData& rData); // nicht implementiert
- SVX_DLLPRIVATE sal_Bool operator==(const SdrObjUserData& rData) const; // nicht implementiert
- SVX_DLLPRIVATE sal_Bool operator!=(const SdrObjUserData& rData) const; // nicht implementiert
+ SVX_DLLPRIVATE void operator=(const SdrObjUserData& rData); // not implemented
+ SVX_DLLPRIVATE bool operator==(const SdrObjUserData& rData) const; // not implemented
+ SVX_DLLPRIVATE bool operator!=(const SdrObjUserData& rData) const; // not implemented
public:
TYPEINFO();
- SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer)
- : nInventor(nInv),
- nIdentifier(nId),
- nVersion(nVer)
- {}
- SdrObjUserData(const SdrObjUserData& rData)
- : nInventor(rData.nInventor),
- nIdentifier(rData.nIdentifier),
- nVersion(rData.nVersion)
- {}
+ SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer);
+ SdrObjUserData(const SdrObjUserData& rData);
virtual ~SdrObjUserData();
virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0
- sal_uInt32 GetInventor() const { return nInventor; }
- sal_uInt16 GetId() const { return nIdentifier; }
+ sal_uInt32 GetInventor() const;
+ sal_uInt16 GetId() const;
virtual bool HasMacro (const SdrObject* pObj) const;
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
@@ -252,20 +244,18 @@ public:
class SdrObjUserDataList
{
- Container aList;
+ Container aList;
public:
- SdrObjUserDataList()
- : aList(1024,4,4)
- {}
- ~SdrObjUserDataList() { Clear(); }
+ SdrObjUserDataList();
+ ~SdrObjUserDataList();
void Clear();
- sal_uInt16 GetUserDataCount() const { return sal_uInt16(aList.Count()); }
- SdrObjUserData* GetUserData(sal_uInt16 nNum) const { return (SdrObjUserData*)aList.GetObject(nNum); }
- void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF) { aList.Insert(pData,nPos); }
- SdrObjUserData* RemoveUserData(sal_uInt16 nNum) { return (SdrObjUserData*)aList.Remove(nNum);}
- void DeleteUserData(sal_uInt16 nNum) { delete RemoveUserData(nNum); }
+ sal_uInt16 GetUserDataCount() const;
+ SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
+ void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF);
+ SdrObjUserData* RemoveUserData(sal_uInt16 nNum);
+ void DeleteUserData(sal_uInt16 nNum);
};
//************************************************************
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 2c4e78d..40c5873 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -141,8 +141,26 @@ void SdrObjUserCall::Changed(const SdrObject& /*rObj*/, SdrUserCallType /*eType*
TYPEINIT0(SdrObjUserData);
-SdrObjUserData::~SdrObjUserData()
+SdrObjUserData::SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer) :
+ nInventor(nInv),
+ nIdentifier(nId),
+ nVersion(nVer) {}
+
+SdrObjUserData::SdrObjUserData(const SdrObjUserData& rData) :
+ nInventor(rData.nInventor),
+ nIdentifier(rData.nIdentifier),
+ nVersion(rData.nVersion) {}
+
+SdrObjUserData::~SdrObjUserData() {}
+
+sal_uInt32 SdrObjUserData::GetInventor() const
+{
+ return nInventor;
+}
+
+sal_uInt16 SdrObjUserData::GetId() const
{
+ return nIdentifier;
}
bool SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const
@@ -199,6 +217,11 @@ XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/
return String();
}
+SdrObjUserDataList::SdrObjUserDataList() :
+ aList(1024,4,4) {}
+
+SdrObjUserDataList::~SdrObjUserDataList() { Clear(); }
+
void SdrObjUserDataList::Clear()
{
sal_uInt16 nAnz=GetUserDataCount();
@@ -208,6 +231,31 @@ void SdrObjUserDataList::Clear()
aList.Clear();
}
+sal_uInt16 SdrObjUserDataList::GetUserDataCount() const
+{
+ return sal_uInt16(aList.Count());
+}
+
+SdrObjUserData* SdrObjUserDataList::GetUserData(sal_uInt16 nNum) const
+{
+ return (SdrObjUserData*)aList.GetObject(nNum);
+}
+
+void SdrObjUserDataList::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos)
+{
+ aList.Insert(pData,nPos);
+}
+
+SdrObjUserData* SdrObjUserDataList::RemoveUserData(sal_uInt16 nNum)
+{
+ return (SdrObjUserData*)aList.Remove(nNum);
+}
+
+void SdrObjUserDataList::DeleteUserData(sal_uInt16 nNum)
+{
+ delete RemoveUserData(nNum);
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
DBG_NAME(SdrObjGeoData);
commit 971417fc32d7eeebf45e7cd354edddf91fc6de7d
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 13:39:16 2012 -0500
Make these data members private.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 36fee37..4ad7ae2 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -304,7 +304,6 @@ class SdrObjPlusData
{
friend class SdrObject;
-public:
SfxBroadcaster* pBroadcast; // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=true). Auch fuer Konnektoren etc.
SdrObjUserDataList* pUserDataList; // applikationsspeziefische Daten
SdrGluePointList* pGluePoints; // Klebepunkte zum Ankleben von Objektverbindern
@@ -320,6 +319,8 @@ public:
SdrObjPlusData();
virtual ~SdrObjPlusData();
virtual SdrObjPlusData* Clone(SdrObject* pObj1) const;
+
+ void SetGluePoints(const SdrGluePointList& rPts);
};
//************************************************************
@@ -329,7 +330,7 @@ public:
//
//************************************************************
-class SdrObjTransformInfoRec
+class SVX_DLLPUBLIC SdrObjTransformInfoRec
{
public:
bool bSelectAllowed : 1; // false=Obj kann nicht selektiert werden
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index f42eab5..141322f 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1836,7 +1836,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
// be a result of GetGluePointList and thus the list is copied
if(pPlusData)
{
- *pPlusData->pGluePoints = aNewList;
+ pPlusData->SetGluePoints(aNewList);
}
}
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 532be65..2c4e78d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -277,6 +277,11 @@ SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
return pNeuPlusData;
}
+void SdrObjPlusData::SetGluePoints(const SdrGluePointList& rPts)
+{
+ return *pGluePoints = rPts;
+}
+
SdrObjTransformInfoRec::SdrObjTransformInfoRec() :
bSelectAllowed(true),
bMoveAllowed(true),
commit 2288981aab04a3ed2f4f2745ed455c256ccfa2cd
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 31 11:45:29 2012 -0500
Use bool & prefer rtl::OUString.
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 1bac35e..36fee37 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -193,7 +193,7 @@ public:
pVisiLayer(NULL),
pPageView(NULL),
nTol(0),
- bDown(sal_False)
+ bDown(false)
{}
};
@@ -281,10 +281,10 @@ public:
Rectangle aBoundRect;
Point aAnchor;
SdrGluePointList* pGPL;
- sal_Bool bMovProt;
- sal_Bool bSizProt;
- sal_Bool bNoPrint;
- sal_Bool bClosedObj;
+ bool bMovProt;
+ bool bSizProt;
+ bool bNoPrint;
+ bool bClosedObj;
bool mbVisible;
SdrLayerID mnLayerID;
@@ -305,15 +305,15 @@ class SdrObjPlusData
friend class SdrObject;
public:
- SfxBroadcaster* pBroadcast; // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=sal_True). Auch fuer Konnektoren etc.
+ SfxBroadcaster* pBroadcast; // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=true). Auch fuer Konnektoren etc.
SdrObjUserDataList* pUserDataList; // applikationsspeziefische Daten
SdrGluePointList* pGluePoints; // Klebepunkte zum Ankleben von Objektverbindern
// #i68101#
// object name, title and description
- String aObjName;
- String aObjTitle;
- String aObjDescription;
+ rtl::OUString aObjName;
+ rtl::OUString aObjTitle;
+ rtl::OUString aObjDescription;
public:
TYPEINFO();
@@ -332,50 +332,28 @@ public:
class SdrObjTransformInfoRec
{
public:
- unsigned bSelectAllowed : 1; // sal_False=Obj kann nicht selektiert werden
- unsigned bMoveAllowed : 1; // sal_False=Obj kann nicht verschoben werden
- unsigned bResizeFreeAllowed : 1; // sal_False=Obj kann nicht frei resized werden
- unsigned bResizePropAllowed : 1; // sal_False=Obj kann nichtmal proportional resized werden
- unsigned bRotateFreeAllowed : 1; // sal_False=Obj kann nicht frei gedreht werden
- unsigned bRotate90Allowed : 1; // sal_False=Obj kann nichtmal im 90deg Raster gedreht werden
- unsigned bMirrorFreeAllowed : 1; // sal_False=Obj kann nicht frei gespiegelt werden
- unsigned bMirror45Allowed : 1; // sal_False=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
- unsigned bMirror90Allowed : 1; // sal_False=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
- unsigned bTransparenceAllowed : 1; // sal_False=Obj does not have an interactive transparence control
- unsigned bGradientAllowed : 1; // sal_False=Obj dooes not have an interactive gradient control
- unsigned bShearAllowed : 1; // sal_False=Obj kann nicht verzerrt werden
- unsigned bEdgeRadiusAllowed : 1;
- unsigned bNoOrthoDesired : 1; // sal_True bei Rect; ... sal_False bei BMP,MTF;
- unsigned bNoContortion : 1; // sal_False=Kein verzerren (bei Crook) moeglich (nur sal_True bei PathObj und Gruppierten PathObjs)
- unsigned bCanConvToPath : 1; // sal_False=Keine Konvertierung in PathObj moeglich
- unsigned bCanConvToPoly : 1; // sal_False=Keine Konvertierung in PolyObj moeglich
- unsigned bCanConvToContour : 1; // sal_False=no conversion down to whole contour possible
- unsigned bCanConvToPathLineToArea : 1; // sal_False=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
- unsigned bCanConvToPolyLineToArea : 1; // sal_False=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
-
-public:
- SdrObjTransformInfoRec()
- : bSelectAllowed(sal_True),
- bMoveAllowed(sal_True),
- bResizeFreeAllowed(sal_True),
- bResizePropAllowed(sal_True),
- bRotateFreeAllowed(sal_True),
- bRotate90Allowed(sal_True),
- bMirrorFreeAllowed(sal_True),
- bMirror45Allowed(sal_True),
- bMirror90Allowed(sal_True),
- bTransparenceAllowed(sal_True),
- bGradientAllowed(sal_True),
- bShearAllowed(sal_True),
- bEdgeRadiusAllowed(sal_True),
- bNoOrthoDesired(sal_True),
- bNoContortion(sal_True),
- bCanConvToPath(sal_True),
- bCanConvToPoly(sal_True),
- bCanConvToContour(sal_False),
- bCanConvToPathLineToArea(sal_True),
- bCanConvToPolyLineToArea(sal_True)
- {}
+ bool bSelectAllowed : 1; // false=Obj kann nicht selektiert werden
+ bool bMoveAllowed : 1; // false=Obj kann nicht verschoben werden
+ bool bResizeFreeAllowed : 1; // false=Obj kann nicht frei resized werden
+ bool bResizePropAllowed : 1; // false=Obj kann nichtmal proportional resized werden
+ bool bRotateFreeAllowed : 1; // false=Obj kann nicht frei gedreht werden
+ bool bRotate90Allowed : 1; // false=Obj kann nichtmal im 90deg Raster gedreht werden
+ bool bMirrorFreeAllowed : 1; // false=Obj kann nicht frei gespiegelt werden
+ bool bMirror45Allowed : 1; // false=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
+ bool bMirror90Allowed : 1; // false=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
+ bool bTransparenceAllowed : 1; // false=Obj does not have an interactive transparence control
+ bool bGradientAllowed : 1; // false=Obj dooes not have an interactive gradient control
+ bool bShearAllowed : 1; // false=Obj kann nicht verzerrt werden
+ bool bEdgeRadiusAllowed : 1;
+ bool bNoOrthoDesired : 1; // true bei Rect; ... false bei BMP,MTF;
+ bool bNoContortion : 1; // false=Kein verzerren (bei Crook) moeglich (nur true bei PathObj und Gruppierten PathObjs)
+ bool bCanConvToPath : 1; // false=Keine Konvertierung in PathObj moeglich
+ bool bCanConvToPoly : 1; // false=Keine Konvertierung in PolyObj moeglich
+ bool bCanConvToContour : 1; // false=no conversion down to whole contour possible
+ bool bCanConvToPathLineToArea : 1; // false=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
+ bool bCanConvToPolyLineToArea : 1; // false=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
+
+ SdrObjTransformInfoRec();
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -461,42 +439,42 @@ protected:
SdrLayerID mnLayerID;
// Objekt zeigt nur auf ein Anderes
- unsigned bVirtObj : 1;
- unsigned bSnapRectDirty : 1;
- unsigned bNetLock : 1; // ni
- unsigned bInserted : 1; // nur wenn sal_True gibt's RepaintBroadcast & SetModify
- unsigned bGrouped : 1; // Member eines GroupObjektes?
+ bool bVirtObj : 1;
+ bool bSnapRectDirty : 1;
+ bool bNetLock : 1; // ni
+ bool bInserted : 1; // nur wenn true gibt's RepaintBroadcast & SetModify
+ bool bGrouped : 1; // Member eines GroupObjektes?
// Die folgende Flags werden gestreamt
- unsigned bMovProt : 1; // If true, the position is protected
- unsigned bSizProt : 1; // If true, the size is protected
- unsigned bNoPrint : 1; // If true, the object is not printed.
- unsigned mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
- // Wenn bEmptyPresObj sal_True ist, handelt es sich um ein
+ bool bMovProt : 1; // If true, the position is protected
+ bool bSizProt : 1; // If true, the size is protected
+ bool bNoPrint : 1; // If true, the object is not printed.
+ bool mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
+ // Wenn bEmptyPresObj true ist, handelt es sich um ein
// Praesentationsobjekt, dem noch kein Inhalt zugewiesen
// wurde. Default ist das Flag auf FALSE. Die Verwaltung
// uebernimmt die Applikation. Im Zuweisungsoperator sowie
// beim Clone wird das Flag nicht mitkopiert!
// Das Flag ist persistent.
- unsigned bEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
+ bool bEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
- // sal_True=Objekt ist als Objekt der MasterPage nicht sichtbar
- unsigned bNotVisibleAsMaster : 1;
+ // true=Objekt ist als Objekt der MasterPage nicht sichtbar
+ bool bNotVisibleAsMaster : 1;
- // sal_True=Es handelt sich hierbei um ein geschlossenes Objekt, also nicht Linie oder Kreisbogen ...
- unsigned bClosedObj : 1;
+ // true=Es handelt sich hierbei um ein geschlossenes Objekt, also nicht Linie oder Kreisbogen ...
+ bool bClosedObj : 1;
- unsigned bIsEdge : 1;
- unsigned bIs3DObj : 1;
- unsigned bMarkProt : 1; // Markieren verboten. Persistent
- unsigned bIsUnoObj : 1;
- unsigned bNotMasterCachable : 1;
+ bool bIsEdge : 1;
+ bool bIs3DObj : 1;
+ bool bMarkProt : 1; // Markieren verboten. Persistent
+ bool bIsUnoObj : 1;
+ bool bNotMasterCachable : 1;
// #i25616#
- unsigned mbLineIsOutsideGeometry : 1;
+ bool mbLineIsOutsideGeometry : 1;
// #i25616#
- unsigned mbSupportTextIndentingOnLineWidthChange : 1;
+ bool mbSupportTextIndentingOnLineWidthChange : 1;
// on import of OLE object from MS documents the BLIP size might be retrieved,
// in this case the following member is initialized as nonempty rectangle
@@ -520,11 +498,11 @@ protected:
String GetWinkStr(long nWink, bool bNoDegChar = false) const;
String GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, bool bNoUnitChars = false) const;
- // bNotMyself=sal_True bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
+ // bNotMyself=true bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
// Wird z.B. benoetigt fuer NbcMove, denn da movt man SnapRect und aOutRect
// i.d.R. gleich mit um die Neuberechnung zu sparen.
public:
- virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
+ virtual void SetRectsDirty(sal_Bool bNotMyself = false);
protected:
// ueberladen, wenn man sich von SdrObjPlusData abgeleitet hat:
@@ -599,15 +577,15 @@ public:
// An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup
// or SdrOle2Obj.
// It may also have a Title and a Description for accessibility purposes.
- void SetName(const String& rStr);
- String GetName() const;
- void SetTitle(const String& rStr);
- String GetTitle() const;
- void SetDescription(const String& rStr);
- String GetDescription() const;
+ void SetName(const rtl::OUString& rStr);
+ rtl::OUString GetName() const;
+ void SetTitle(const rtl::OUString& rStr);
+ rtl::OUString GetTitle() const;
+ void SetDescription(const rtl::OUString& rStr);
+ rtl::OUString GetDescription() const;
// Fuer Gruppenobjekte
- sal_Bool IsGroupObject() const { return GetSubList()!=NULL; }
+ bool IsGroupObject() const { return GetSubList()!=NULL; }
virtual SdrObjList* GetSubList() const;
SdrObject* GetUpGroup() const;
@@ -669,8 +647,8 @@ public:
// Tooling for painting a single object to a OutputDevice. This will be needed as long
// as not all painting is changed to use DrawContact objects.
- sal_Bool SingleObjectPainter(OutputDevice& rOut) const;
- sal_Bool LineGeometryUsageIsNecessary() const;
+ bool SingleObjectPainter(OutputDevice& rOut) const;
+ bool LineGeometryUsageIsNecessary() const;
/**
Returns a copy of the object. Every inherited class must reimplement this (in class Foo
@@ -704,7 +682,7 @@ public:
// Polygon wird das wohl ein einfacher Selektionshandle sein, bei einer
// Bezierkurve dagegen koennen das schon bis zu 3 Handles werden (inkl Gewichte).
// GetHdl() und GetPlusHdl() muessen Handleinstanzen mit new erzeugen!
- // Ein Objekt, das bei HasSpacialDrag() sal_True liefert muss diese Methoden
+ // Ein Objekt, das bei HasSpacialDrag() true liefert muss diese Methoden
// zur Verfuegung stellen (inkl. FillHdlList).
virtual sal_uInt32 GetHdlCount() const;
virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
@@ -718,8 +696,8 @@ public:
// Stuetzstellen bei Splines, Gewichte bei Bezierkurven und Pointer von
// Labelobjekten muss vom Objekt selbst gehandled werden. Um das Model
// Statusfrei zu halten werden die Statusdaten an der View gehalten und dem
- // Objekt dann uebergeben. EndDrag liefrt im Normalfall sal_True fuer Erfolg.
- // sal_False kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
+ // Objekt dann uebergeben. EndDrag liefrt im Normalfall true fuer Erfolg.
+ // false kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
// veraendert hat, wobei dir evtl. Tatsache das die Maus nicht bewegt wurde
// bereits von der View abgefangen wird.
virtual bool hasSpecialDrag() const;
@@ -743,14 +721,14 @@ public:
// BegCreate()-Methode gerufen. Bei jedem MausMode wird dann MovCreate
// gerufen. BrkCreate() bedeutet, dass der User die interaktive Objekt-
// erzeugung abgebrochen hat. EndCreate() wird gerufen beim MouseUp-Event.
- // Liefert EndCreate() ein sal_True, so ist die Objekterzeugung abgeschlossen;
+ // Liefert EndCreate() ein true, so ist die Objekterzeugung abgeschlossen;
// das Objekt wird in die entsprechende Liste eingefuegt. Andernfalls
- // (EndCreate()==sal_False) gehe ich davon aus, dass weitere Punkte zur
+ // (EndCreate()==false) gehe ich davon aus, dass weitere Punkte zur
// Objekterzeugung notwendig sind (Polygon,...). Der Parameter eCmd
// enthaelt die Anzahl der Mausklicks (so die App diese durchreicht).
// BckCreate() -> Letztes EndCreate() rueckgaengig machen (z.B. letzten
// Polygonpunkt wieder loeschen).
- // RetrunCode: sal_True=Weiter gehts, sal_False=Create dadurch abgebrochen.
+ // RetrunCode: true=Weiter gehts, false=Create dadurch abgebrochen.
virtual bool BegCreate(SdrDragStat& rStat);
virtual bool MovCreate(SdrDragStat& rStat); // TRUE=Xor muss repainted werden
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
@@ -842,7 +820,7 @@ public:
const SfxItemSet& GetMergedItemSet() const;
void SetMergedItem(const SfxPoolItem& rItem);
void ClearMergedItem(const sal_uInt16 nWhich = 0);
- void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
const SfxPoolItem& GetMergedItem(const sal_uInt16 nWhich) const;
// internal versions
@@ -854,7 +832,7 @@ protected:
public:
// syntactical sugar for ItemSet accesses
- void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false);
// NotPersistAttr fuer Layer, ObjName, geometrische Transformationen, ...
void TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const;
@@ -863,7 +841,7 @@ public:
// bDontRemoveHardAttr=FALSE: alle in der Vorlage gesetzten Attribute werden am
// Zeichenobjekt auf Default gesetzt; TRUE: alle harten Attribute bleiben erhalten.
- void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
SfxStyleSheet* GetStyleSheet() const;
@@ -891,7 +869,7 @@ public:
virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
- sal_Bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
+ bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
// Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
// sowie SvdGlue.HXX und SvdGlEV.HXX)
@@ -963,9 +941,9 @@ public:
// Bezierkurve (oder beides) zu verwandeln, dann sollten die folgenden
// Methoden ueberladen werden.
// Z.B. Ein RectObj mit Strichstaerke 10, SOLID_PEN in Polygon wandeln:
- // Im Modus bLineToArea=sal_False soll ein PolyObj mit 4 Stuetzstellen,
+ // Im Modus bLineToArea=false soll ein PolyObj mit 4 Stuetzstellen,
// Strichstaerke 10 und SOLiD_PEN erzeugt werden.
- // Im Modus bLineToArea=sal_True dagegen soll das generierte Obj immer ein
+ // Im Modus bLineToArea=true dagegen soll das generierte Obj immer ein
// LinienAttribut NULL_PEN haben, und die Linie (auch Linienmuster) selbst
// durch Polygonflaechen emuliert werden, die dadurch anschliessend vom
// Anwender manipuliert werden koennen. Das RectObj kann sich somit also
@@ -977,55 +955,55 @@ public:
// Der Returnwert ist jeweils ein SdrObject*, da als Rueckgabe zur Not
// auch Gruppenobjekte erlaubt sind (z.B. fuer SdrTextObj).
// Bei der Konvertierung von TextObj nach PathObj wird es wohl so sein,
- // dass beide Modi (bLineToArea=sal_True/sal_False) identisch sind.
+ // dass beide Modi (bLineToArea=true/false) identisch sind.
// Defaulted sind diese Methoden auf "Ich kann das nicht" (FALSE/NULL).
virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier) const;
- SdrObject* ConvertToPolyObj(sal_Bool bBezier, sal_Bool bLineToArea) const;
+ SdrObject* ConvertToPolyObj(bool bBezier, bool bLineToArea) const;
// convert this path object to contour object; bForceLineDash converts even
// when there is no filled new polygon created from line-to-polygon conversion,
// specially used for XLINE_DASH and 3D conversion
- SdrObject* ConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash = sal_False) const;
- SdrObject* ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash = sal_False) const;
+ SdrObject* ConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
+ SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
// TRUE: Referenz auf ein Obj
- sal_Bool IsVirtualObj() const { return bVirtObj; }
+ bool IsVirtualObj() const { return bVirtObj; }
- // sal_True=Obj kann warsch. gefuellt werden; sal_False=Obj kann warsch. Linienenden haben.
+ // true=Obj kann warsch. gefuellt werden; false=Obj kann warsch. Linienenden haben.
// ungueltig, wenn es sich um ein GroupObj handelt.
- sal_Bool IsClosedObj() const { return bClosedObj; }
-
- sal_Bool IsEdgeObj() const { return bIsEdge; }
- sal_Bool Is3DObj() const { return bIs3DObj; }
- sal_Bool IsUnoObj() const { return bIsUnoObj; }
- sal_Bool IsMasterCachable() const { return !bNotMasterCachable; }
- sal_Bool ShareLock() { sal_Bool r=!bNetLock; bNetLock=sal_True; return r; }
- void ShareUnlock() { bNetLock=sal_False; }
- sal_Bool IsShareLock() const { return bNetLock; }
- void SetMarkProtect(sal_Bool bProt) { bMarkProt=bProt; }
- sal_Bool IsMarkProtect() const { return bMarkProt; }
- void SetInserted(sal_Bool bIns);
- sal_Bool IsInserted() const { return bInserted; }
- void SetGrouped(sal_Bool bGrp) { bGrouped=bGrp; }
- sal_Bool IsGrouped() const { return bGrouped; }
- void SetMoveProtect(sal_Bool bProt);
- sal_Bool IsMoveProtect() const { return bMovProt; }
- void SetResizeProtect(sal_Bool bProt);
- sal_Bool IsResizeProtect() const { return bSizProt; }
- void SetPrintable(sal_Bool bPrn);
- sal_Bool IsPrintable() const { return !bNoPrint; }
- void SetVisible(sal_Bool bVisible);
- sal_Bool IsVisible() const { return mbVisible; }
- void SetEmptyPresObj(sal_Bool bEpt) { bEmptyPresObj=bEpt; }
- sal_Bool IsEmptyPresObj() const { return bEmptyPresObj; }
- void SetNotVisibleAsMaster(sal_Bool bFlg) { bNotVisibleAsMaster=bFlg; }
- sal_Bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster; }
+ bool IsClosedObj() const { return bClosedObj; }
+
+ bool IsEdgeObj() const { return bIsEdge; }
+ bool Is3DObj() const { return bIs3DObj; }
+ bool IsUnoObj() const { return bIsUnoObj; }
+ bool IsMasterCachable() const { return !bNotMasterCachable; }
+ bool ShareLock() { bool r=!bNetLock; bNetLock=true; return r; }
+ void ShareUnlock() { bNetLock=false; }
+ bool IsShareLock() const { return bNetLock; }
+ void SetMarkProtect(bool bProt) { bMarkProt=bProt; }
+ bool IsMarkProtect() const { return bMarkProt; }
+ void SetInserted(bool bIns);
+ bool IsInserted() const { return bInserted; }
+ void SetGrouped(bool bGrp) { bGrouped=bGrp; }
+ bool IsGrouped() const { return bGrouped; }
+ void SetMoveProtect(bool bProt);
+ bool IsMoveProtect() const { return bMovProt; }
+ void SetResizeProtect(bool bProt);
+ bool IsResizeProtect() const { return bSizProt; }
+ void SetPrintable(bool bPrn);
+ bool IsPrintable() const { return !bNoPrint; }
+ void SetVisible(bool bVisible);
+ bool IsVisible() const { return mbVisible; }
+ void SetEmptyPresObj(bool bEpt) { bEmptyPresObj=bEpt; }
+ bool IsEmptyPresObj() const { return bEmptyPresObj; }
+ void SetNotVisibleAsMaster(bool bFlg) { bNotVisibleAsMaster=bFlg; }
+ bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster; }
// #i25616#
- sal_Bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry; }
+ bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry; }
// #i25616#
- sal_Bool DoesSupportTextIndentingOnLineWidthChange() const { return mbSupportTextIndentingOnLineWidthChange; }
+ bool DoesSupportTextIndentingOnLineWidthChange() const { return mbSupportTextIndentingOnLineWidthChange; }
// applikationsspeziefische Daten
sal_uInt16 GetUserDataCount() const;
@@ -1103,7 +1081,7 @@ public:
// #116168#
// Give info if object is in destruction
- sal_Bool IsInDestruction() const;
+ bool IsInDestruction() const;
// return if fill is != XFILL_NONE
bool HasFillStyle() const;
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 41cef00..66305b2 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -749,7 +749,8 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool /*bO
sal_Bool bPrintable =sal_True ,bPrintableDC=sal_False;
sal_Bool bVisible = sal_True, bVisibleDC=sal_False;
SdrLayerID nLayerId=0; sal_Bool bLayerDC=sal_False;
- XubString aObjName; sal_Bool bObjNameDC=sal_False,bObjNameSet=sal_False;
+ rtl::OUString aObjName;
+ sal_Bool bObjNameDC=sal_False,bObjNameSet=sal_False;
long nSnapPosX=0; sal_Bool bSnapPosXDC=sal_False;
long nSnapPosY=0; sal_Bool bSnapPosYDC=sal_False;
long nSnapWdt=0; sal_Bool bSnapWdtDC=sal_False;
@@ -809,7 +810,8 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool /*bO
if (!bObjNameSet) {
aObjName=pObj->GetName();
} else {
- if (aObjName!=pObj->GetName()) bObjNameDC=sal_True;
+ if (!aObjName.equals(pObj->GetName()))
+ bObjNameDC = true;
}
}
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0ece890..532be65 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -147,7 +147,7 @@ SdrObjUserData::~SdrObjUserData()
bool SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const
{
- return sal_False;
+ return false;
}
SdrObject* SdrObjUserData::CheckMacroHit(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const
@@ -191,7 +191,7 @@ void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRec
bool SdrObjUserData::DoMacro(const SdrObjMacroHitRec& /*rRec*/, SdrObject* /*pObj*/)
{
- return sal_False;
+ return false;
}
XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const
@@ -214,10 +214,10 @@ DBG_NAME(SdrObjGeoData);
SdrObjGeoData::SdrObjGeoData():
pGPL(NULL),
- bMovProt(sal_False),
- bSizProt(sal_False),
- bNoPrint(sal_False),
- bClosedObj(sal_False),
+ bMovProt(false),
+ bSizProt(false),
+ bNoPrint(false),
+ bClosedObj(false),
mbVisible(true),
mnLayerID(0)
{
@@ -277,6 +277,28 @@ SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
return pNeuPlusData;
}
+SdrObjTransformInfoRec::SdrObjTransformInfoRec() :
+ bSelectAllowed(true),
+ bMoveAllowed(true),
+ bResizeFreeAllowed(true),
+ bResizePropAllowed(true),
+ bRotateFreeAllowed(true),
+ bRotate90Allowed(true),
+ bMirrorFreeAllowed(true),
+ bMirror45Allowed(true),
+ bMirror90Allowed(true),
+ bTransparenceAllowed(true),
+ bGradientAllowed(true),
+ bShearAllowed(true),
+ bEdgeRadiusAllowed(true),
+ bNoOrthoDesired(true),
+ bNoContortion(true),
+ bCanConvToPath(true),
+ bCanConvToPoly(true),
+ bCanConvToContour(false),
+ bCanConvToPathLineToArea(true),
+ bCanConvToPolyLineToArea(true) {}
+
//////////////////////////////////////////////////////////////////////////////
// BaseProperties section
@@ -366,30 +388,30 @@ SdrObject::SdrObject()
,maWeakUnoShape()
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list