Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Thorsten,

On 12/16/2011 11:52 AM, Thorsten Behrens wrote:
Matteo Casalin wrote:
 From my understanding, if we remove these 2 calls that set te
COMPRESSMODE_FULL flag then there is no reason to keep the code that
depend on that, unless the svstream acquires the flag from the stream
itself or that it's set by calling the set function with a "magic
number" instead of the #define.

Quite. Now really looking into what vcl/source/gdi/gdimtf.cxx does,
the nStmCompressMode is *read* from the input, but then happily
ignored - so the code, as it is, will already balk on thusly written
files. The only other use I see is internal, i.e. within the same
running LibO instance - so yeah, go&  kill this off! :)

Here are the patches for *completely* removing COMPRESSMODE_FULL support. I had to split them since I initially didn't clone binfilter, just did it for this patch and I'm not so skilled with git. Obviously a single patch would keep the whole LibO repo more consistent, feel free to hack these patches to your own taste. A late thought was that I could have at least made the two commit logs different, I don't know if this can be done by hand. The smallest one is on binfilter, in any case.
Last notes:
* Modifications to core where "make"d and the process completes
  successfully;
* I also tried "make check" on core (for the first time), but it stops
  on "ulimit". I really don't know if this due to these patches or was
  already there;
* Modifications to binfilter where not tested at all, not even compiled.

Cheers
Matteo

PS: I already sent (some time ago) a license statement for (future) contributions.

Cheers,

-- Thorsten



_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

From e0fcce1d48a79a6fa3a58e8dd2fd5838c2474b00 Mon Sep 17 00:00:00 2001
From: Matteo Casalin <matteo.casalin@poste.it>
Date: Sat, 17 Dec 2011 11:14:28 +0100
Subject: [PATCH] Removed COMPRESSMODE_FULL support from SvStream

---
 .../source/filter.vcl/filter/svt_filter.cxx        |    1 -
 binfilter/bf_svx/source/xoutdev/svx__xpoly.cxx     |   92 --------------------
 2 files changed, 0 insertions(+), 93 deletions(-)

diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx 
b/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
index de5f206..a7dfa74 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
@@ -1894,7 +1894,6 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& 
rPat
 
                                 SvMemoryStream aMemStm( 65535, 65535 );
 
