[Libreoffice-commits] core.git: sd/source vcl/qa vcl/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Sun Dec 25 17:56:40 UTC 2016


 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx |    2 +-
 vcl/qa/cppunit/complextext.cxx                            |    4 ++--
 vcl/qa/cppunit/outdev.cxx                                 |    2 +-
 vcl/source/outdev/bitmap.cxx                              |    4 ++--
 vcl/source/outdev/font.cxx                                |    3 +--
 vcl/source/outdev/text.cxx                                |    2 +-
 vcl/source/outdev/transparent.cxx                         |    4 ++--
 7 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 17ce9a2578dd49ae743d86a0639ea0e9956bbc17
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sun Dec 25 14:27:02 2016 +0100

    remove unneeded static_casts
    
    found thanks to old comment
    
    Change-Id: I9dbdd8c2f17243ce0d89468c18abd852c0e5eb78
    Reviewed-on: https://gerrit.libreoffice.org/32420
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 8b2197c..6f91cb7 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -71,7 +71,7 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase (
       mxModel (nullptr),
       maViewForwarder (
         static_cast<SdrPaintView*>(pViewShell->GetView()),
-        *static_cast<OutputDevice*>(pSdWindow))
+        *pSdWindow)
 {
     if (mxController.is())
         mxModel = mxController->getModel();
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index 41b239a..a7aa56a 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -52,7 +52,7 @@ void VclComplexTextTest::testArabic()
     ScopedVclPtrInstance<WorkWindow> pWin(static_cast<vcl::Window *>(nullptr));
     CPPUNIT_ASSERT( pWin );
 
-    OutputDevice *pOutDev = static_cast< OutputDevice * >( pWin.get() );
+    OutputDevice *pOutDev = pWin.get();
 
     vcl::Font aFont = OutputDevice::GetDefaultFont(
                         DefaultFontType::CTL_SPREADSHEET,
@@ -97,7 +97,7 @@ void VclComplexTextTest::testTdf95650()
     ScopedVclPtrInstance<WorkWindow> pWin(static_cast<vcl::Window *>(nullptr));
     CPPUNIT_ASSERT(pWin);
 
-    OutputDevice *pOutDev = static_cast< OutputDevice * >(pWin.get());
+    OutputDevice *pOutDev = pWin.get();
     // Check that the following executes without failing assertion
     pOutDev->ImplLayout(aTxt, 9, 1, Point(), 0, nullptr, SalLayoutFlags::BiDiRtl);
 }
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx
index f566f81..1e65087 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -75,7 +75,7 @@ void VclOutdevTest::testVirtualDevice()
 #if 0
     VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create( (vcl::Window *)nullptr );
     CPPUNIT_ASSERT( pWin );
-    OutputDevice *pOutDev = static_cast< OutputDevice * >( pWin );
+    OutputDevice *pOutDev = pWin.get();
 #endif
 }
 
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index cbf4416..36fea7a 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -436,7 +436,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
 
                 if ( aVDev->SetOutputSizePixel( aRect.GetSize() ) )
                 {
-                    if ( static_cast<OutputDevice*>(aVDev.get())->mpGraphics || static_cast<OutputDevice*>(aVDev.get())->AcquireGraphics() )
+                    if ( aVDev.get()->mpGraphics || aVDev.get()->AcquireGraphics() )
                     {
                         if ( (nWidth > 0) && (nHeight > 0) )
                         {
@@ -444,7 +444,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
                                               (aRect.Left() < mnOutOffX) ? (mnOutOffX - aRect.Left()) : 0L,
                                               (aRect.Top() < mnOutOffY) ? (mnOutOffY - aRect.Top()) : 0L,
                                               nWidth, nHeight);
-                            (static_cast<OutputDevice*>(aVDev.get())->mpGraphics)->CopyBits( aPosAry, mpGraphics, this, this );
+                            aVDev.get()->mpGraphics->CopyBits( aPosAry, mpGraphics, this, this );
                         }
                         else
                         {
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 7d50895..eba3374 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -606,8 +606,7 @@ void OutputDevice::ImplClearAllFontData(bool bNewFontLists)
         {
             if ( pFrame->AcquireGraphics() )
             {
-                // Stupid typecast here and somewhere ((OutputDevice*)&aVDev)->, because bug in .NET2002 compiler
-                OutputDevice *pDevice = static_cast<OutputDevice*>(pFrame);
+                OutputDevice *pDevice = pFrame;
                 pDevice->mpGraphics->ClearDevFontCache();
                 pDevice->mpGraphics->GetDevFontList(pFrame->mpWindowImpl->mpFrameData->mpFontCollection);
             }
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index a3f3d83..70497c5 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -242,7 +242,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
 
     // draw text into upper left corner
     rSalLayout.DrawBase() -= aBoundRect.TopLeft();
-    rSalLayout.DrawText( *static_cast<OutputDevice*>(pVDev)->mpGraphics );
+    rSalLayout.DrawText( *pVDev->mpGraphics );
 
     Bitmap aBmp = pVDev->GetBitmap( Point(), aBoundRect.GetSize() );
     if ( !aBmp || !aBmp.Rotate( mpFontInstance->mnOwnOrientation, COL_WHITE ) )
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index cfb3572..b2a3c47 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -699,8 +699,8 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
         {
             ScopedVclPtrInstance< VirtualDevice > xVDev;
 
-            static_cast<OutputDevice*>(xVDev.get())->mnDPIX = mnDPIX;
-            static_cast<OutputDevice*>(xVDev.get())->mnDPIY = mnDPIY;
+            xVDev.get()->mnDPIX = mnDPIX;
+            xVDev.get()->mnDPIY = mnDPIY;
 
             if( xVDev->SetOutputSizePixel( aDstRect.GetSize() ) )
             {


More information about the Libreoffice-commits mailing list