[Libreoffice-commits] core.git: 3 commits - cui/source cui/uiconfig vcl/source

Caolán McNamara caolanm at redhat.com
Wed Apr 2 07:20:09 PDT 2014


 cui/source/tabpages/chardlg.cxx |   20 ++++++++++++++++++++
 cui/uiconfig/ui/positionpage.ui |   13 ++++++++-----
 vcl/source/gdi/outdev2.cxx      |   15 ++++++++++++---
 3 files changed, 40 insertions(+), 8 deletions(-)

New commits:
commit f5b9db43080658201caf07cd646bae4f4f2acc95
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 2 15:18:05 2014 +0100

    Resolves: fdo#75307 discard invalid user data
    
    Change-Id: Id39b51c344004e02d3d5a281ba98721b944468c3

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 5f8e255..28c118f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2897,6 +2897,26 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet )
         m_nSubEsc = (short)sUser.getToken( 1, ';' ).toInt32();
         m_nSuperProp = (sal_uInt8)sUser.getToken( 2, ';' ).toInt32();
         m_nSubProp = (sal_uInt8)sUser.getToken( 3, ';' ).toInt32();
+
+        //fdo#75307 validate all the entries and discard all of them if any are
+        //out of range
+        bool bValid = true;
+        if (m_nSuperEsc < m_pHighLowMF->GetMin() || m_nSuperEsc > m_pHighLowMF->GetMax())
+            bValid = false;
+        if (m_nSubEsc*-1 < m_pHighLowMF->GetMin() || m_nSubEsc*-1 > m_pHighLowMF->GetMax())
+            bValid = false;
+        if (m_nSuperProp < m_pFontSizeMF->GetMin() || m_nSuperProp > m_pFontSizeMF->GetMax())
+            bValid = false;
+        if (m_nSubProp < m_pFontSizeMF->GetMin() || m_nSubProp > m_pFontSizeMF->GetMax())
+            bValid = false;
+
+        if (!bValid)
+        {
+            m_nSuperEsc = DFLT_ESC_SUPER;
+            m_nSubEsc = DFLT_ESC_SUB;
+            m_nSuperProp = DFLT_ESC_PROP;
+            m_nSubProp = DFLT_ESC_PROP;
+        }
     }
 
     short nEsc = 0;
commit 604f67db541060146a8a33944d4bcf31f2e346b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 2 14:14:36 2014 +0100

    set mnemonic widgets
    
    Change-Id: Id4f4d2dfab6cf7f370488e87c6e86eb8da50b6fd

diff --git a/cui/uiconfig/ui/positionpage.ui b/cui/uiconfig/ui/positionpage.ui
index c44bee6..ebd1b24 100644
--- a/cui/uiconfig/ui/positionpage.ui
+++ b/cui/uiconfig/ui/positionpage.ui
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
 <interface>
   <!-- interface-requires LibreOffice 1.0 -->
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">1</property>
     <property name="upper">100</property>
@@ -135,6 +136,8 @@
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">Raise/lower by</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">raiselowersb:0%</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -148,7 +151,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">●</property>
-                        <property name="invisible_char_set">True</property>
                         <property name="adjustment">adjustment1</property>
                       </object>
                       <packing>
@@ -163,7 +165,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">●</property>
-                        <property name="invisible_char_set">True</property>
                         <property name="adjustment">adjustment1</property>
                       </object>
                       <packing>
@@ -195,6 +196,8 @@
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
                         <property name="label" translatable="yes">Relative font size</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">fontsizesb:0%</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -337,6 +340,8 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Scale width</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">scalewidthsb:0%</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -349,7 +354,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="invisible_char">●</property>
-                        <property name="invisible_char_set">True</property>
                         <property name="adjustment">adjustment2</property>
                       </object>
                       <packing>
@@ -460,7 +464,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="invisible_char">●</property>
-                    <property name="invisible_char_set">True</property>
                     <property name="adjustment">adjustment3</property>
                     <property name="digits">1</property>
                   </object>
commit 4520973ccf0ab042b09b4233d54a1779625b0093
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 2 11:21:46 2014 +0000

    Resolves: #i124580# corrected some conversions of scale values...
    
    to integer positions
    
    (cherry picked from commit d3c4a0c2a87504007a30e6944f52da4654cfa784)
    
    Change-Id: Iae4c16250e95938999d60d1c60e1163dfba243cf

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 6506095..74236bb 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -786,8 +786,11 @@ void OutputDevice::DrawTransformedBitmapEx(
     {
         // with no rotation, shear or mirroring it can be mapped to DrawBitmapEx
         // do *not* execute the mirroring here, it's done in the fallback
+        // #i124580# the correct DestSize needs to be calculated based on MaxXY values
         const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
-        const Size aDestSize(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()));
+        const Size aDestSize(
+            basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
+            basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
 
         DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
         return;
@@ -814,8 +817,11 @@ void OutputDevice::DrawTransformedBitmapEx(
         {
             // with no rotation or shear it can be mapped to DrawBitmapEx
             // do *not* execute the mirroring here, it's done in the fallback
+            // #i124580# the correct DestSize needs to be calculated based on MaxXY values
             const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
-            const Size aDestSize(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()));
+            const Size aDestSize(
+                basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
+                basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
 
             DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
             return;
@@ -879,8 +885,11 @@ void OutputDevice::DrawTransformedBitmapEx(
                     aTargetRange.getMinimum()));
 
             // extract point and size; do not remove size, the bitmap may have been prepared reduced by purpose
+            // #i124580# the correct DestSize needs to be calculated based on MaxXY values
             const Point aDestPt(basegfx::fround(aVisibleRange.getMinX()), basegfx::fround(aVisibleRange.getMinY()));
-            const Size aDestSize(basegfx::fround(aVisibleRange.getWidth()), basegfx::fround(aVisibleRange.getHeight()));
+            const Size aDestSize(
+                basegfx::fround(aVisibleRange.getMaxX()) - aDestPt.X(),
+                basegfx::fround(aVisibleRange.getMaxY()) - aDestPt.Y());
 
             DrawBitmapEx(aDestPt, aDestSize, aTransformed);
         }


More information about the Libreoffice-commits mailing list