summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-22 10:18:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-01-22 15:27:21 +0100
commit41372210fbbc497eb6353c998fca0b5502b331d9 (patch)
tree9c26dd883003dc394873c8468e0511378f44bbdc /sfx2
parentb7ca9576c26ed258537134c0cf2944cfcfc65f2e (diff)
tdf#135590 MapUnit::Map100thMM fallback is inappropiate for writer
which uses MapUnit::Twip so directly after insert, envelope, ok the new document sidebar was using MapUnit::Map100thMM to lookup paper sizes instead of MapUnit::Twip giving inconsistent results against format, page Change-Id: I6a92fddedfe9fef8ad7532ad00b2b38b9741bb69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109782 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/ctrlitem.cxx29
1 files changed, 11 insertions, 18 deletions
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index 1b039e44ad9d..308706f95b8c 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -152,9 +152,7 @@ void SfxControllerItem::ClearCache()
pBindings->ClearCache_Impl( GetId() );
}
-
// replaces the successor in the list of bindings of the same id
-
SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLink )
{
SfxControllerItem* pOldLink = pNext;
@@ -164,37 +162,32 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLin
// changes the id of unbound functions (e.g. for sub-menu-ids)
-
void SfxControllerItem::SetId( sal_uInt16 nItemId )
{
DBG_ASSERT( !IsBound(), "changing id of bound binding" );
nId = nItemId;
}
-
// creates an atomic item for a controller without registration.
-
-SfxControllerItem::SfxControllerItem():
- nId(0),
- pNext(this),
- pBindings(nullptr)
+SfxControllerItem::SfxControllerItem()
+ : nId(0)
+ , pNext(this)
+ , pBindings(nullptr)
+ , eFallbackCoreMetric(MapUnit::Map100thMM)
{
}
-
// creates a representation of the function nId and registers it
-
-SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings &rBindings ):
- nId(nID),
- pNext(this),
- pBindings(&rBindings)
+SfxControllerItem::SfxControllerItem(sal_uInt16 nID, SfxBindings &rBindings)
+ : nId(nID)
+ , pNext(this)
+ , pBindings(&rBindings)
+ , eFallbackCoreMetric(MapUnit::Map100thMM)
{
Bind(nId, &rBindings);
}
-
// unregisters the item in the bindings
-
SfxControllerItem::~SfxControllerItem()
{
dispose();
@@ -345,7 +338,7 @@ MapUnit SfxControllerItem::GetCoreMetric() const
}
SAL_INFO( "sfx.control", "W1: Can not find ItemPool!" );
- return MapUnit::Map100thMM;
+ return eFallbackCoreMetric;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */