summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorAbdulaziz A Alayed <aalayed@kacst.edu.sa>2014-01-12 16:02:37 +0300
committerAbdulaziz A Alayed <aalayed@kacst.edu.sa>2014-01-12 16:40:53 +0300
commitf08c1edc0a99e0c29fb1614162d3e88c5660e092 (patch)
tree19d901adbad78fa888fea2b755b2083e88b81e51 /sc
parent3709fe0e2e9336787f3d18b8ae4a1ff2ef5608e6 (diff)
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
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/output2.cxx27
1 files changed, 3 insertions, 24 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 9c09b5c9212b..911cc11a2671 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;