--- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1085,6 +1085,18 @@ } } pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); + + // Width auto-growth must retain the paragraph anchor when the + // shape shrinks. Block adjustment otherwise recenters uniformly + // left- or right-aligned text. Wrapped and centered frames keep + // their existing layout, as in ApplyTextAnchorAttributes. + if ( !bVerticalText && bAutoGrowWidth && eTHA == SDRTEXTHORZADJUST_BLOCK ) + { + if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT ) + eTHA = SDRTEXTHORZADJUST_LEFT; + else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT ) + eTHA = SDRTEXTHORZADJUST_RIGHT; + } //Autofit text only if there is no auto grow height and width //See fdo#41245