-                                aMemStm.SetCompressMode( COMPRESSMODE_FULL );
                                 ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
 
                                 xActiveDataSource->setOutputStream( 
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
diff --git a/binfilter/bf_svx/source/xoutdev/svx__xpoly.cxx 
b/binfilter/bf_svx/source/xoutdev/svx__xpoly.cxx
index d7124a2..081ea9f 100644
--- a/binfilter/bf_svx/source/xoutdev/svx__xpoly.cxx
+++ b/binfilter/bf_svx/source/xoutdev/svx__xpoly.cxx
@@ -969,39 +969,6 @@ namespace binfilter {
 /*N*/   else
 /*N*/       rXPoly.pImpXPolygon->Resize( nMerkPoints );
 /*N*/
-/*N*/   // Je nach CompressMode das Polygon einlesen
-/*N*/   if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-/*N*/   {
-/*?*/       i = 0;
-/*?*/       while ( i < nReadPoints )
-/*?*/       {
-/*?*/           rIStream >> bShort >> nCurPoints;
-/*?*/
-/*?*/           if ( bShort )
-/*?*/           {
-/*?*/               for ( nStart = i; i < nStart+nCurPoints; i++ )
-/*?*/               {
-/*?*/                   rIStream >> nShortX >> nShortY;
-/*?*/                   if (i<nMerkPoints) { // restliche Punkte ueberspringen
-/*?*/                       rXPoly.pImpXPolygon->pPointAry[i].X() = nShortX;
-/*?*/                       rXPoly.pImpXPolygon->pPointAry[i].Y() = nShortY;
-/*?*/                   }
-/*?*/               }
-/*?*/           }
-/*?*/           else
-/*?*/           {
-/*?*/               for ( nStart = i; i < nStart+nCurPoints; i++ )
-/*?*/               {
-/*?*/                   rIStream >> nLongX >> nLongY;
-/*?*/                   if (i<nMerkPoints) { // restliche Punkte ueberspringen
-/*?*/                       rXPoly.pImpXPolygon->pPointAry[i].X() = nLongX;
-/*?*/                       rXPoly.pImpXPolygon->pPointAry[i].Y() = nLongY;
-/*?*/                   }
-/*?*/               }
-/*?*/           }
-/*?*/       }
-/*N*/   }
-/*N*/   else
 /*N*/   {
         // Feststellen, ob ueber die Operatoren gelesen werden muss
 #if (__SIZEOFLONG) != 4
@@ -1065,65 +1032,6 @@ namespace binfilter {
 /*N*/   // Anzahl der Punkte rausschreiben
 /*N*/   rOStream << nPoints;
 /*N*/
-/*N*/   // Je nach CompressMode das Polygon rausschreiben
-/*N*/   if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-/*N*/   {
-/*?*/       i = 0;
-/*?*/       while ( i < nPoints )
-/*?*/       {
-/*?*/           nStart = i;
-/*?*/
-/*?*/           // Feststellen, welcher Typ geschrieben werden soll
-/*?*/           if ( ((rXPoly.pImpXPolygon->pPointAry[nStart].X() >= SHRT_MIN) &&
-/*?*/                 (rXPoly.pImpXPolygon->pPointAry[nStart].X() <= SHRT_MAX)) &&
-/*?*/                ((rXPoly.pImpXPolygon->pPointAry[nStart].Y() >= SHRT_MIN) &&
-/*?*/                 (rXPoly.pImpXPolygon->pPointAry[nStart].Y() <= SHRT_MAX)) )
-/*?*/               bShort = TRUE;
-/*?*/           else
-/*?*/               bShort = FALSE;
-/*?*/           while ( i < nPoints )
-/*?*/           {
-/*?*/               // Feststellen, welcher Typ geschrieben werden soll
-/*?*/               if ( ((rXPoly.pImpXPolygon->pPointAry[nStart].X() >= SHRT_MIN) &&
-/*?*/                     (rXPoly.pImpXPolygon->pPointAry[nStart].X() <= SHRT_MAX)) &&
-/*?*/                    ((rXPoly.pImpXPolygon->pPointAry[nStart].Y() >= SHRT_MIN) &&
-/*?*/                     (rXPoly.pImpXPolygon->pPointAry[nStart].Y() <= SHRT_MAX)) )
-/*?*/                   bCurShort = TRUE;
-/*?*/               else
-/*?*/                   bCurShort = FALSE;
-/*?*/
-/*?*/               // Wenn sich die Werte in einen anderen Bereich begeben,
-/*?*/               // muessen wir neu rausschreiben
-/*?*/               if ( bCurShort != bShort )
-/*?*/               {
-/*?*/                   bShort = bCurShort;
-/*?*/                   break;
-/*?*/               }
-/*?*/
-/*?*/               i++;
-/*?*/           }
-/*?*/
-/*?*/           rOStream << bShort << (USHORT)(i-nStart);
-/*?*/
-/*?*/           if ( bShort )
-/*?*/           {
-/*?*/               for( ; nStart < i; nStart++ )
-/*?*/               {
-/*?*/                   rOStream << (short)rXPoly.pImpXPolygon->pPointAry[nStart].X()
-/*?*/                            << (short)rXPoly.pImpXPolygon->pPointAry[nStart].Y();
-/*?*/               }
-/*?*/           }
-/*?*/           else
-/*?*/           {
-/*?*/               for( ; nStart < i; nStart++ )
-/*?*/               {
-/*?*/                   rOStream << rXPoly.pImpXPolygon->pPointAry[nStart].X()
-/*?*/                            << rXPoly.pImpXPolygon->pPointAry[nStart].Y();
-/*?*/               }
-/*?*/           }
-/*?*/       }
-/*N*/   }
-/*N*/   else
 /*N*/   {
         // Feststellen, ob ueber die Operatoren geschrieben werden muss
 #if (__SIZEOFLONG) != 4
-- 
1.7.5.4

From 31ae7c658ef3d0262079587aee6b7bd40bffab53 Mon Sep 17 00:00:00 2001
From: Matteo Casalin <matteo.casalin@poste.it>
Date: Sat, 17 Dec 2011 11:18:58 +0100
Subject: [PATCH] Removed COMPRESSMODE_FULL support from SvStream

---
 svtools/source/filter/filter.cxx |    1 -
 tools/inc/tools/stream.hxx       |    1 -
 tools/source/generic/color.cxx   |  146 +-------------
 tools/source/generic/gen.cxx     |  396 +-------------------------------------
 tools/source/generic/poly.cxx    |   98 ----------
 5 files changed, 15 insertions(+), 627 deletions(-)

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index ef07514..cba4fed 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -2034,7 +2034,6 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const 
String&
 
                                     SvMemoryStream aMemStm( 65535, 65535 );
 
-                                    aMemStm.SetCompressMode( COMPRESSMODE_FULL );
                                     ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
 
                                     xActiveDataSource->setOutputStream( 
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 0ad9585..e211ea2 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -90,7 +90,6 @@ typedef sal_uInt16 StreamMode;
 #define NUMBERFORMAT_INT_BIGENDIAN      (sal_uInt16)0x0000
 #define NUMBERFORMAT_INT_LITTLEENDIAN   (sal_uInt16)0xFFFF
 
-#define COMPRESSMODE_FULL           (sal_uInt16)0xFFFF
 #define COMPRESSMODE_NONE           (sal_uInt16)0x0000
 #define COMPRESSMODE_ZBITMAP            (sal_uInt16)0x0001
 #define COMPRESSMODE_NATIVE             (sal_uInt16)0x0010
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 6ee5b0d..f06d3d1 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -296,88 +296,18 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor )
     DBG_ASSERTWARNING( rIStream.GetVersion(), "Color::>> - Solar-Version not set on rIStream" );
 
     sal_uInt16      nColorName;
-    sal_uInt16      nRed;
-    sal_uInt16      nGreen;
-    sal_uInt16      nBlue;
 
     rIStream >> nColorName;
 
     if ( nColorName & COL_NAME_USER )
     {
-        if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-        {
-            unsigned char   cAry[6];
-            sal_uInt16          i = 0;
-
-            nRed    = 0;
-            nGreen  = 0;
-            nBlue   = 0;
-
-            if ( nColorName & COL_RED_2B )
-                i += 2;
-            else if ( nColorName & COL_RED_1B )
-                i++;
-            if ( nColorName & COL_GREEN_2B )
-                i += 2;
-            else if ( nColorName & COL_GREEN_1B )
-                i++;
-            if ( nColorName & COL_BLUE_2B )
-                i += 2;
-            else if ( nColorName & COL_BLUE_1B )
-                i++;
-
-            rIStream.Read( cAry, i );
-            i = 0;
-
-            if ( nColorName & COL_RED_2B )
-            {
-                nRed = cAry[i];
-                nRed <<= 8;
-                i++;
-                nRed |= cAry[i];
-                i++;
-            }
-            else if ( nColorName & COL_RED_1B )
-            {
-                nRed = cAry[i];
-                nRed <<= 8;
-                i++;
-            }
-            if ( nColorName & COL_GREEN_2B )
-            {
-                nGreen = cAry[i];
-                nGreen <<= 8;
-                i++;
-                nGreen |= cAry[i];
-                i++;
-            }
-            else if ( nColorName & COL_GREEN_1B )
-            {
-                nGreen = cAry[i];
-                nGreen <<= 8;
-                i++;
-            }
-            if ( nColorName & COL_BLUE_2B )
-            {
-                nBlue = cAry[i];
-                nBlue <<= 8;
-                i++;
-                nBlue |= cAry[i];
-                i++;
-            }
-            else if ( nColorName & COL_BLUE_1B )
-            {
-                nBlue = cAry[i];
-                nBlue <<= 8;
-                i++;
-            }
-        }
-        else
-        {
-            rIStream >> nRed;
-            rIStream >> nGreen;
-            rIStream >> nBlue;
-        }
+        sal_uInt16 nRed;
+        sal_uInt16 nGreen;
+        sal_uInt16 nBlue;
+
+        rIStream >> nRed;
+        rIStream >> nGreen;
+        rIStream >> nBlue;
 
         rColor.mnColor = RGB_COLORDATA( nRed>>8, nGreen>>8, nBlue>>8 );
     }
@@ -441,64 +371,10 @@ SvStream& operator<<( SvStream& rOStream, const Color& rColor )
     nGreen  = (nGreen<<8) + nGreen;
     nBlue   = (nBlue<<8) + nBlue;
 
-    if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        unsigned char   cAry[6];
-        sal_uInt16          i = 0;
-
-        if ( nRed & 0x00FF )
-        {
-            nColorName |= COL_RED_2B;
-            cAry[i] = (unsigned char)(nRed & 0xFF);
-            i++;
-            cAry[i] = (unsigned char)((nRed >> 8) & 0xFF);
-            i++;
-        }
-        else if ( nRed & 0xFF00 )
-        {
-            nColorName |= COL_RED_1B;
-            cAry[i] = (unsigned char)((nRed >> 8) & 0xFF);
-            i++;
-        }
-        if ( nGreen & 0x00FF )
-        {
-            nColorName |= COL_GREEN_2B;
-            cAry[i] = (unsigned char)(nGreen & 0xFF);
-            i++;
-            cAry[i] = (unsigned char)((nGreen >> 8) & 0xFF);
-            i++;
-        }
-        else if ( nGreen & 0xFF00 )
-        {
-            nColorName |= COL_GREEN_1B;
-            cAry[i] = (unsigned char)((nGreen >> 8) & 0xFF);
-            i++;
-        }
-        if ( nBlue & 0x00FF )
-        {
-            nColorName |= COL_BLUE_2B;
-            cAry[i] = (unsigned char)(nBlue & 0xFF);
-            i++;
-            cAry[i] = (unsigned char)((nBlue >> 8) & 0xFF);
-            i++;
-        }
-        else if ( nBlue & 0xFF00 )
-        {
-            nColorName |= COL_BLUE_1B;
-            cAry[i] = (unsigned char)((nBlue >> 8) & 0xFF);
-            i++;
-        }
-
-        rOStream << nColorName;
-        rOStream.Write( cAry, i );
-    }
-    else
-    {
-        rOStream << nColorName;
-        rOStream << nRed;
-        rOStream << nGreen;
-        rOStream << nBlue;
-    }
+    rOStream << nColorName;
+    rOStream << nRed;
+    rOStream << nGreen;
+    rOStream << nBlue;
 
     return rOStream;
 }
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 563014a..be16230 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -36,48 +36,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
 {
     DBG_ASSERTWARNING( rIStream.GetVersion(), "Pair::>> - Solar-Version not set on rIStream" );
 
-    if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        unsigned char   cId;
-        unsigned char   cAry[8];
-        int             i;
-        int             i1;
-        int             i2;
-        sal_uInt32          nNum;
-
-        rIStream >> cId;
-        i1 = (cId & 0x70) >> 4;
-        i2 = cId & 0x07;
-        rIStream.Read( cAry, i1+i2 );
-
-        nNum = 0;
-        i = i1;
-        while ( i )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        if ( cId & 0x80 )
-            nNum ^= 0xFFFFFFFF;
-        rPair.nA = (sal_Int32)nNum;
-
-        nNum = 0;
-        i = i1+i2;
-        while ( i > i1 )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        if ( cId & 0x08 )
-            nNum ^= 0xFFFFFFFF;
-        rPair.nB = (sal_Int32)nNum;
-    }
-    else
-    {
-        rIStream >> rPair.nA >> rPair.nB;
-    }
+    rIStream >> rPair.nA >> rPair.nB;
 
     return rIStream;
 }
@@ -88,102 +47,7 @@ SvStream& operator<<( SvStream& rOStream, const Pair& rPair )
 {
     DBG_ASSERTWARNING( rOStream.GetVersion(), "Pair::<< - Solar-Version not set on rOStream" );
 
-    if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        unsigned char   cAry[9];
-        int             i = 1;
-        sal_uInt32          nNum;
-
-        cAry[0] = 0;
-
-        nNum = (sal_uInt32)(sal_Int32)rPair.nA;
-        if ( rPair.nA < 0 )
-        {
-            cAry[0] |= 0x80;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[0] |= 0x40;
-                    }
-                    else
-                        cAry[0] |= 0x30;
-                }
-                else
-                    cAry[0] |= 0x20;
-            }
-            else
-                cAry[0] |= 0x10;
-        }
-
-        nNum = (sal_uInt32)(sal_Int32)rPair.nB;
-        if ( rPair.nB < 0 )
-        {
-            cAry[0] |= 0x08;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[0] |= 0x04;
-                    }
-                    else
-                        cAry[0] |= 0x03;
-                }
-                else
-                    cAry[0] |= 0x02;
-            }
-            else
-                cAry[0] |= 0x01;
-        }
-
-        rOStream.Write( cAry, i );
-    }
-    else
-    {
-        rOStream << rPair.nA << rPair.nB;
-    }
+    rOStream << rPair.nA << rPair.nB;
 
     return rOStream;
 }
