sc/source/ui/view/output2.cxx | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-)
New commits: commit f08c1edc0a99e0c29fb1614162d3e88c5660e092 Author: Abdulaziz A Alayed <aala...@kacst.edu.sa> Date: Sun Jan 12 16:02:37 2014 +0300 fdo#32530 calc:alignment depend on 1st char direct depending on the first char text direction we'll use the appropriate text alignment as Mr:Eyal suggest. and what Mr:Eike have done before. Change-Id: I87ead619e9eb0c001e4bbd701cb97232fa1da854 diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 9c09b5c..911cc11 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1405,12 +1405,9 @@ bool beginsWithRTLCharacter(const OUString& rStr) right alignment is returned. */ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify eInHorJust, - bool bCellIsValue, const OUString& rText, - const ScPatternAttr& rPattern, const SfxItemSet* pCondSet, - const ScDocument* pDoc, SCTAB nTab ) + bool bCellIsValue, const OUString& rText) { SvxCellHorJustify eHorJustContext = eInHorJust; - bool bUseWritingDirection = false; if (eInHorJust == SVX_HOR_JUSTIFY_STANDARD) { // fdo#32530: Default alignment depends on value vs @@ -1419,23 +1416,6 @@ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify eInHorJust, eHorJustContext = bCellIsValue ? SVX_HOR_JUSTIFY_LEFT : SVX_HOR_JUSTIFY_RIGHT; else if (bCellIsValue) eHorJustContext = SVX_HOR_JUSTIFY_RIGHT; - else - bUseWritingDirection = true; - } - - if (bUseWritingDirection || - eInHorJust == SVX_HOR_JUSTIFY_BLOCK || eInHorJust == SVX_HOR_JUSTIFY_REPEAT) - { - sal_uInt16 nDirection = lcl_GetValue<SvxFrameDirectionItem, sal_uInt16>( rPattern, ATTR_WRITINGDIR, pCondSet); - if (nDirection == FRMDIR_HORI_LEFT_TOP || nDirection == FRMDIR_VERT_TOP_LEFT) - eHorJustContext = SVX_HOR_JUSTIFY_LEFT; - else if (nDirection == FRMDIR_ENVIRONMENT) - { - SAL_WARN_IF( !pDoc, "sc.ui", "getAlignmentFromContext - pDoc==NULL"); - eHorJustContext = (pDoc && pDoc->IsLayoutRTL(nTab)) ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT; - } - else - eHorJustContext = SVX_HOR_JUSTIFY_RIGHT; } return eHorJustContext; } @@ -1714,8 +1694,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) bCellIsValue = pFCell->IsRunning() || pFCell->IsValue(); } - eOutHorJust = getAlignmentFromContext( aVars.GetHorJust(), bCellIsValue, aVars.GetString(), - *pPattern, pCondSet, mpDoc, nTab); + eOutHorJust = getAlignmentFromContext( aVars.GetHorJust(), bCellIsValue, aVars.GetString()); bool bBreak = ( aVars.GetLineBreak() || aVars.GetHorJust() == SVX_HOR_JUSTIFY_BLOCK ); // #i111387# #o11817313# disable automatic line breaks only for "General" number format @@ -4644,7 +4623,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic) DrawEditParam aParam(pPattern, pCondSet, lcl_SafeIsValue(aCell)); aParam.meHorJustContext = getAlignmentFromContext( aParam.meHorJustAttr, - aParam.mbCellIsValue, aStr, *pPattern, pCondSet, mpDoc, nTab); + aParam.mbCellIsValue, aStr); aParam.meHorJustResult = (aParam.meHorJustAttr == SVX_HOR_JUSTIFY_BLOCK) ? SVX_HOR_JUSTIFY_BLOCK : aParam.meHorJustContext; aParam.mbPixelToLogic = bPixelToLogic; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits