summaryrefslogtreecommitdiff
path: root/starmath/source/format.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-04-04 07:04:58 +0000
committerRüdiger Timm <rt@openoffice.org>2005-04-04 07:04:58 +0000
commit26bdb10a52f441b4026d651ec50189b88391319e (patch)
treef4c7fe0edbc1f899189dcdffd03d50b9a04f0c66 /starmath/source/format.cxx
parent22bbb7b36e147d2d2a050ff95e1183d4a28d901f (diff)
INTEGRATION: CWS tl07 (1.7.278); FILE MERGED
2005/03/15 09:39:09 tl 1.7.278.2: RESYNC: (1.7-1.8); FILE MERGED 2004/12/16 12:24:32 tl 1.7.278.1: #i39124# removed code that is used only in the binfilter now
Diffstat (limited to 'starmath/source/format.cxx')
-rw-r--r--starmath/source/format.cxx168
1 files changed, 2 insertions, 166 deletions
diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx
index b50b29c168b3..672564671b45 100644
--- a/starmath/source/format.cxx
+++ b/starmath/source/format.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: format.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: vg $ $Date: 2005-02-16 17:58:46 $
+ * last change: $Author: rt $ $Date: 2005-04-04 08:04:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -274,167 +274,3 @@ BOOL SmFormat::operator == (const SmFormat &rFormat) const
}
-SvStream & operator << (SvStream &rStream, const SmFormat &rFormat)
-{
- //Da hier keinerlei Kompatibilitaet vorgesehen ist muessen wir leider
- //heftig tricksen. Gluecklicherweise sind offenbar einige Informationen
- //ueberfluessig geworden. In diese quetschen wir jetzt vier neue
- //Einstellungen fuer die Rander.
- //Bei Gelegenheit wird hier ein Im- Und Export gebraucht. Dann muessen
- //die Stream-Operatoren dieser Klassen dringend mit Versionsverwaltung
- //versehen werden!
-
- UINT16 n;
-
- // convert the heigth (in 100th of mm) to Pt and round the result to the
- // nearest integer
- n = (UINT16) SmRoundFraction(Sm100th_mmToPts(rFormat.aBaseSize.Height()));
- DBG_ASSERT((n & 0xFF00) == 0, "Sm : higher Byte nicht leer");
-
- // to be compatible with the old format (size and order) we put the info
- // about textmode in the higher byte (height is already restricted to a
- // maximum of 127!)
- n |= (rFormat.bIsTextmode != 0) << 8
- | (rFormat.bScaleNormalBrackets != 0) << 9;
- rStream << n;
-
- rStream << rFormat.vDist[DIS_LEFTSPACE]; //Wir nutzen den Platz
- rStream << rFormat.vDist[DIS_RIGHTSPACE]; //Wir nutzen den Platz
-
- for ( n = SIZ_BEGIN; n <= SIZ_END; ++n )
- rStream << rFormat.vSize[n];
-
- rStream << rFormat.vDist[DIS_TOPSPACE]; //Wir nutzen den Platz
-
- for ( n = 0; n <= FNT_FIXED; ++n )
- rStream << rFormat.vFont[n];
-
- // Den zweiten Wert noch im HigherByte unterbringen
- USHORT uTmp = rFormat.vDist[DIS_BRACKETSIZE]
- | rFormat.vDist[DIS_NORMALBRACKETSIZE] << 8;
- // und dann dieses rausstreamen
- for ( n = 0; n <= DIS_OPERATORSPACE; ++n )
- rStream << (USHORT)(n != DIS_BRACKETSIZE ? rFormat.vDist[(USHORT) n] : uTmp);
-
- // higher byte is version number, lower byte is horizontal alignment
- n = rFormat.eHorAlign | SM_FMT_VERSION_NOW << 8;
- rStream << n;
-
- rStream << rFormat.vDist[DIS_BOTTOMSPACE]; //Wir nutzen den Platz
-
- return rStream;
-}
-
-
-SvStream & operator >> (SvStream &rStream, SmFormat &rFormat)
-{
- UINT16 n;
-
- rStream >> n;
- long nBaseHeight = n & 0x00FF;
- rFormat.bIsTextmode = ((n >> 8) & 0x01) != 0;
- rFormat.bScaleNormalBrackets = ((n >> 9) & 0x01) != 0;
- rFormat.aBaseSize = Size(0, SmPtsTo100th_mm(nBaseHeight));
-
- rStream >> rFormat.vDist[DIS_LEFTSPACE]; //Wir nutzen den Platz
- rStream >> rFormat.vDist[DIS_RIGHTSPACE]; //Wir nutzen den Platz
-
- for ( n = SIZ_BEGIN; n <= SIZ_END; ++n )
- rStream >> rFormat.vSize[n];
-
- rStream >> rFormat.vDist[DIS_TOPSPACE]; //Wir nutzen den Platz
-
- for ( n = 0; n <= FNT_FIXED; ++n )
- rStream >> rFormat.vFont[n];
-
- for ( n = 0; n <= DIS_OPERATORSPACE; ++n )
- rStream >> rFormat.vDist[n];
- // den zweiten Wert aus dem HigherByte holen
- rFormat.vDist[DIS_NORMALBRACKETSIZE] = rFormat.vDist[DIS_BRACKETSIZE] >> 8;
- // und dieses dann ausblenden
- rFormat.vDist[DIS_BRACKETSIZE] &= 0x00FF;
-
- // higher byte is version number, lower byte is horizontal alignment
- rStream >> n;
- rFormat.nVersion = n >> 8;
- rFormat.eHorAlign = (SmHorAlign) (n & 0x00FF);
-
- rStream >> rFormat.vDist[DIS_BOTTOMSPACE]; //Wir nutzen den Platz
-
- const Size aTmp( rFormat.GetBaseSize() );
- for ( USHORT i = 0; i <= FNT_FIXED; ++i )
- {
- rFormat.vFont[i].SetSize(aTmp);
- rFormat.vFont[i].SetTransparent(TRUE);
- rFormat.vFont[i].SetAlign(ALIGN_BASELINE);
- }
- rFormat.vFont[FNT_MATH].SetSize(aTmp);
-
- // Fuer Version 4.0 (und aelter) sollen auch die normalen Klammern skalierbar
- // sein und wachsen (so wie es der Fall war), in der 5.0 Version jedoch nicht.
- // In spaeteren Versionen (>= 5.1) ist das Verhalten nun durch den Anwender
- // festzulegen (bleibt also wie aus dem Stream gelesen).
- if (rFormat.nVersion < SM_FMT_VERSION_51)
- {
- BOOL bIs50Stream = rStream.GetVersion() == SOFFICE_FILEFORMAT_50;
- BOOL bVal = bIs50Stream ? FALSE : TRUE;
- USHORT nExcHeight = bIs50Stream ? 0 : rFormat.vDist[DIS_BRACKETSIZE];
-
- rFormat.SetScaleNormalBrackets(bVal);
- rFormat.SetDistance(DIS_NORMALBRACKETSIZE, nExcHeight);
- }
-
- return rStream;
-}
-
-void SmFormat::ReadSM20Format(SvStream &rStream)
-{
- UINT16 n;
- USHORT i;
-
- rStream >> n;
- SetBaseSize( Size(0, SmPtsTo100th_mm(n)) );
-
- rStream >> n >> n;
-
- for (i = SIZ_BEGIN; i <= SIZ_LIMITS; i++)
- { rStream >> n;
- SetRelSize(i, n);
- }
-
- rStream >> n;
-
- for (i = FNT_BEGIN; i <= FNT_FIXED; i++)
- ReadSM20Font(rStream, vFont[i]);
-
- for (i = DIS_BEGIN; i <= DIS_OPERATORSPACE; i++)
- { rStream >> n;
- SetDistance(i, n);
- }
-
- rStream >> n;
- SetHorAlign((SmHorAlign) n);
- rStream >> n;
-
- const Size aTmp (GetBaseSize());
- for (i = FNT_BEGIN; i <= FNT_FIXED; i++)
- {
- SmFace &rFace = vFont[i];
- rFace.SetSize(aTmp);
- rFace.SetTransparent(TRUE);
- rFace.SetAlign(ALIGN_BASELINE);
- }
- vFont[FNT_MATH].SetSize(aTmp);
-}
-
-
-void SmFormat::From300To304a()
-{
- long nBaseSize = SmRoundFraction(Sm100th_mmToPts(aBaseSize.Height()))
- * 2540l / 72l;
- for (USHORT i = DIS_BEGIN; i < DIS_OPERATORSPACE; i++)
- SetDistance(i, USHORT(GetDistance(i) * 254000L / 72L / nBaseSize));
-}
-
-
-