comphelper/inc/comphelper/types.hxx | 2 - svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 30 +++++++++++++++----- svx/source/tbxctrls/itemwin.cxx | 20 +++++++++++-- 3 files changed, 41 insertions(+), 11 deletions(-)
New commits: commit 5f87f63a41d3ed09579c527ee5d6fab0f48785d4 Author: Jürgen Schmidt <[email protected]> Date: Thu Mar 20 15:23:37 2014 +0000 remove warning, remove unused parameter variable diff --git a/comphelper/inc/comphelper/types.hxx b/comphelper/inc/comphelper/types.hxx index 3e0483d..9bbbcef 100644 --- a/comphelper/inc/comphelper/types.hxx +++ b/comphelper/inc/comphelper/types.hxx @@ -99,7 +99,7 @@ namespace comphelper /** check if a type you have at hand at runtime is equal to another type you have at compile time */ template <class TYPE> - sal_Bool isAReference(const staruno::Any& _rVal, TYPE* pDummy) + sal_Bool isAReference(const staruno::Any& _rVal, TYPE*) { return _rVal.getValueType().equals( cppu::getTypeFavourUnsigned( commit 34279ea85c33e3efd21971ab692a3de4bdd91817 Author: Armin Le Grand <[email protected]> Date: Thu Mar 20 14:36:21 2014 +0000 i124409 use slot SID_ATTR_METRIC to retrive the UI unit, not GetModuleFieldUnit diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index a329fef..4fe4dd1 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -91,7 +91,10 @@ PosSizePropertyPanel::PosSizePropertyPanel( mlRotY(0), maUIScale(), mePoolUnit(), - meDlgUnit(), + + // #124409# init with fallback default + meDlgUnit(FUNIT_INCH), + maTransfPosXControl(SID_ATTR_TRANSFORM_POS_X, *pBindings, *this), maTransfPosYControl(SID_ATTR_TRANSFORM_POS_Y, *pBindings, *this), maTransfWidthControl(SID_ATTR_TRANSFORM_WIDTH, *pBindings, *this), @@ -313,11 +316,15 @@ void PosSizePropertyPanel::Initialize() } mePoolUnit = maTransfWidthControl.GetCoreMetric(); - meDlgUnit = GetModuleFieldUnit(); - SetFieldUnit( *mpMtrPosX, meDlgUnit, true ); - SetFieldUnit( *mpMtrPosY, meDlgUnit, true ); - SetFieldUnit( *mpMtrWidth, meDlgUnit, true ); - SetFieldUnit( *mpMtrHeight, meDlgUnit, true ); + + // #124409# no need to do this, the mpBindings->Update( SID_ATTR_METRIC ) + // call in the constructor will trigger MetricState and will get the correct unit + // + // meDlgUnit = GetModuleFieldUnit(); + // SetFieldUnit( *mpMtrPosX, meDlgUnit, true ); + // SetFieldUnit( *mpMtrPosY, meDlgUnit, true ); + // SetFieldUnit( *mpMtrWidth, meDlgUnit, true ); + // SetFieldUnit( *mpMtrHeight, meDlgUnit, true ); } @@ -784,7 +791,13 @@ void PosSizePropertyPanel::NotifyItemUpdate( // Pool unit and dialog unit may have changed, make sure that we // have the current values. mePoolUnit = maTransfWidthControl.GetCoreMetric(); - meDlgUnit = GetModuleFieldUnit(); + + // #124409# do not change; GetModuleFieldUnit uses SfxModule::GetCurrentFieldUnit() + // which uses GetActiveModule() and if no items are set there (which is the case e.g. + // for writer), will just return the system fallback of FUNIT_INCH which is wrong. + // Anyways, with multiple open views the static call GetActiveModule is ambigious + // + // meDlgUnit = GetModuleFieldUnit(); switch (nSID) { @@ -1202,6 +1215,9 @@ void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* bool bWidthBlank = false; bool bHeightBlank = false; String sNull = String::CreateFromAscii(""); + + // #124409# use the given Item to get the correct UI unit and initialize it + // and the Fields using it meDlgUnit = GetCurrentUnit(eState,pState); if( mpMtrPosX->GetText() == sNull ) commit d602017961ec03ada7cdd8c08358870dcd674555 Author: Armin Le Grand <[email protected]> Date: Thu Mar 20 13:01:49 2014 +0000 i124425 corrected SvxMetricField::Down() behaviour diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 5141ed3..010a6849 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -544,12 +544,26 @@ void SvxMetricField::ReleaseFocus_Impl() void SvxMetricField::Down() { - sal_Int64 nValue = GetValue(); - nValue -= GetSpinSize(); + // #124425# make the OS2 case OS2-only (if still needed); under + // non-OS2 it prevents the value to go to zero on down presses, + // s do not use there. Also added a fix for OS2, but could not test +#ifdef OS2 + const sal_Int64 nValue(GetValue() - GetSpinSize()); - // Um unter OS/2 einen Sprung auf Max zu verhindern + // prevent a jump to spin max on OS2 if ( nValue >= GetMin() ) + { MetricField::Down(); + } + else if ( nValue < GetMin() ) + { + // still set to GetMin() when spin min is reached + SetMetricValue( *this, GetMin(), ePoolUnit ); + } + +#else + MetricField::Down(); +#endif } // -----------------------------------------------------------------------
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
