[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Tue Jan 28 06:16:36 PST 2014


 sw/source/filter/ww8/wrtww8.cxx   |   10 ----------
 sw/source/filter/ww8/ww8graf.cxx  |    4 ----
 sw/source/filter/ww8/ww8graf2.cxx |    9 ---------
 sw/source/filter/ww8/ww8struc.hxx |    4 ----
 4 files changed, 27 deletions(-)

New commits:
commit cd527aae72a0b2030d00151e2137b37165c65b96
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 28 14:57:53 2014 +0100

    sw: remove __WW8_NEEDS_COPY over-optimization
    
    Since commit 166a79df88853847528d558ea98656ad358f4645 effectively increased
    SAL_TYPES_ALIGNMENT4 it caused __WW8_NEEDS_COPY to be defined for MSVC too
    so the !__WW8_NEEDS_COPY case is dead code now.
    
    Change-Id: Ia5c20588a2efdd341f1406e091fecf16a12c3f2f

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c565c6b..43b5fbe 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -149,13 +149,8 @@ public:
     void SetNewEnd( WW8_FC nEnd )
     {   ((sal_Int32*)pFkp)[nIMax] = nEnd; }
 
-#ifdef __WW8_NEEDS_COPY
     WW8_FC GetStartFc() const;
     WW8_FC GetEndFc() const;
-#else
-    WW8_FC GetStartFc() const { return ((sal_Int32*)pFkp)[0]; };
-    WW8_FC GetEndFc() const { return ((sal_Int32*)pFkp)[nIMax]; };
-#endif // defined __WW8_NEEDS_COPY
 
     sal_uInt8 *CopyLastSprms(sal_uInt8 &rLen, bool bVer8);
 };
@@ -1217,8 +1212,6 @@ void WW8_WrFkp::MergeToNew( short& rVarLen, sal_uInt8 *& rpNewSprms )
     }
 }
 
-#ifdef __WW8_NEEDS_COPY
-
 WW8_FC WW8_WrFkp::GetStartFc() const
 {
 // wenn bCombined, dann ist das Array ab pFkp schon Bytemaessig auf LittleEndian
@@ -1236,9 +1229,6 @@ WW8_FC WW8_WrFkp::GetEndFc() const
     return ((sal_Int32*)pFkp)[nIMax];
 }
 
-#endif // defined __WW8_NEEDS_COPY
-
-
 // Method for managing the piece table
 WW8_WrPct::WW8_WrPct(WW8_FC nfcMin, bool bSaveUniCode)
     : nOldFc(nfcMin), bIsUni(bSaveUniCode)
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 10b7e6c..81a2ec0 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2419,13 +2419,9 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
 
     WW8_FSPA_SHADOW* pFS = (WW8_FSPA_SHADOW*)pF0;
     WW8_FSPA*        pF;
-#ifdef __WW8_NEEDS_COPY
     WW8_FSPA aFSFA;
     pF = &aFSFA;
     WW8FSPAShadowToReal( pFS, pF );
-#else
-    pF = (WW8_FSPA*)pFS;
-#endif // defined __WW8_NEEDS_COPY
     if( !pF->nSpId )
     {
         OSL_ENSURE( !this, "+Wo ist die Grafik (3) ?" );
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 18c290b..d9f9b97 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -236,9 +236,7 @@ bool wwZOrderer::InsertObject(SdrObject* pObject, sal_uLong nPos)
     return false;
 }
 
-#ifdef __WW8_NEEDS_COPY
 extern void WW8PicShadowToReal(  WW8_PIC_SHADOW*  pPicS,  WW8_PIC*  pPic );
-#endif // defined __WW8_NEEDS_COPY
 
 bool SwWW8ImplReader::GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc)
 {
@@ -447,13 +445,9 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic,
     bool bVer67)
 {
     //Only the first 0x2e bytes are the same between version 6/7 and 8+
-#ifdef __WW8_NEEDS_COPY
     WW8_PIC_SHADOW aPicS;
     pDataStream->Read( &aPicS, sizeof( aPicS ) );
     WW8PicShadowToReal( &aPicS, pPic );
-#else
-    pDataStream->Read( pPic, 0x2E);
-#endif // defined __WW8_NEEDS_COPY
     for (int i=0;i<4;i++)
         pDataStream->Read( &pPic->rgbrc[i], bVer67 ? 2 : 4);
     *pDataStream >> pPic->dxaOrigin;
@@ -726,8 +720,6 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
     return AddAutoAnchor(pRet);
 }
 
-#ifdef __WW8_NEEDS_COPY
-
 void WW8PicShadowToReal( WW8_PIC_SHADOW * pPicS, WW8_PIC * pPic )
 {
     pPic->lcb = SVBT32ToUInt32( pPicS->lcb );
@@ -774,6 +766,5 @@ void WW8FSPAShadowToReal( WW8_FSPA_SHADOW * pFSPAS, WW8_FSPA * pFSPA )
     pFSPA->bAnchorLock  = 0 !=  ( nBits & 0x8000 );
     pFSPA->nTxbx = SVBT32ToUInt32( pFSPAS->nTxbx );
 }
-#endif // defined __WW8_NEEDS_COPY
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 2e9f18b..9935da4 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -27,10 +27,6 @@
 #include <editeng/borderline.hxx>
 #include <filter/msfilter/util.hxx>
 
-#if defined  OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
-#   define __WW8_NEEDS_COPY
-#endif
-
 #ifdef SAL_W32
 #   pragma pack(push, 2)
 #endif


More information about the Libreoffice-commits mailing list