Kaydet (Commit) 75ab9e5c authored tarafından Caolán McNamara's avatar Caolán McNamara

move pBuffer out of class

Change-Id: I88120530b21ebe72796ddee39c2446a70c3fd193
üst 155d8942
...@@ -303,7 +303,6 @@ SvStream& ReadTextType(SvStream& rInp, TextType& rText) ...@@ -303,7 +303,6 @@ SvStream& ReadTextType(SvStream& rInp, TextType& rText)
rInp.ReadInt16(rText.FitBreit); rInp.ReadInt16(rText.FitBreit);
assert(rInp.GetError() || rInp.Tell() == nOldPos + TextSize); assert(rInp.GetError() || rInp.Tell() == nOldPos + TextSize);
(void) nOldPos; (void) nOldPos;
rText.Buffer=nullptr;
return rInp; return rInp;
} }
SvStream& ReadBmapType(SvStream& rInp, BmapType& rBmap) SvStream& ReadBmapType(SvStream& rInp, BmapType& rBmap)
...@@ -405,11 +404,11 @@ void SetArea(ObjAreaType& rArea, OutputDevice& rOut) ...@@ -405,11 +404,11 @@ void SetArea(ObjAreaType& rArea, OutputDevice& rOut)
rOut.SetFillColor( Sgv2SvFarbe( rArea.FFarbe,rArea.FBFarbe,rArea.FIntens ) ); rOut.SetFillColor( Sgv2SvFarbe( rArea.FFarbe,rArea.FBFarbe,rArea.FIntens ) );
} }
void ObjkType::Draw(OutputDevice&) void ObjkType::Draw(OutputDevice&, UCHAR *)
{ {
} }
void StrkType::Draw(OutputDevice& rOut) void StrkType::Draw(OutputDevice& rOut, UCHAR *)
{ {
SetLine(L,rOut); SetLine(L,rOut);
rOut.DrawLine(Point(Pos1.x,Pos1.y),Point(Pos2.x,Pos2.y)); // !!! rOut.DrawLine(Point(Pos1.x,Pos1.y),Point(Pos2.x,Pos2.y)); // !!!
...@@ -508,7 +507,7 @@ void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAr ...@@ -508,7 +507,7 @@ void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAr
} }
} }
void RectType::Draw(OutputDevice& rOut) void RectType::Draw(OutputDevice& rOut, UCHAR *)
{ {
if (L.LMuster!=0) L.LMuster=1; // no line separator here, only on or off if (L.LMuster!=0) L.LMuster=1; // no line separator here, only on or off
SetArea(F,rOut); SetArea(F,rOut);
...@@ -543,7 +542,7 @@ void RectType::Draw(OutputDevice& rOut) ...@@ -543,7 +542,7 @@ void RectType::Draw(OutputDevice& rOut)
} }
} }
void PolyType::Draw(OutputDevice& rOut) void PolyType::Draw(OutputDevice& rOut, UCHAR *)
{ {
if ((Flags & PolyClosBit) !=0) SetArea(F,rOut); if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
SetLine(L,rOut); SetLine(L,rOut);
...@@ -557,7 +556,7 @@ void PolyType::Draw(OutputDevice& rOut) ...@@ -557,7 +556,7 @@ void PolyType::Draw(OutputDevice& rOut)
} }
} }
void SplnType::Draw(OutputDevice& rOut) void SplnType::Draw(OutputDevice& rOut, UCHAR *)
{ {
if ((Flags & PolyClosBit) !=0) SetArea(F,rOut); if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
SetLine(L,rOut); SetLine(L,rOut);
...@@ -660,7 +659,7 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr ...@@ -660,7 +659,7 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr
} }
} }
void CircType::Draw(OutputDevice& rOut) void CircType::Draw(OutputDevice& rOut, UCHAR *)
{ {
tools::Rectangle aRect(Center.x-Radius.x,Center.y-Radius.y,Center.x+Radius.x,Center.y+Radius.y); tools::Rectangle aRect(Center.x-Radius.x,Center.y-Radius.y,Center.x+Radius.x,Center.y+Radius.y);
...@@ -711,7 +710,7 @@ void CircType::Draw(OutputDevice& rOut) ...@@ -711,7 +710,7 @@ void CircType::Draw(OutputDevice& rOut)
} }
} }
void BmapType::Draw(OutputDevice& rOut) void BmapType::Draw(OutputDevice& rOut, UCHAR *)
{ {
//ifstream aInp; //ifstream aInp;
sal_uInt16 nVersion; sal_uInt16 nVersion;
...@@ -769,24 +768,24 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) ...@@ -769,24 +768,24 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
ReadObjkType( rInp, aObjk ); ReadObjkType( rInp, aObjk );
if (!rInp.GetError()) { if (!rInp.GetError()) {
switch(aObjk.Art) { switch(aObjk.Art) {
case ObjStrk: { StrkType aStrk; ReadStrkType( rInp, aStrk ); if (!rInp.GetError()) aStrk.Draw(rOut); } break; case ObjStrk: { StrkType aStrk; ReadStrkType( rInp, aStrk ); if (!rInp.GetError()) aStrk.Draw(rOut, nullptr); } break;
case ObjRect: { RectType aRect; ReadRectType( rInp, aRect ); if (!rInp.GetError()) aRect.Draw(rOut); } break; case ObjRect: { RectType aRect; ReadRectType( rInp, aRect ); if (!rInp.GetError()) aRect.Draw(rOut, nullptr); } break;
case ObjCirc: { CircType aCirc; ReadCircType( rInp, aCirc ); if (!rInp.GetError()) aCirc.Draw(rOut); } break; case ObjCirc: { CircType aCirc; ReadCircType( rInp, aCirc ); if (!rInp.GetError()) aCirc.Draw(rOut, nullptr); } break;
case ObjText: { case ObjText: {
TextType aText; TextType aText;
ReadTextType( rInp, aText ); ReadTextType( rInp, aText );
if (!rInp.GetError()) { if (!rInp.GetError()) {
aText.Buffer=new UCHAR[aText.BufSize+1]; // add one for LookAhead at CK-separation UCHAR *pBuffer = new UCHAR[aText.BufSize+1]; // add one for LookAhead at CK-separation
rInp.ReadBytes(aText.Buffer, aText.BufSize); rInp.ReadBytes(pBuffer, aText.BufSize);
if (!rInp.GetError()) aText.Draw(rOut); if (!rInp.GetError()) aText.Draw(rOut, pBuffer);
delete[] aText.Buffer; delete[] pBuffer;
} }
} break; } break;
case ObjBmap: { case ObjBmap: {
BmapType aBmap; BmapType aBmap;
ReadBmapType( rInp, aBmap ); ReadBmapType( rInp, aBmap );
if (!rInp.GetError()) { if (!rInp.GetError()) {
aBmap.Draw(rOut); aBmap.Draw(rOut, nullptr);
} }
} break; } break;
case ObjPoly: { case ObjPoly: {
...@@ -799,7 +798,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) ...@@ -799,7 +798,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
rInp.ReadInt16(aPoly.EckP[i].x); rInp.ReadInt16(aPoly.EckP[i].x);
rInp.ReadInt16(aPoly.EckP[i].y); rInp.ReadInt16(aPoly.EckP[i].y);
} }
if (!rInp.GetError()) aPoly.Draw(rOut); if (!rInp.GetError()) aPoly.Draw(rOut, nullptr);
delete[] aPoly.EckP; delete[] aPoly.EckP;
} }
} break; } break;
...@@ -813,7 +812,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) ...@@ -813,7 +812,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
rInp.ReadInt16(aSpln.EckP[i].x); rInp.ReadInt16(aSpln.EckP[i].x);
rInp.ReadInt16(aSpln.EckP[i].y); rInp.ReadInt16(aSpln.EckP[i].y);
} }
if (!rInp.GetError()) aSpln.Draw(rOut); if (!rInp.GetError()) aSpln.Draw(rOut, nullptr);
delete[] aSpln.EckP; delete[] aSpln.EckP;
} }
} break; } break;
...@@ -826,7 +825,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut ) ...@@ -826,7 +825,7 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
} }
} break; } break;
default: { default: {
aObjk.Draw(rOut); // object name on 2. Screen aObjk.Draw(rOut, nullptr); // object name on 2. Screen
ObjkOverSeek(rInp,aObjk); // to next object ObjkOverSeek(rInp,aObjk); // to next object
} }
} }
......
...@@ -155,7 +155,7 @@ public: ...@@ -155,7 +155,7 @@ public:
{ {
} }
virtual ~ObjkType() {} virtual ~ObjkType() {}
virtual void Draw(OutputDevice& rOut); virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer);
}; };
#define StrkSize 38 #define StrkSize 38
...@@ -167,7 +167,7 @@ public: ...@@ -167,7 +167,7 @@ public:
PointType Pos1; // start point PointType Pos1; // start point
PointType Pos2; // end point PointType Pos2; // end point
friend SvStream& ReadStrkType(SvStream& rIStream, StrkType& rStrk); friend SvStream& ReadStrkType(SvStream& rIStream, StrkType& rStrk);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define RectSize 52 #define RectSize 52
...@@ -183,7 +183,7 @@ public: ...@@ -183,7 +183,7 @@ public:
sal_uInt16 RotationAngle; // 315...<45 sal_uInt16 RotationAngle; // 315...<45
sal_uInt16 Slant; // >270...<90 sal_uInt16 Slant; // >270...<90
friend SvStream& ReadRectType(SvStream& rIStream, RectType& rRect); friend SvStream& ReadRectType(SvStream& rIStream, RectType& rRect);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define PolySize 44 #define PolySize 44
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
sal_uInt32 SD_EckP; // pointer to corner point (StarDraw) sal_uInt32 SD_EckP; // pointer to corner point (StarDraw)
PointType* EckP; // pointer to corner points (StarView (is not read from disk!)) PointType* EckP; // pointer to corner points (StarView (is not read from disk!))
friend SvStream& ReadPolyType(SvStream& rIStream, PolyType& rPoly); friend SvStream& ReadPolyType(SvStream& rIStream, PolyType& rPoly);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define PolyClosBit 0x01 // kinds of Poly: 0: polyLine 1: polygon #define PolyClosBit 0x01 // kinds of Poly: 0: polyLine 1: polygon
...@@ -214,7 +214,7 @@ public: ...@@ -214,7 +214,7 @@ public:
sal_uInt32 SD_EckP; // pointer to corner points (StarDraw) sal_uInt32 SD_EckP; // pointer to corner points (StarDraw)
PointType* EckP; // pointer to corner points (StarView (is not read from disk!)) PointType* EckP; // pointer to corner points (StarView (is not read from disk!))
friend SvStream& ReadSplnType(SvStream& rIStream, SplnType& rSpln); friend SvStream& ReadSplnType(SvStream& rIStream, SplnType& rSpln);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
// kinds of Spline: see Poly // kinds of Spline: see Poly
...@@ -231,7 +231,7 @@ public: ...@@ -231,7 +231,7 @@ public:
sal_uInt16 StartAngle; // and not for full circles sal_uInt16 StartAngle; // and not for full circles
sal_uInt16 RelAngle; // and full ellipses sal_uInt16 RelAngle; // and full ellipses
friend SvStream& ReadCircType(SvStream& rIStream, CircType& rCirc); friend SvStream& ReadCircType(SvStream& rIStream, CircType& rCirc);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define CircFull 0x00 /* kinds of circle: 0: full circle */ #define CircFull 0x00 /* kinds of circle: 0: full circle */
#define CircSect 0x01 /* 1: circle sector */ #define CircSect 0x01 /* 1: circle sector */
...@@ -254,9 +254,8 @@ public: ...@@ -254,9 +254,8 @@ public:
sal_uInt16 ExtLo,ExtHi; // (Ptr) text over more frames << ShortArr, otherwise DWord-Align needed sal_uInt16 ExtLo,ExtHi; // (Ptr) text over more frames << ShortArr, otherwise DWord-Align needed
PointType FitSize; // size of origin for Fit2Size PointType FitSize; // size of origin for Fit2Size
sal_Int16 FitBreit; // width to format for Fit2Size sal_Int16 FitBreit; // width to format for Fit2Size
UCHAR* Buffer; // this variable is not set by reading from disk, but explicit!
friend SvStream& ReadTextType(SvStream& rIStream, TextType& rText); friend SvStream& ReadTextType(SvStream& rIStream, TextType& rText);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define TextOutlBit 0x01 /* 1=Sourcecode for outliner (ignored byDrawObject()) */ #define TextOutlBit 0x01 /* 1=Sourcecode for outliner (ignored byDrawObject()) */
#define TextFitSBit 0x02 /* Bit1: 1=Text-Fit2Size, also outliner (2.0) */ #define TextFitSBit 0x02 /* Bit1: 1=Text-Fit2Size, also outliner (2.0) */
...@@ -301,7 +300,7 @@ public: ...@@ -301,7 +300,7 @@ public:
} }
friend SvStream& ReadBmapType(SvStream& rIStream, BmapType& rBmap); friend SvStream& ReadBmapType(SvStream& rIStream, BmapType& rBmap);
virtual void Draw(OutputDevice& rOut) override; virtual void Draw(OutputDevice& rOut, UCHAR *pBuffer) override;
}; };
#define GrupSize 48 #define GrupSize 48
......
...@@ -862,7 +862,7 @@ void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uIn ...@@ -862,7 +862,7 @@ void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uIn
rOut.DrawText( Point( Pos.x, Pos.y ), s ); rOut.DrawText( Point( Pos.x, Pos.y ), s );
} }
void TextType::Draw(OutputDevice& rOut) void TextType::Draw(OutputDevice& rOut, UCHAR* pBuffer)
{ {
if ((Flags & TextOutlBit)!=0) return; // source text for Outliner !! if ((Flags & TextOutlBit)!=0) return; // source text for Outliner !!
...@@ -892,7 +892,7 @@ void TextType::Draw(OutputDevice& rOut) ...@@ -892,7 +892,7 @@ void TextType::Draw(OutputDevice& rOut)
sal_uInt16 FitYMul; sal_uInt16 FitYMul;
sal_uInt16 FitYDiv; sal_uInt16 FitYDiv;
bool Error; bool Error;
UCHAR* Buf=Buffer; // pointer to the letters UCHAR* Buf = pBuffer; // pointer to the letters
pSgfFonts->ReadList(); pSgfFonts->ReadList();
xLine.reset(new short[ChrXPosArrSize]); xLine.reset(new short[ChrXPosArrSize]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment