Kaydet (Commit) af169a60 authored tarafından abdulmajeed ahmed's avatar abdulmajeed ahmed

Fix fdo#51835 Indent changes in Calc forces alignment to left

Change-Id: Ifef68cdd62a11b5cdc032a91a7dd96fa0357a42c
üst c2530b02
...@@ -1653,7 +1653,8 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement ...@@ -1653,7 +1653,8 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem ) != SFX_ITEM_SET bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem ) != SFX_ITEM_SET
|| ((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_LEFT ); || (((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_LEFT &&
((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_RIGHT ));
sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue(); sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue();
sal_uInt16 nNewValue = nOldValue; sal_uInt16 nNewValue = nOldValue;
if ( bIncrement ) if ( bIncrement )
......
...@@ -148,7 +148,8 @@ public: ...@@ -148,7 +148,8 @@ public:
SvxCellJustifyMethod GetVerJustMethod() const { return eAttrVerJustMethod; } SvxCellJustifyMethod GetVerJustMethod() const { return eAttrVerJustMethod; }
const SvxMarginItem* GetMargin() const { return pMargin; } const SvxMarginItem* GetMargin() const { return pMargin; }
sal_uInt16 GetLeftTotal() const { return pMargin->GetLeftMargin() + nIndent; } sal_uInt16 GetLeftTotal() const { return pMargin->GetLeftMargin() + nIndent; }
sal_uInt16 GetRightTotal() const { return pMargin->GetRightMargin() + nIndent; }
const String& GetString() const { return aString; } const String& GetString() const { return aString; }
const Size& GetTextSize() const { return aTextSize; } const Size& GetTextSize() const { return aTextSize; }
...@@ -422,7 +423,7 @@ void ScDrawStringsVars::SetPattern( ...@@ -422,7 +423,7 @@ void ScDrawStringsVars::SetPattern(
// Raender // Raender
pMargin = (const SvxMarginItem*)&pPattern->GetItem( ATTR_MARGIN, pCondSet ); pMargin = (const SvxMarginItem*)&pPattern->GetItem( ATTR_MARGIN, pCondSet );
if ( eAttrHorJust == SVX_HOR_JUSTIFY_LEFT ) if ( eAttrHorJust == SVX_HOR_JUSTIFY_LEFT || eAttrHorJust == SVX_HOR_JUSTIFY_RIGHT )
nIndent = ((const SfxUInt16Item&)pPattern->GetItem( ATTR_INDENT, pCondSet )).GetValue(); nIndent = ((const SfxUInt16Item&)pPattern->GetItem( ATTR_INDENT, pCondSet )).GetValue();
else else
nIndent = 0; nIndent = 0;
...@@ -1863,7 +1864,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) ...@@ -1863,7 +1864,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
break; break;
case SVX_HOR_JUSTIFY_RIGHT: case SVX_HOR_JUSTIFY_RIGHT:
nJustPosX += nAvailWidth - aVars.GetTextSize().Width() - nJustPosX += nAvailWidth - aVars.GetTextSize().Width() -
(long) ( aVars.GetMargin()->GetRightMargin() * mnPPTX ); (long) ( aVars.GetRightTotal() * mnPPTX );
bRightAdjusted = sal_True; bRightAdjusted = sal_True;
break; break;
case SVX_HOR_JUSTIFY_CENTER: case SVX_HOR_JUSTIFY_CENTER:
...@@ -2376,13 +2377,18 @@ void ScOutputData::DrawEditParam::calcMargins(long& rTopM, long& rLeftM, long& r ...@@ -2376,13 +2377,18 @@ void ScOutputData::DrawEditParam::calcMargins(long& rTopM, long& rLeftM, long& r
static_cast<const SvxMarginItem&>(mpPattern->GetItem(ATTR_MARGIN, mpCondSet)); static_cast<const SvxMarginItem&>(mpPattern->GetItem(ATTR_MARGIN, mpCondSet));
sal_uInt16 nIndent = 0; sal_uInt16 nIndent = 0;
if (meHorJust == SVX_HOR_JUSTIFY_LEFT) if (meHorJust == SVX_HOR_JUSTIFY_LEFT || meHorJust == SVX_HOR_JUSTIFY_RIGHT)
nIndent = lcl_GetValue<SfxUInt16Item, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet); nIndent = lcl_GetValue<SfxUInt16Item, sal_uInt16>(*mpPattern, ATTR_INDENT, mpCondSet);
rLeftM = static_cast<long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX)); rLeftM = static_cast<long>(((rMargin.GetLeftMargin() + nIndent) * nPPTX));
rTopM = static_cast<long>((rMargin.GetTopMargin() * nPPTY)); rTopM = static_cast<long>((rMargin.GetTopMargin() * nPPTY));
rRightM = static_cast<long>((rMargin.GetRightMargin() * nPPTX)); rRightM = static_cast<long>((rMargin.GetRightMargin() * nPPTX));
rBottomM = static_cast<long>((rMargin.GetBottomMargin() * nPPTY)); rBottomM = static_cast<long>((rMargin.GetBottomMargin() * nPPTY));
if(meHorJust == SVX_HOR_JUSTIFY_RIGHT)
{
rLeftM = static_cast<long>((rMargin.GetLeftMargin() * nPPTX));
rRightM = static_cast<long>(((rMargin.GetRightMargin() + nIndent) * nPPTX));
}
} }
void ScOutputData::DrawEditParam::calcPaperSize( void ScOutputData::DrawEditParam::calcPaperSize(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment