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

Michaël Lefèvre lefevre00 at yahoo.fr
Tue Nov 18 02:32:09 PST 2014


 sw/source/core/layout/paintfrm.cxx |   58 +++++++++++++++++++++----------------
 1 file changed, 34 insertions(+), 24 deletions(-)

New commits:
commit b66f1edef2a64803b8ebde913c26a3c0727e9186
Author: Michaël Lefèvre <lefevre00 at yahoo.fr>
Date:   Sun Nov 16 11:38:35 2014 +0100

    Put properties in their own structure
    
    The structure will be the entry point for static variables in latter patches
    
    Change-Id: Iaa072591b1c900598c4f8ebf386e9b51342967dd
    Reviewed-on: https://gerrit.libreoffice.org/12477
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 98cb0a4..bd691d5 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -352,10 +352,9 @@ void SwCalcPixStatics( OutputDevice *pOut )
 }
 
 /**
- * To be able to save the statics so the paint is more or lees reentrant
+ *
  */
-class SwSavePaintStatics
-{
+struct SwPaintProperties {
     bool                bSFlyMetafile;
     SwViewShell        *pSGlobalShell;
     OutputDevice       *pSFlyMetafileOut;
@@ -376,33 +375,43 @@ class SwSavePaintStatics
     Color               aSGlobalRetoucheColor;
     double              aSScaleX,
                         aSScaleY;
+};
+
+/**
+ * To be able to save the statics so the paint is more or lees reentrant
+ */
+class SwSavePaintStatics : public SwPaintProperties
+{
 public:
     SwSavePaintStatics();
     ~SwSavePaintStatics();
 };
 
-SwSavePaintStatics::SwSavePaintStatics() :
-    bSFlyMetafile       ( bFlyMetafile      ),
-    pSGlobalShell       ( pGlobalShell      ),
-    pSFlyMetafileOut    ( pFlyMetafileOut   ),
-    pSRetoucheFly       ( pRetoucheFly      ),
-    pSRetoucheFly2      ( pRetoucheFly2     ),
-    pSFlyOnlyDraw       ( pFlyOnlyDraw      ),
-    pBLines             ( g_pBorderLines    ),
-    pSLines             ( pLines            ),
-    pSSubsLines         ( pSubsLines        ),
-    pSSpecSubsLines     ( pSpecSubsLines    ),
-    pSProgress          ( pProgress         ),
-    nSPixelSzW          ( nPixelSzW         ),
-    nSPixelSzH          ( nPixelSzH         ),
-    nSHalfPixelSzW      ( nHalfPixelSzW     ),
-    nSHalfPixelSzH      ( nHalfPixelSzH     ),
-    nSMinDistPixelW     ( nMinDistPixelW    ),
-    nSMinDistPixelH     ( nMinDistPixelH    ),
-    aSGlobalRetoucheColor( aGlobalRetoucheColor ),
-    aSScaleX            ( aScaleX           ),
-    aSScaleY            ( aScaleY           )
+SwSavePaintStatics::SwSavePaintStatics()
 {
+    // Saving globales
+    bSFlyMetafile = bFlyMetafile;
+    pSGlobalShell = pGlobalShell;
+    pSFlyMetafileOut = pFlyMetafileOut;
+    pSRetoucheFly = pRetoucheFly;
+    pSRetoucheFly2 = pRetoucheFly2;
+    pSFlyOnlyDraw = pFlyOnlyDraw;
+    pBLines = g_pBorderLines;
+    pSLines = pLines;
+    pSSubsLines = pSubsLines;
+    pSSpecSubsLines = pSpecSubsLines;
+    pSProgress = pProgress;
+    nSPixelSzW = nPixelSzW;
+    nSPixelSzH = nPixelSzH;
+    nSHalfPixelSzW = nHalfPixelSzW;
+    nSHalfPixelSzH = nHalfPixelSzH;
+    nSMinDistPixelW = nMinDistPixelW;
+    nSMinDistPixelH = nMinDistPixelH ;
+    aSGlobalRetoucheColor = aGlobalRetoucheColor;
+    aSScaleX = aScaleX;
+    aSScaleY = aScaleY;
+
+    // Restoring globales to default
     bFlyMetafile = false;
     pFlyMetafileOut = 0;
     pRetoucheFly  = 0;
@@ -422,6 +431,7 @@ SwSavePaintStatics::SwSavePaintStatics() :
 
 SwSavePaintStatics::~SwSavePaintStatics()
 {
+    // Restoring globales to saved one
     pGlobalShell       = pSGlobalShell;
     bFlyMetafile       = bSFlyMetafile;
     pFlyMetafileOut    = pSFlyMetafileOut;


More information about the Libreoffice-commits mailing list