summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2001-03-02 10:47:47 +0000
committerArmin Weiss <aw@openoffice.org>2001-03-02 10:47:47 +0000
commitf5d89bf69331843da25b016718a40786377fce95 (patch)
tree98b9408cff6c40732529b3ef6815b4156975691a /svx/source
parenta500d3ccb6f4b13c156cf3051cf21c07a1e6ceef (diff)
#84529# correct gradient rotation for 5.2 and earlier
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdotext.cxx38
1 files changed, 34 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 2c098c5624f4..33bd9364edeb 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svdotext.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: aw $ $Date: 2001-03-01 15:23:33 $
+ * last change: $Author: aw $ $Date: 2001-03-02 11:47:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -116,6 +116,10 @@
#include <vcl/salbtype.hxx> // FRound
#endif
+#ifndef _SVX_XFLGRIT_HXX
+#include "xflgrit.hxx"
+#endif
+
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
@@ -859,7 +863,7 @@ OutlinerParaObject* SdrTextObj::ImpGetEditOutlinerParaObject() const
nParaAnz = 0;
}
if (p1stPara!=NULL && nParaAnz!=0) {
- pPara=pEdtOutl->CreateParaObject(0, nParaAnz);
+ pPara = pEdtOutl->CreateParaObject(0, (sal_uInt16)nParaAnz);
}
}
return pPara;
@@ -1463,7 +1467,7 @@ SdrObject* SdrTextObj::CheckHit(const Point& rPnt, USHORT nTol, const SetOfByte*
if( pRef )
nHitTol = pRef->LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() );
- bRet = pOutliner->IsTextPos( aPt, nHitTol );
+ bRet = pOutliner->IsTextPos( aPt, (sal_uInt16)nHitTol );
}
}
@@ -1896,6 +1900,32 @@ void SdrTextObj::ReadData(const SdrObjIOHeader& rHead, SvStream& rIn)
pOutlinerParaObject->MergeParaAttribs( GetItemSet() );
}
+ // #84529# correct gradient rotation for 5.2 and earlier
+ if(aGeo.nDrehWink != 0 && rHead.GetVersion() <= 16)
+ {
+ XFillStyle eStyle = ((const XFillStyleItem&)GetItem(XATTR_FILLSTYLE)).GetValue();
+ if(XFILL_GRADIENT == eStyle)
+ {
+ XFillGradientItem aItem = (XFillGradientItem&)GetItem(XATTR_FILLGRADIENT);
+ XGradient aGradient = aItem.GetValue();
+
+ // calc new angle. aGeo.nDrehWink is 1/100th degree, aGradient.GetAngle()
+ // is 1/10th degree. Match this.
+ sal_Int32 nNewAngle = ((aGeo.nDrehWink + (aGradient.GetAngle() * 10)) + 5) / 10;
+
+ while(nNewAngle < 0)
+ nNewAngle += 3600;
+
+ while(nNewAngle >= 3600)
+ nNewAngle -= 3600;
+
+ // create new item and set
+ aGradient.SetAngle(nNewAngle);
+ aItem.SetValue(aGradient);
+ SetItem(aItem);
+ }
+ }
+
ImpSetTextStyleSheetListeners();
SetTextSizeDirty();
ImpCheckMasterCachable();