@@ -363,81 +227,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
 {
     DBG_ASSERTWARNING( rIStream.GetVersion(), "Rectangle::>> - Solar-Version not set on rIStream" 
);
 
-    if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        unsigned char   cIdAry[2];
-        unsigned char   cAry[16];
-        int             i;
-        int             iLast;
-        int             i1;
-        int             i2;
-        int             i3;
-        int             i4;
-        sal_uInt32          nNum;
-
-        rIStream.Read( cIdAry, 2 );
-        i1 = (cIdAry[0] & 0x70) >> 4;
-        i2 = cIdAry[0] & 0x07;
-        i3 = (cIdAry[1] & 0x70) >> 4;
-        i4 = cIdAry[1] & 0x07;
-        rIStream.Read( cAry, i1+i2+i3+i4 );
-
-        nNum = 0;
-        i = i1;
-        iLast = i;
-        while ( i )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        iLast = i1;
-        if ( cIdAry[0] & 0x80 )
-            nNum ^= 0xFFFFFFFF;
-        rRect.nLeft = (sal_Int32)nNum;
-
-        nNum = 0;
-        i = iLast+i2;
-        while ( i > iLast )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        iLast += i2;
-        if ( cIdAry[0] & 0x08 )
-            nNum ^= 0xFFFFFFFF;
-        rRect.nTop = (sal_Int32)nNum;
-
-        nNum = 0;
-        i = iLast+i3;
-        while ( i > iLast )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        iLast += i3;
-        if ( cIdAry[1] & 0x80 )
-            nNum ^= 0xFFFFFFFF;
-        rRect.nRight = (sal_Int32)nNum;
-
-        nNum = 0;
-        i = iLast+i4;
-        while ( i > iLast )
-        {
-            i--;
-            nNum <<= 8;
-            nNum |= cAry[i];
-        }
-        if ( cIdAry[1] & 0x08 )
-            nNum ^= 0xFFFFFFFF;
-        rRect.nBottom = (sal_Int32)nNum;
-    }
-    else
-    {
-        rIStream >> rRect.nLeft >> rRect.nTop >> rRect.nRight >> rRect.nBottom;
-    }
+    rIStream >> rRect.nLeft >> rRect.nTop >> rRect.nRight >> rRect.nBottom;
 
     return rIStream;
 }
