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

Caolán McNamara caolanm at redhat.com
Fri Apr 25 08:35:15 PDT 2014


 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |    4 
 sd/source/ui/view/drviewsa.cxx                          |   92 ++++++++--------
 vcl/source/gdi/font.cxx                                 |    6 -
 3 files changed, 50 insertions(+), 52 deletions(-)

New commits:
commit 21334f74a53197c32863fdf3d7e6f365f1b868b7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 25 16:30:09 2014 +0100

    Revert "give empty constructed default font a default height"
    
    and make a real copy of the TargetFont
    
    the 0,0 font size appears to mean "default" size so it can
    take the desktop env font size or some such, with a hard-coded
    value then the various "bold" entries in the UI are huge
    
    This reverts commit 121aac37673c1a8142db01e26e50be6de7b36987.
    
    Change-Id: Iec1d3867403808370d89d6b5ad2fec60ffdcd881

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 46d4467..8a19cbe 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -2119,9 +2119,9 @@ namespace
 
                                 // for sub-Mteafile contents, do start with new, default render state
                                 // #i124686# ...but copy font, this is already set accordingly
-                                const Font& rTargetFont = rPropertyHolders.Current().getFont();
+                                Font aTargetFont = rPropertyHolders.Current().getFont();
                                 rPropertyHolders.PushDefault();
-                                rPropertyHolders.Current().setFont(rTargetFont);
+                                rPropertyHolders.Current().setFont(aTargetFont);
 
                                 interpretMetafile(aGDIMetaFile, rTargetHolders, rPropertyHolders, rViewInformation);
                                 xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 60230e3..489304e 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -63,12 +63,6 @@ Impl_Font::Impl_Font() :
     mbVertical          = false;
     mbTransparent       = true;
     mbConfigLookup      = false;
-
-    // #i124686# the Size is defaulted to (0,0) when default constructed,
-    // this is not useful for a default font. Init it to a useful default
-    // so that the Font::Font() constructor which uses a 'naked' static
-    // Impl_Font instance (aStaticImplFont) creates a useful default font
-    maSize = Size(0, 16);
 }
 
 Impl_Font::Impl_Font( const Impl_Font& rImplFont )
commit 6643b783b4d8c298eae716a36a1776692498f00b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 25 12:03:50 2014 +0100

    Related: rhbz#1091111 GetSdrPageView can return NULL
    
    Change-Id: I560bf74235728fb39156c32b47dd40f181dada16

diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 5cc9d32..8e1e09d 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -656,55 +656,59 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
         }
     }
 
-    Point aPos = GetActiveWindow()->PixelToLogic(maMousePos);
-    mpDrawView->GetSdrPageView()->LogicToPagePos(aPos);
-    Fraction aUIScale(GetDoc()->GetUIScale());
-    aPos.X() = Fraction(aPos.X()) / aUIScale;
-    aPos.Y() = Fraction(aPos.Y()) / aUIScale;
-
-    // position- and size items
-    if ( mpDrawView->IsAction() )
+    SdrPageView* pPageView = mpDrawView->GetSdrPageView();
+    if (pPageView)
     {
-        Rectangle aRect;
-        mpDrawView->TakeActionRect( aRect );
-
-        if ( aRect.IsEmpty() )
-            rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
-        else
-        {
-            mpDrawView->GetSdrPageView()->LogicToPagePos(aRect);
-            aPos = aRect.TopLeft();
-            aPos.X() = Fraction(aPos.X()) / aUIScale;
-            aPos.Y() = Fraction(aPos.Y()) / aUIScale;
-            rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) );
-            Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
-            aSize.Height() = Fraction(aSize.Height()) / aUIScale;
-            aSize.Width()  = Fraction(aSize.Width())  / aUIScale;
-            rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
-        }
-    }
-    else
-    {
-        if ( mpDrawView->AreObjectsMarked() )
+        Point aPos = GetActiveWindow()->PixelToLogic(maMousePos);
+        pPageView->LogicToPagePos(aPos);
+        Fraction aUIScale(GetDoc()->GetUIScale());
+        aPos.X() = Fraction(aPos.X()) / aUIScale;
+        aPos.Y() = Fraction(aPos.Y()) / aUIScale;
+
+        // position- and size items
+        if ( mpDrawView->IsAction() )
         {
-            Rectangle aRect = mpDrawView->GetAllMarkedRect();
-            mpDrawView->GetSdrPageView()->LogicToPagePos(aRect);
-
-            // Show the position of the selected shape(s)
-            Point aShapePosition (aRect.TopLeft());
-            aShapePosition.X() = Fraction(aShapePosition.X()) / aUIScale;
-            aShapePosition.Y() = Fraction(aShapePosition.Y()) / aUIScale;
-            rSet.Put (SfxPointItem(SID_ATTR_POSITION, aShapePosition));
-
-            Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
-            aSize.Height() = Fraction(aSize.Height()) / aUIScale;
-            aSize.Width()  = Fraction(aSize.Width())  / aUIScale;
-            rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
+            Rectangle aRect;
+            mpDrawView->TakeActionRect( aRect );
+
+            if ( aRect.IsEmpty() )
+                rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
+            else
+            {
+                pPageView->LogicToPagePos(aRect);
+                aPos = aRect.TopLeft();
+                aPos.X() = Fraction(aPos.X()) / aUIScale;
+                aPos.Y() = Fraction(aPos.Y()) / aUIScale;
+                rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) );
+                Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
+                aSize.Height() = Fraction(aSize.Height()) / aUIScale;
+                aSize.Width()  = Fraction(aSize.Width())  / aUIScale;
+                rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
+            }
         }
         else
         {
-            rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
-            rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
+            if ( mpDrawView->AreObjectsMarked() )
+            {
+                Rectangle aRect = mpDrawView->GetAllMarkedRect();
+                pPageView->LogicToPagePos(aRect);
+
+                // Show the position of the selected shape(s)
+                Point aShapePosition (aRect.TopLeft());
+                aShapePosition.X() = Fraction(aShapePosition.X()) / aUIScale;
+                aShapePosition.Y() = Fraction(aShapePosition.Y()) / aUIScale;
+                rSet.Put (SfxPointItem(SID_ATTR_POSITION, aShapePosition));
+
+                Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
+                aSize.Height() = Fraction(aSize.Height()) / aUIScale;
+                aSize.Width()  = Fraction(aSize.Width())  / aUIScale;
+                rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
+            }
+            else
+            {
+                rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
+                rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list