summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/itemwin.cxx14
-rw-r--r--svx/source/tbxctrls/linectrl.cxx10
2 files changed, 16 insertions, 8 deletions
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 5dd5ae966506..2db377a6b57d 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -242,7 +242,7 @@ SvxMetricField::SvxMetricField(
vcl::Window* pParent, const Reference< XFrame >& rFrame )
: MetricField(pParent, WB_BORDER | WB_SPIN | WB_REPEAT)
, aCurTxt()
- , ePoolUnit(MapUnit::MapCM)
+ , eDestPoolUnit(MapUnit::Map100thMM)
, mxFrame(rFrame)
{
Size aSize( CalcMinimumSize() );
@@ -265,8 +265,10 @@ void SvxMetricField::Update( const XLineWidthItem* pItem )
{
if ( pItem )
{
- if ( pItem->GetValue() != GetCoreValue( *this, ePoolUnit ) )
- SetMetricValue( *this, pItem->GetValue(), ePoolUnit );
+ // tdf#132169 we always get the value in MapUnit::Map100thMM but have
+ // to set it in the core metric of the target application
+ if ( pItem->GetValue() != GetCoreValue( *this, MapUnit::Map100thMM ) )
+ SetMetricValue( *this, pItem->GetValue(), MapUnit::Map100thMM );
}
else
SetText( "" );
@@ -276,7 +278,7 @@ void SvxMetricField::Update( const XLineWidthItem* pItem )
void SvxMetricField::Modify()
{
MetricField::Modify();
- long nTmp = GetCoreValue( *this, ePoolUnit );
+ long nTmp = GetCoreValue( *this, eDestPoolUnit );
XLineWidthItem aLineWidthItem( nTmp );
Any a;
@@ -300,9 +302,9 @@ void SvxMetricField::ReleaseFocus_Impl()
}
}
-void SvxMetricField::SetCoreUnit( MapUnit eUnit )
+void SvxMetricField::SetDestCoreUnit( MapUnit eUnit )
{
- ePoolUnit = eUnit;
+ eDestPoolUnit = eUnit;
}
void SvxMetricField::RefreshDlgUnit()
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index fa67f56f7fb5..b0e6c81ff21e 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -223,10 +223,9 @@ void SvxLineWidthToolBoxControl::StateChanged(
{
DBG_ASSERT( dynamic_cast<const XLineWidthItem*>( pState) != nullptr, "wrong ItemType" );
- // Core-Unit handed over to MetricField
// Should not happen in CreateItemWin ()!
// CD!!! GetCoreMetric();
- pFld->SetCoreUnit( MapUnit::Map100thMM );
+ pFld->SetDestCoreUnit(GetCoreMetric());
pFld->Update( static_cast<const XLineWidthItem*>(pState) );
}
@@ -236,6 +235,13 @@ void SvxLineWidthToolBoxControl::StateChanged(
}
}
+MapUnit SvxLineWidthToolBoxControl::GetCoreMetric()
+{
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+ SfxItemPool& rPool = pSh ? pSh->GetPool() : SfxGetpApp()->GetPool();
+ sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_LINE_WIDTH);
+ return rPool.GetMetric(nWhich);
+}
VclPtr<vcl::Window> SvxLineWidthToolBoxControl::CreateItemWindow( vcl::Window *pParent )
{