diff options
author | Faisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa> | 2013-03-17 10:03:06 +0300 |
---|---|---|
committer | Lior Kaplan <kaplanlior@gmail.com> | 2013-03-18 14:34:52 +0200 |
commit | 86a73eb47ea7239182dafaf827ad43e3b09dc20e (patch) | |
tree | c7d9ed3ca29f5ecd13d6f9c62fedbae5274347fe | |
parent | 6b4a1cd7e3cc476bcdc143ba3964c6211e007186 (diff) |
Fix fdo#37464 - Cell Border works backwards on Right-to-Left sheet
Change-Id: Idb73d3029880b66602f163b2ab03c2b37c2306db
Reviewed-on: https://gerrit.libreoffice.org/2782
Reviewed-by: Ahmad Harthi <aalharthi@kacst.edu.sa>
Tested-by: Ahmad Harthi <aalharthi@kacst.edu.sa>
(cherry picked from commit 84e4bf884718fcca8934b81b4037e063cf08c71e)
-rw-r--r-- | sc/source/core/data/attarray.cxx | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 8059b178790a..e7afd5d1ca95 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1134,13 +1134,38 @@ bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, nDistBottom = 0; SvxBoxItem aNewFrame( *pOldFrame ); - - if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) ) - aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), - BOX_LINE_LEFT ); - if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) ) - aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), - BOX_LINE_RIGHT ); + bool bRTL=pDocument->IsLayoutRTL(nTab); + // fdo#37464 check if the sheet are RTL then replace right <=> left + if (bRTL) + { + if( bLeft && nDistRight==0) + { + if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), + BOX_LINE_RIGHT ); + if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), + BOX_LINE_LEFT ); + } + else + { + if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), + BOX_LINE_RIGHT ); + if ( bLeft ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( bLeft ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), + BOX_LINE_LEFT ); + } + } + else + { + if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), + BOX_LINE_LEFT ); + if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) ) + aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), + BOX_LINE_RIGHT ); + } if ( bTop ? pBoxInfoItem->IsValid(VALID_TOP) : pBoxInfoItem->IsValid(VALID_HORI) ) aNewFrame.SetLine( bTop ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(), BOX_LINE_TOP ); |