@@ -448,185 +238,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
 {
     DBG_ASSERTWARNING( rOStream.GetVersion(), "Rectangle::<< - Solar-Version not set on rOStream" 
);
 
-    if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        unsigned char   cAry[18];
-        int             i = 2;
-        sal_uInt32          nNum;
-
-        cAry[0] = 0;
-        cAry[1] = 0;
-
-        nNum = (sal_uInt32)(sal_Int32)rRect.nLeft;
-        if ( rRect.nLeft < 0 )
-        {
-            cAry[0] |= 0x80;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[0] |= 0x40;
-                    }
-                    else
-                        cAry[0] |= 0x30;
-                }
-                else
-                    cAry[0] |= 0x20;
-            }
-            else
-                cAry[0] |= 0x10;
-        }
-
-        nNum = (sal_uInt32)(sal_Int32)rRect.nTop;
-        if ( rRect.nTop < 0 )
-        {
-            cAry[0] |= 0x08;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[0] |= 0x04;
-                    }
-                    else
-                        cAry[0] |= 0x03;
-                }
-                else
-                    cAry[0] |= 0x02;
-            }
-            else
-                cAry[0] |= 0x01;
-        }
-
-        nNum = (sal_uInt32)(sal_Int32)rRect.nRight;
-        if ( rRect.nRight < 0 )
-        {
-            cAry[1] |= 0x80;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[1] |= 0x40;
-                    }
-                    else
-                        cAry[1] |= 0x30;
-                }
-                else
-                    cAry[1] |= 0x20;
-            }
-            else
-                cAry[1] |= 0x10;
-        }
-
-        nNum = (sal_uInt32)(sal_Int32)rRect.nBottom;
-        if ( rRect.nBottom < 0 )
-        {
-            cAry[1] |= 0x08;
-            nNum ^= 0xFFFFFFFF;
-        }
-        if ( nNum )
-        {
-            cAry[i] = (unsigned char)(nNum & 0xFF);
-            nNum >>= 8;
-            i++;
-
-            if ( nNum )
-            {
-                cAry[i] = (unsigned char)(nNum & 0xFF);
-                nNum >>= 8;
-                i++;
-
-                if ( nNum )
-                {
-                    cAry[i] = (unsigned char)(nNum & 0xFF);
-                    nNum >>= 8;
-                    i++;
-
-                    if ( nNum )
-                    {
-                        cAry[i] = (unsigned char)(nNum & 0xFF);
-                        nNum >>= 8;
-                        i++;
-                        cAry[1] |= 0x04;
-                    }
-                    else
-                        cAry[1] |= 0x03;
-                }
-                else
-                    cAry[1] |= 0x02;
-            }
-            else
-                cAry[1] |= 0x01;
-        }
-
-        rOStream.Write( cAry, i );
-    }
-    else
-    {
-        rOStream << rRect.nLeft << rRect.nTop << rRect.nRight << rRect.nBottom;
-    }
+    rOStream << rRect.nLeft << rRect.nTop << rRect.nRight << rRect.nBottom;
 
     return rOStream;
 }
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index f062b9e..d0492c3 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1671,8 +1671,6 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
     DBG_ASSERTWARNING( rIStream.GetVersion(), "Polygon::>> - Solar-Version not set on rIStream" );
 
     sal_uInt16          i;
