You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2014/02/18 15:17:32 UTC

svn commit: r1569337 - in /openoffice/trunk/main/svx/source/sidebar/possize: PosSizePropertyPanel.cxx PosSizePropertyPanel.hxx

Author: af
Date: Tue Feb 18 14:17:32 2014
New Revision: 1569337

URL: http://svn.apache.org/r1569337
Log:
124216: Detect changes of the UI scale.

Modified:
    openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
    openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx

Modified: openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1569337&r1=1569336&r2=1569337&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Tue Feb 18 14:17:32 2014
@@ -996,6 +996,7 @@ void PosSizePropertyPanel::NotifyItemUpd
             
         case SID_ATTR_METRIC:
             MetricState( eState, pState );
+            UpdateUIScale();
             break;
 
         default:
@@ -1350,6 +1351,28 @@ void PosSizePropertyPanel::DisableContro
 }
 
 
+
+
+void PosSizePropertyPanel::UpdateUIScale (void)
+{
+    const Fraction aUIScale (mpView->GetModel()->GetUIScale());
+    if (maUIScale != aUIScale)
+    {
+        // UI scale has changed.
+
+        // Remember the new UI scale.
+        maUIScale = aUIScale;
+
+        // The content of the position and size boxes is only updated when item changes are notified.
+        // Request such notifications without changing the actual item values.
+        GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_X, sal_True, sal_False);
+        GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_Y, sal_True, sal_False);
+        GetBindings()->Invalidate(SID_ATTR_TRANSFORM_WIDTH, sal_True, sal_False);
+        GetBindings()->Invalidate(SID_ATTR_TRANSFORM_HEIGHT, sal_True, sal_False);
+    }
+}
+
+
 } } // end of namespace svx::sidebar
 
 // eof

Modified: openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx?rev=1569337&r1=1569336&r2=1569337&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.hxx Tue Feb 18 14:17:32 2014
@@ -184,6 +184,18 @@ private:
     void DisableControls();
     void AdaptWidthHeightScalePosition(bool bOriginal);
     void AdaptAngleFlipDialPosition(bool bOriginal);
+
+    /** Check if the UI scale has changed and handle such a change.
+        UI scale is an SD only feature.  The UI scale is represented by items
+        ATTR_OPTIONS_SCALE_X and
+        ATTR_OPTIONS_SCALE_Y.
+        As we have no direct access (there is no dependency of svx on sd) we have to
+        use a small trick (aka hack):
+        a) call this method whenever a change of the metric item is notified,
+        b) check if the UI scale has changed (strangely, the UI scale value is available at the SdrModel.
+        c) invalidate the items for position and size to trigger notifications of their current values.
+    */
+    void UpdateUIScale (void);
 };