Revert "Some SvxFontHeightItem clean-up"
This reverts commit d5f93eb47e
,
SvxFontHeightItem::SetProp was used to override "dummy" 100% nProp/ePropUnit
values that did not match the computed nHeight value with nProp/ePropUnit values
that are supposed to match the computed nHeight value. Yuck.
Change-Id: Ic12e824054b3c5da7aca766b9b3eb076d1837d9a
This commit is contained in:
@@ -723,12 +723,7 @@ SvxFontHeightItem::SvxFontHeightItem( const sal_uLong nSz,
|
|||||||
SetHeight( nSz,nPrp ); // calculate in percentage
|
SetHeight( nSz,nPrp ); // calculate in percentage
|
||||||
}
|
}
|
||||||
|
|
||||||
SvxFontHeightItem::SvxFontHeightItem(
|
|
||||||
sal_uInt16 wid, sal_uInt32 height, sal_uInt16 prop, SfxMapUnit propUnit):
|
|
||||||
SfxPoolItem(wid)
|
|
||||||
{
|
|
||||||
SetHeight(height, prop, propUnit);
|
|
||||||
}
|
|
||||||
|
|
||||||
SfxPoolItem* SvxFontHeightItem::Clone( SfxItemPool * ) const
|
SfxPoolItem* SvxFontHeightItem::Clone( SfxItemPool * ) const
|
||||||
{
|
{
|
||||||
@@ -776,8 +771,8 @@ SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm,
|
|||||||
if( FONTHEIGHT_UNIT_VERSION <= nVersion )
|
if( FONTHEIGHT_UNIT_VERSION <= nVersion )
|
||||||
rStrm.ReadUInt16( nPropUnit );
|
rStrm.ReadUInt16( nPropUnit );
|
||||||
|
|
||||||
SvxFontHeightItem* pItem = new SvxFontHeightItem(
|
SvxFontHeightItem* pItem = new SvxFontHeightItem( nsize, 100, Which() );
|
||||||
Which(), nsize, nprop, (SfxMapUnit)nPropUnit );
|
pItem->SetProp( nprop, (SfxMapUnit)nPropUnit );
|
||||||
return pItem;
|
return pItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -336,9 +336,8 @@ namespace frm
|
|||||||
).Height();
|
).Height();
|
||||||
}
|
}
|
||||||
|
|
||||||
SvxFontHeightItem* pNewItem = new SvxFontHeightItem(
|
SvxFontHeightItem* pNewItem = new SvxFontHeightItem( nHeight, 100, getWhich() );
|
||||||
getWhich(), nHeight, pFontHeightItem->GetProp(),
|
pNewItem->SetProp( pFontHeightItem->GetProp(), pFontHeightItem->GetPropUnit() );
|
||||||
pFontHeightItem->GetPropUnit() );
|
|
||||||
aState.setItem( pNewItem );
|
aState.setItem( pNewItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,9 +364,8 @@ namespace frm
|
|||||||
).Height();
|
).Height();
|
||||||
}
|
}
|
||||||
|
|
||||||
SvxFontHeightItem aNewItem(
|
SvxFontHeightItem aNewItem( nHeight, 100, getWhich() );
|
||||||
getWhich(), nHeight, pFontHeightItem->GetProp(),
|
aNewItem.SetProp( pFontHeightItem->GetProp(), pFontHeightItem->GetPropUnit() );
|
||||||
pFontHeightItem->GetPropUnit() );
|
|
||||||
|
|
||||||
if ( ( getAttributeId() == SID_ATTR_CHAR_FONTHEIGHT ) && _nForScriptType )
|
if ( ( getAttributeId() == SID_ATTR_CHAR_FONTHEIGHT ) && _nForScriptType )
|
||||||
putItemForScript( _rNewAttribs, aNewItem, _nForScriptType );
|
putItemForScript( _rNewAttribs, aNewItem, _nForScriptType );
|
||||||
|
@@ -47,10 +47,6 @@ public:
|
|||||||
SvxFontHeightItem( const sal_uLong nSz /*= 240*/, const sal_uInt16 nPropHeight /*= 100*/,
|
SvxFontHeightItem( const sal_uLong nSz /*= 240*/, const sal_uInt16 nPropHeight /*= 100*/,
|
||||||
const sal_uInt16 nId );
|
const sal_uInt16 nId );
|
||||||
|
|
||||||
SvxFontHeightItem(
|
|
||||||
sal_uInt16 wid, sal_uInt32 height, sal_uInt16 prop,
|
|
||||||
SfxMapUnit propUnit);
|
|
||||||
|
|
||||||
// "pure virtual Methods" from SfxPoolItem
|
// "pure virtual Methods" from SfxPoolItem
|
||||||
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
|
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
|
||||||
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
|
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
|
||||||
@@ -70,10 +66,8 @@ public:
|
|||||||
|
|
||||||
inline SvxFontHeightItem& operator=(const SvxFontHeightItem& rSize)
|
inline SvxFontHeightItem& operator=(const SvxFontHeightItem& rSize)
|
||||||
{
|
{
|
||||||
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
|
SetHeightValue( rSize.GetHeight() );
|
||||||
nHeight = rSize.nHeight;
|
SetProp( rSize.GetProp(), ePropUnit );
|
||||||
nProp = rSize.nProp;
|
|
||||||
ePropUnit = rSize.ePropUnit;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +79,20 @@ public:
|
|||||||
|
|
||||||
sal_uInt32 GetHeight() const { return nHeight; }
|
sal_uInt32 GetHeight() const { return nHeight; }
|
||||||
|
|
||||||
|
void SetHeightValue( sal_uInt32 nNewHeight )
|
||||||
|
{
|
||||||
|
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
|
||||||
|
nHeight = nNewHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetProp( const sal_uInt16 nNewProp,
|
||||||
|
SfxMapUnit eUnit = SFX_MAPUNIT_RELATIVE )
|
||||||
|
{
|
||||||
|
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
|
||||||
|
nProp = nNewProp;
|
||||||
|
ePropUnit = eUnit;
|
||||||
|
}
|
||||||
|
|
||||||
sal_uInt16 GetProp() const { return nProp; }
|
sal_uInt16 GetProp() const { return nProp; }
|
||||||
|
|
||||||
SfxMapUnit GetPropUnit() const { return ePropUnit; } // Percent, Twip, ...
|
SfxMapUnit GetPropUnit() const { return ePropUnit; } // Percent, Twip, ...
|
||||||
|
Reference in New Issue
Block a user