-    sal_uInt16          nStart;
-    sal_uInt16          nCurPoints;
     sal_uInt16          nPoints;
 
     // Anzahl der Punkte einlesen und Array erzeugen
@@ -1686,40 +1684,6 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
     else
         rPoly.mpImplPolygon->ImplSetSize( nPoints, sal_False );
 
-    // Je nach CompressMode das Polygon einlesen
-    if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        i = 0;
-        unsigned char bShort;
-        while ( i < nPoints )
-        {
-            rIStream >> bShort >> nCurPoints;
-
-            if ( bShort )
-            {
-                short nShortX;
-                short nShortY;
-                for ( nStart = i; i < nStart+nCurPoints; i++ )
-                {
-                    rIStream >> nShortX >> nShortY;
-                    rPoly.mpImplPolygon->mpPointAry[i].X() = nShortX;
-                    rPoly.mpImplPolygon->mpPointAry[i].Y() = nShortY;
-                }
-            }
-            else
-            {
-                long nLongX;
-                long nLongY;
-                for ( nStart = i; i < nStart+nCurPoints; i++ )
-                {
-                    rIStream >> nLongX >> nLongY;
-                    rPoly.mpImplPolygon->mpPointAry[i].X() = nLongX;
-                    rPoly.mpImplPolygon->mpPointAry[i].Y() = nLongY;
-                }
-            }
-        }
-    }
-    else
     {
         // Feststellen, ob ueber die Operatoren geschrieben werden muss
 #if (SAL_TYPES_SIZEOFLONG) != 4
@@ -1752,74 +1716,12 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
     DBG_CHKOBJ( &rPoly, Polygon, NULL );
     DBG_ASSERTWARNING( rOStream.GetVersion(), "Polygon::<< - Solar-Version not set on rOStream" );
 
-    sal_uInt16          nStart;
     sal_uInt16          i;
     sal_uInt16          nPoints = rPoly.GetSize();
 
     // Anzahl der Punkte rausschreiben
     rOStream << nPoints;
 
-    // Je nach CompressMode das Polygon rausschreiben
-    if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-    {
-        i = 0;
-        unsigned char bShort;
-        while ( i < nPoints )
-        {
-            nStart = i;
-
-            // Feststellen, welcher Typ geschrieben werden soll
-            if ( ((rPoly.mpImplPolygon->mpPointAry[nStart].X() >= SHRT_MIN) &&
-                  (rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
-                 ((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
-                  (rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
-                bShort = sal_True;
-            else
-                bShort = sal_False;
-            unsigned char bCurShort;
-            while ( i < nPoints )
-            {
-                // Feststellen, welcher Typ geschrieben werden soll
-                if ( ((rPoly.mpImplPolygon->mpPointAry[nStart].X() >= SHRT_MIN) &&
-                      (rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
-                     ((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
-                      (rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
-                    bCurShort = sal_True;
-                else
-                    bCurShort = sal_False;
-
-                // Wenn sich die Werte in einen anderen Bereich begeben,
-                // muessen wir neu rausschreiben
-                if ( bCurShort != bShort )
-                {
-                    bShort = bCurShort;
-                    break;
-                }
-
-                i++;
-            }
-
-            rOStream << bShort << (sal_uInt16)(i-nStart);
-
-            if ( bShort )
-            {
-                for( ; nStart < i; nStart++ )
-                {
-                    rOStream << (short)rPoly.mpImplPolygon->mpPointAry[nStart].X()
-                             << (short)rPoly.mpImplPolygon->mpPointAry[nStart].Y();
-                }
-            }
-            else
-            {
-                for( ; nStart < i; nStart++ )
-                {
-                    rOStream << rPoly.mpImplPolygon->mpPointAry[nStart].X()
-                             << rPoly.mpImplPolygon->mpPointAry[nStart].Y();
-                }
-            }
-        }
-    }
-    else
     {
         // Feststellen, ob ueber die Operatoren geschrieben werden muss
 #if (SAL_TYPES_SIZEOFLONG) != 4
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.