diff options
Diffstat (limited to 'svx/source/svdraw/svdomeas.cxx')
-rw-r--r-- | svx/source/svdraw/svdomeas.cxx | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index ade79ec70878..f4de0ea2726d 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -79,8 +79,8 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe { rStr.Erase(); Fraction aMeasureScale(1, 1); - BOOL bTextRota90(FALSE); - BOOL bShowUnit(FALSE); + sal_Bool bTextRota90(sal_False); + sal_Bool bShowUnit(sal_False); FieldUnit eMeasureUnit(FUNIT_NONE); FieldUnit eModUIUnit(FUNIT_NONE); @@ -104,7 +104,7 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe if(eMeasureUnit == FUNIT_NONE) eMeasureUnit = eModUIUnit; - INT32 nLen(GetLen(aPt2 - aPt1)); + sal_Int32 nLen(GetLen(aPt2 - aPt1)); Fraction aFact(1,1); if(eMeasureUnit != eModUIUnit) @@ -124,7 +124,7 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe nLen = BigMulDiv(nLen, aFact.GetNumerator(), aFact.GetDenominator()); } - pModel->TakeMetricStr(nLen, rStr, TRUE, nNumDigits); + pModel->TakeMetricStr(nLen, rStr, sal_True, nNumDigits); if(!aFact.IsValid()) { @@ -215,7 +215,7 @@ sdr::contact::ViewContact* SdrMeasureObj::CreateObjectSpecificViewContact() TYPEINIT1(SdrMeasureObj,SdrTextObj); SdrMeasureObj::SdrMeasureObj(): - bTextDirty(FALSE) + bTextDirty(sal_False) { // #i25616# mbSupportTextIndentingOnLineWidthChange = sal_False; @@ -224,7 +224,7 @@ SdrMeasureObj::SdrMeasureObj(): SdrMeasureObj::SdrMeasureObj(const Point& rPt1, const Point& rPt2): aPt1(rPt1), aPt2(rPt2), - bTextDirty(FALSE) + bTextDirty(sal_False) { // #i25616# mbSupportTextIndentingOnLineWidthChange = sal_False; @@ -236,31 +236,31 @@ SdrMeasureObj::~SdrMeasureObj() void SdrMeasureObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { - rInfo.bSelectAllowed =TRUE; - rInfo.bMoveAllowed =TRUE; - rInfo.bResizeFreeAllowed=TRUE; - rInfo.bResizePropAllowed=TRUE; - rInfo.bRotateFreeAllowed=TRUE; - rInfo.bRotate90Allowed =TRUE; - rInfo.bMirrorFreeAllowed=TRUE; - rInfo.bMirror45Allowed =TRUE; - rInfo.bMirror90Allowed =TRUE; - rInfo.bTransparenceAllowed = FALSE; - rInfo.bGradientAllowed = FALSE; - rInfo.bShearAllowed =TRUE; - rInfo.bEdgeRadiusAllowed=FALSE; - rInfo.bNoOrthoDesired =TRUE; - rInfo.bNoContortion =FALSE; - rInfo.bCanConvToPath =FALSE; - rInfo.bCanConvToPoly =TRUE; - rInfo.bCanConvToPathLineToArea=FALSE; - rInfo.bCanConvToPolyLineToArea=FALSE; + rInfo.bSelectAllowed =sal_True; + rInfo.bMoveAllowed =sal_True; + rInfo.bResizeFreeAllowed=sal_True; + rInfo.bResizePropAllowed=sal_True; + rInfo.bRotateFreeAllowed=sal_True; + rInfo.bRotate90Allowed =sal_True; + rInfo.bMirrorFreeAllowed=sal_True; + rInfo.bMirror45Allowed =sal_True; + rInfo.bMirror90Allowed =sal_True; + rInfo.bTransparenceAllowed = sal_False; + rInfo.bGradientAllowed = sal_False; + rInfo.bShearAllowed =sal_True; + rInfo.bEdgeRadiusAllowed=sal_False; + rInfo.bNoOrthoDesired =sal_True; + rInfo.bNoContortion =sal_False; + rInfo.bCanConvToPath =sal_False; + rInfo.bCanConvToPoly =sal_True; + rInfo.bCanConvToPathLineToArea=sal_False; + rInfo.bCanConvToPolyLineToArea=sal_False; rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -UINT16 SdrMeasureObj::GetObjIdentifier() const +sal_uInt16 SdrMeasureObj::GetObjIdentifier() const { - return (UINT16)OBJ_MEASURE; + return (sal_uInt16)OBJ_MEASURE; } struct ImpMeasureRec : public SdrDragStatUserData @@ -275,17 +275,17 @@ struct ImpMeasureRec : public SdrDragStatUserData long nHelplineDist; long nHelpline1Len; long nHelpline2Len; - FASTBOOL bBelowRefEdge; - FASTBOOL bTextRota90; - FASTBOOL bTextUpsideDown; + int bBelowRefEdge; + int bTextRota90; + int bTextUpsideDown; long nMeasureOverhang; FieldUnit eMeasureUnit; Fraction aMeasureScale; - FASTBOOL bShowUnit; + int bShowUnit; String aFormatString; - FASTBOOL bTextAutoAngle; + int bTextAutoAngle; long nTextAutoAngleView; - FASTBOOL bTextIsFixedAngle; + int bTextIsFixedAngle; long nTextFixedAngle; }; @@ -312,7 +312,7 @@ struct ImpMeasurePoly double nLineCos; double nHlpSin; double nHlpCos; - USHORT nMainlineAnz; + sal_uInt16 nMainlineAnz; SdrMeasureTextHPos eUsedTextHPos; SdrMeasureTextVPos eUsedTextVPos; long nLineWdt2; // Halbe Strichstaerke @@ -321,11 +321,11 @@ struct ImpMeasurePoly long nArrow1Wdt; // Breite des 1. Pfeils long nArrow2Wdt; // Breite des 2. Pfeils long nShortLineLen; // Linienlaenge, wenn PfeileAussen - FASTBOOL bArrow1Center; // Pfeil 1 zentriert? - FASTBOOL bArrow2Center; // Pfeil 2 zentriert? - FASTBOOL bAutoUpsideDown; // UpsideDown durch Automatik - FASTBOOL bPfeileAussen; - FASTBOOL bBreakedLine; + int bArrow1Center; // Pfeil 1 zentriert? + int bArrow2Center; // Pfeil 2 zentriert? + int bAutoUpsideDown; // UpsideDown durch Automatik + int bPfeileAussen; + int bBreakedLine; }; void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const @@ -389,7 +389,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.nArrow2Wdt=0; long nArrowNeed=0; long nShortLen=0; - FASTBOOL bPfeileAussen=FALSE; + int bPfeileAussen=sal_False; const SfxItemSet& rSet = GetObjectItemSet(); sal_Int32 nLineWdt = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); // Strichstaerke @@ -413,35 +413,35 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& // nArrowLen ist bei bCenter bereits halbiert // Bei 2 Pfeilen a 4mm ist unter 10mm Schluss. nArrowNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2; - if (rPol.nLineLen<nArrowNeed) bPfeileAussen=TRUE; + if (rPol.nLineLen<nArrowNeed) bPfeileAussen=sal_True; nShortLen=(nArrow1Len+nArrow1Wdt + nArrow2Len+nArrow2Wdt) /2; rPol.eUsedTextHPos=rRec.eWantTextHPos; rPol.eUsedTextVPos=rRec.eWantTextVPos; if (rPol.eUsedTextVPos==SDRMEASURE_TEXTVAUTO) rPol.eUsedTextVPos=SDRMEASURE_ABOVE; - FASTBOOL bBrkLine=rPol.eUsedTextVPos==SDRMEASURETEXT_BREAKEDLINE; + int bBrkLine=rPol.eUsedTextVPos==SDRMEASURETEXT_BREAKEDLINE; if (rPol.eUsedTextVPos==SDRMEASURETEXT_VERTICALCENTERED) { OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject(); if (pOutlinerParaObject!=NULL && pOutlinerParaObject->GetTextObject().GetParagraphCount()==1) { - bBrkLine=TRUE; // Unterbrochene Linie, wenn nur 1 Absatz. + bBrkLine=sal_True; // Unterbrochene Linie, wenn nur 1 Absatz. } } rPol.bBreakedLine=bBrkLine; if (rPol.eUsedTextHPos==SDRMEASURE_TEXTHAUTO) { // bei zu breitem Text diesen eventuell nach aussen schieben - FASTBOOL bOutside=FALSE; + int bOutside=sal_False; long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height(); - if (nNeedSiz>rPol.nLineLen) bOutside=TRUE; // Text passt nicht in die Mitte + if (nNeedSiz>rPol.nLineLen) bOutside=sal_True; // Text passt nicht in die Mitte if (bBrkLine) { - if (nNeedSiz+nArrowNeed>rPol.nLineLen) bPfeileAussen=TRUE; // Text passt in die Mitte, wenn die Pfeile nach aussen kommen + if (nNeedSiz+nArrowNeed>rPol.nLineLen) bPfeileAussen=sal_True; // Text passt in die Mitte, wenn die Pfeile nach aussen kommen } else { long nSmallNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2/4; - if (nNeedSiz+nSmallNeed>rPol.nLineLen) bPfeileAussen=TRUE; // Text passt in die Mitte, wenn die Pfeile nach aussen kommen + if (nNeedSiz+nSmallNeed>rPol.nLineLen) bPfeileAussen=sal_True; // Text passt in die Mitte, wenn die Pfeile nach aussen kommen } rPol.eUsedTextHPos=bOutside ? SDRMEASURE_TEXTLEFTOUTSIDE : SDRMEASURE_TEXTINSIDE; } - if (rPol.eUsedTextHPos!=SDRMEASURE_TEXTINSIDE) bPfeileAussen=TRUE; + if (rPol.eUsedTextHPos!=SDRMEASURE_TEXTINSIDE) bPfeileAussen=sal_True; rPol.nArrow1Wdt=nArrow1Wdt; rPol.nArrow2Wdt=nArrow2Wdt; rPol.nShortLineLen=nShortLen; @@ -461,12 +461,12 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol.nTextWink=rPol.nLineWink; if (rRec.bTextRota90) rPol.nTextWink+=9000; - rPol.bAutoUpsideDown=FALSE; + rPol.bAutoUpsideDown=sal_False; if (rRec.bTextAutoAngle) { long nTmpWink=NormAngle360(rPol.nTextWink-rRec.nTextAutoAngleView); if (nTmpWink>=18000) { rPol.nTextWink+=18000; - rPol.bAutoUpsideDown=TRUE; + rPol.bAutoUpsideDown=sal_True; } } @@ -581,8 +581,8 @@ basegfx::B2DPolyPolygon SdrMeasureObj::ImpCalcXPoly(const ImpMeasurePoly& rPol) return aRetval; } -FASTBOOL SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, USHORT nPara, USHORT nPos, - FASTBOOL bEdit, +int SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, + int bEdit, Color*& rpTxtColor, Color*& rpFldColor, XubString& rRet) const { const SvxFieldData* pField=rField.GetField(); @@ -596,7 +596,7 @@ FASTBOOL SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, USHORT nPara, rpFldColor=NULL; } } - return TRUE; + return sal_True; } else { return SdrTextObj::CalcFieldValue(rField,nPara,nPos,bEdit,rpTxtColor,rpFldColor,rRet); } @@ -628,14 +628,14 @@ void SdrMeasureObj::UndirtyText() const rOutliner.SetText(*pOutlinerParaObject); } - rOutliner.SetUpdateMode(TRUE); + rOutliner.SetUpdateMode(sal_True); rOutliner.UpdateFields(); Size aSiz(rOutliner.CalcTextSize()); rOutliner.Clear(); // 3x casting auf nonconst ((SdrMeasureObj*)this)->aTextSize=aSiz; - ((SdrMeasureObj*)this)->bTextSizeDirty=FALSE; - ((SdrMeasureObj*)this)->bTextDirty=FALSE; + ((SdrMeasureObj*)this)->bTextSizeDirty=sal_False; + ((SdrMeasureObj*)this)->bTextDirty=sal_False; } } @@ -667,9 +667,9 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const } Point aTextPos; - FASTBOOL bRota90=aRec.bTextRota90; - FASTBOOL bUpsideDown=aRec.bTextUpsideDown!=aMPol.bAutoUpsideDown; - FASTBOOL bBelowRefEdge=aRec.bBelowRefEdge; + int bRota90=aRec.bTextRota90; + int bUpsideDown=aRec.bTextUpsideDown!=aMPol.bAutoUpsideDown; + int bBelowRefEdge=aRec.bBelowRefEdge; SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos; SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; if (!bRota90) { @@ -910,9 +910,9 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c const SdrHdl* pHdl=rDrag.GetHdl(); sal_uInt32 nHdlNum(pHdl->GetObjHdlNum()); - FASTBOOL bOrtho=rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho(); - FASTBOOL bBigOrtho=bOrtho && rDrag.GetView()->IsBigOrtho(); - FASTBOOL bBelow=rRec.bBelowRefEdge; + int bOrtho=rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho(); + int bBigOrtho=bOrtho && rDrag.GetView()->IsBigOrtho(); + int bBelow=rRec.bBelowRefEdge; Point aPt(rDrag.GetNow()); switch (nHdlNum) { @@ -929,22 +929,22 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c if (bOrtho) rRec.nHelpline1Len=rRec.nHelpline2Len; } break; case 2: case 3: { - FASTBOOL bAnf=nHdlNum==2; + int bAnf=nHdlNum==2; Point& rMov=bAnf ? rRec.aPt1 : rRec.aPt2; Point aMov(rMov); Point aFix(bAnf ? rRec.aPt2 : rRec.aPt1); if (bOrtho) { long ndx0=aMov.X()-aFix.X(); long ndy0=aMov.Y()-aFix.Y(); - FASTBOOL bHLin=ndy0==0; - FASTBOOL bVLin=ndx0==0; + int bHLin=ndy0==0; + int bVLin=ndx0==0; if (!bHLin || !bVLin) { // sonst ist aPt1==aPt2 long ndx=aPt.X()-aFix.X(); long ndy=aPt.Y()-aFix.Y(); double nXFact=0; if (!bVLin) nXFact=(double)ndx/(double)ndx0; double nYFact=0; if (!bHLin) nYFact=(double)ndy/(double)ndy0; - FASTBOOL bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho); - FASTBOOL bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho); + int bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho); + int bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho); if (bHor) ndy=long(ndy0*nXFact); if (bVer) ndx=long(ndx0*nYFact); aPt=aFix; @@ -971,16 +971,16 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c //////////////////////////////////////////////////////////////////////////////////////////////////// -FASTBOOL SdrMeasureObj::BegCreate(SdrDragStat& rStat) +int SdrMeasureObj::BegCreate(SdrDragStat& rStat) { rStat.SetOrtho8Possible(); aPt1=rStat.GetStart(); aPt2=rStat.GetNow(); SetTextDirty(); - return TRUE; + return sal_True; } -FASTBOOL SdrMeasureObj::MovCreate(SdrDragStat& rStat) +int SdrMeasureObj::MovCreate(SdrDragStat& rStat) { SdrView* pView=rStat.GetView(); aPt1=rStat.GetStart(); @@ -991,20 +991,20 @@ FASTBOOL SdrMeasureObj::MovCreate(SdrDragStat& rStat) } SetTextDirty(); SetBoundRectDirty(); - bSnapRectDirty=TRUE; - return TRUE; + bSnapRectDirty=sal_True; + return sal_True; } -FASTBOOL SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) +int SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { SetTextDirty(); SetRectsDirty(); return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2); } -FASTBOOL SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/) +int SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/) { - return FALSE; + return sal_False; } void SdrMeasureObj::BrkCreate(SdrDragStat& /*rStat*/) @@ -1073,7 +1073,7 @@ void SdrMeasureObj::NbcMirror(const Point& rRef1, const Point& rRef2) SetRectsDirty(); } -void SdrMeasureObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear) +void SdrMeasureObj::NbcShear(const Point& rRef, long nWink, double tn, int bVShear) { SdrTextObj::NbcShear(rRef,nWink,tn,bVShear); ShearPoint(aPt1,rRef,tn,bVShear); @@ -1158,7 +1158,7 @@ void SdrMeasureObj::RestGeoData(const SdrObjGeoData& rGeo) SetTextDirty(); } -SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const +SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier) const { // get XOR Poly as base XPolyPolygon aTmpPolyPolygon(TakeXorPoly()); @@ -1174,8 +1174,8 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const // prepare parameters basegfx::B2DPolyPolygon aPolyPoly; SdrPathObj* pPath; - UINT16 nCount(aTmpPolyPolygon.Count()); - UINT16 nLoopStart(0); + sal_uInt16 nCount(aTmpPolyPolygon.Count()); + sal_uInt16 nLoopStart(0); if(nCount == 3) { @@ -1196,8 +1196,8 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const { // four lines, middle line with gap, so there are two lines used // which have one arrow each - //INT32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); - INT32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); + //sal_Int32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); + sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); aSet.Put(XLineEndWidthItem(0L)); aPolyPoly.clear(); @@ -1227,8 +1227,8 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const else if(nCount == 5) { // five lines, first two are the outer ones - //INT32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); - INT32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); + //sal_Int32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); + sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); aSet.Put(XLineEndWidthItem(0L)); @@ -1298,8 +1298,8 @@ void SdrMeasureObj::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject) SetTextDirty(); // Text neu berechnen! } -void SdrMeasureObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText, - Rectangle* pAnchorRect, BOOL bLineWidth ) const +void SdrMeasureObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, int bNoEditText, + Rectangle* pAnchorRect, sal_Bool bLineWidth ) const { if (bTextDirty) UndirtyText(); SdrTextObj::TakeTextRect( rOutliner, rTextRect, bNoEditText, pAnchorRect, bLineWidth ); @@ -1317,7 +1317,7 @@ void SdrMeasureObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle SdrTextObj::TakeTextEditArea(pPaperMin,pPaperMax,pViewInit,pViewMin); } -USHORT SdrMeasureObj::GetOutlinerViewAnchorMode() const +sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const { if (bTextDirty) UndirtyText(); ImpMeasureRec aRec; @@ -1329,9 +1329,9 @@ USHORT SdrMeasureObj::GetOutlinerViewAnchorMode() const SdrTextVertAdjust eTV=GetTextVerticalAdjust(); SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos; SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos; - FASTBOOL bTextRota90=aRec.bTextRota90; - //FASTBOOL bTextUpsideDown=aRec.bTextUpsideDown; - FASTBOOL bBelowRefEdge=aRec.bBelowRefEdge; + int bTextRota90=aRec.bTextRota90; + //int bTextUpsideDown=aRec.bTextUpsideDown; + int bBelowRefEdge=aRec.bBelowRefEdge; // bTextUpsideDown muss hier noch ausgewertet werden!!!! if (!bTextRota90) { @@ -1369,7 +1369,7 @@ USHORT SdrMeasureObj::GetOutlinerViewAnchorMode() const else if (eTV==SDRTEXTVERTADJUST_BOTTOM) eRet=ANCHOR_BOTTOM_HCENTER; else eRet=ANCHOR_VCENTER_HCENTER; } - return (USHORT)eRet; + return (sal_uInt16)eRet; } ////////////////////////////////////////////////////////////////////////////// |