View | Details | Raw Unified | Return to issue 117713
Collapse All | Expand All

(-)a/sfx2/source/appl/module.cxx (-16 / +3 lines)
Lines 441-460 Link Here
441
    // find the module
441
    // find the module
442
    SfxModule const * pModule = GetActiveModule( pViewFrame );
442
    SfxModule const * pModule = GetActiveModule( pViewFrame );
443
    ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM );
443
    ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM );
444
444
	if ( pModule )
445
    SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC );
445
		return pModule->GetFieldUnit();
446
    if ( pItem == NULL )
446
	return FUNIT_INCH;
447
    {
448
#if OSL_DEBUG_LEVEL > 0
449
        ::rtl::OStringBuffer message;
450
        message.append( "SfxModule::GetFieldUnit: no metric item in the module implemented by '" );
451
        message.append( typeid( *pModule ).name() );
452
        message.append( "'!" );
453
        OSL_ENSURE( false, message.makeStringAndClear().getStr() );
454
#endif
455
        return FUNIT_100TH_MM;
456
    }
457
    return (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
458
}
447
}
459
448
460
FieldUnit SfxModule::GetCurrentFieldUnit()
449
FieldUnit SfxModule::GetCurrentFieldUnit()
Lines 464-470 Link Here
464
	if ( pModule )
453
	if ( pModule )
465
	{
454
	{
466
		const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
455
		const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
467
		DBG_ASSERT( pItem, "GetFieldUnit(): no item" );
468
		if ( pItem )
456
		if ( pItem )
469
			eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
457
			eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
470
	}
458
	}
Lines 477-483 Link Here
477
{
465
{
478
	FieldUnit eUnit = FUNIT_INCH;
466
	FieldUnit eUnit = FUNIT_INCH;
479
	const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
467
	const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
480
	DBG_ASSERT( pItem, "GetFieldUnit(): no item" );
481
	if ( pItem )
468
	if ( pItem )
482
		eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
469
		eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
483
	return eUnit;
470
	return eUnit;
(-)a/svx/source/dialog/dlgutil.cxx (-1 lines)
Lines 46-52 Link Here
46
		eUnit = (FieldUnit)( (const SfxUInt16Item*)pItem )->GetValue();
46
		eUnit = (FieldUnit)( (const SfxUInt16Item*)pItem )->GetValue();
47
	else 
47
	else 
48
	{
48
	{
49
		DBG_ERROR("Using fallback for field unit - field unit should be provided in ItemSet");
50
		return SfxModule::GetCurrentFieldUnit();
49
		return SfxModule::GetCurrentFieldUnit();
51
	}
50
	}
52
51

Return to issue 117713