[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang vcl/inc vcl/osx

Stephan Bergmann sbergman at redhat.com
Tue Apr 28 13:40:26 PDT 2015


 compilerplugins/clang/vclwidgets.cxx |    2 +-
 vcl/inc/osx/a11yfocustracker.hxx     |    2 +-
 vcl/osx/printaccessoryview.mm        |   22 +++++++++++-----------
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit d798ee8f82dcbdada49ef0c745ff234d936bb3f6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 28 22:39:36 2015 +0200

    loplugin:vclwidgets (best guess)
    
    Change-Id: I682a0970fd667eacda781e799a941a11593ade90

diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index e45f74a..6f1efd6 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -84,7 +84,7 @@ private:
     rtl::Reference< KeyboardFocusListener > m_aFocusListener;
 
     // the list of Windows that need deeper (focus) investigation
-    std::set< vcl::Window *> m_aDocumentWindowList;
+    std::set<VclPtr<vcl::Window>> m_aDocumentWindowList;
 
     // the link object needed for Application::addEventListener
     Link m_aWindowEventLink;
diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 81b3194..cd37d5f 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -299,14 +299,14 @@ class ControllerProperties
         {
             GDIMetaFile aMtf;
             PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
-            VirtualDevice aDev;
+            auto aDev(VclPtr<VirtualDevice>::Create());
             if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
-                aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT | 
+                aDev->SetDrawMode( aDev->GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT | 
                                                          DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
             // see salprn.cxx, currently we pretend to be a 720dpi device on printers
-            aDev.SetReferenceDevice( 720, 720 );
-            aDev.EnableOutput( TRUE );
-            Size aLogicSize( aDev.PixelToLogic( aPixelSize, MapMode( MAP_100TH_MM ) ) );
+            aDev->SetReferenceDevice( 720, 720 );
+            aDev->EnableOutput( TRUE );
+            Size aLogicSize( aDev->PixelToLogic( aPixelSize, MapMode( MAP_100TH_MM ) ) );
             double fScaleX = double(aLogicSize.Width())/double(aPageSize.aSize.Width());
             double fScaleY = double(aLogicSize.Height())/double(aPageSize.aSize.Height());
             double fScale = (fScaleX < fScaleY) ? fScaleX : fScaleY;
@@ -321,13 +321,13 @@ class ControllerProperties
             aMtf.WindStart();
             aLogicSize.Width() = long(double(aPageSize.aSize.Width()) * fScale);
             aLogicSize.Height() = long(double(aPageSize.aSize.Height()) * fScale);
-            aPixelSize = aDev.LogicToPixel( aLogicSize, MapMode( MAP_100TH_MM ) );
-            aDev.SetOutputSizePixel( aPixelSize );
+            aPixelSize = aDev->LogicToPixel( aLogicSize, MapMode( MAP_100TH_MM ) );
+            aDev->SetOutputSizePixel( aPixelSize );
             aMtf.WindStart();
-            aDev.SetMapMode( MapMode( MAP_100TH_MM ) );
-            aMtf.Play( &aDev, Point( 0, 0 ), aLogicSize );
-            aDev.EnableMapMode( FALSE );
-            Image aImage( aDev.GetBitmap( Point( 0, 0 ), aPixelSize ) );
+            aDev->SetMapMode( MapMode( MAP_100TH_MM ) );
+            aMtf.Play( aDev.get(), Point( 0, 0 ), aLogicSize );
+            aDev->EnableMapMode( FALSE );
+            Image aImage( aDev->GetBitmap( Point( 0, 0 ), aPixelSize ) );
             NSImage* pImage = CreateNSImage( aImage );
             [mpPreview setImage: [pImage autorelease]];
         }
commit cd41fa43089d0977cbf62071c9bfe2322de5d012
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 28 22:36:48 2015 +0200

    Work around FieldDecl::getParent raising assertion
    
    ...when inside an ObjCInterfaceDecl, cf. thread starting at
    <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-April/042629.html>
    "FieldDecl::getParent() not working in Objective C code?"
    
    Change-Id: Ifa9b4925979123c6b6fee1b46a1f57803207d3c8

diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index e12e957..f984dcb 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -265,7 +265,7 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
     if (fieldDecl->isBitField()) {
         return true;
     }
-    const CXXRecordDecl *pParentRecordDecl = dyn_cast<CXXRecordDecl>(fieldDecl->getParent());
+    const CXXRecordDecl *pParentRecordDecl = isa<RecordDecl>(fieldDecl->getDeclContext()) ? dyn_cast<CXXRecordDecl>(fieldDecl->getParent()) : nullptr;
     if (containsWindowSubclass(fieldDecl->getType())) {
         // have to ignore this for now, nasty reverse dependency from tools->vcl
         if (!(pParentRecordDecl != nullptr && pParentRecordDecl->getQualifiedNameAsString() == "ErrorContextImpl")) {


More information about the Libreoffice-commits mailing list