summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table2.cxx4
-rw-r--r--sc/source/filter/excel/xeescher.cxx2
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx22
-rw-r--r--sc/source/ui/inc/dpcontrol.hxx4
-rw-r--r--sc/source/ui/view/gridwin2.cxx17
-rw-r--r--sc/source/ui/view/gridwin4.cxx13
-rw-r--r--sc/source/ui/view/output2.cxx22
7 files changed, 52 insertions, 32 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4223c05c4f83..9bb22b68d2ad 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2255,7 +2255,9 @@ BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeig
{
if (pDrawLayer)
{
- unsigned long nOldHeights = GetRowHeight(nStartRow, nEndRow);
+ // #i115025# When comparing to nNewHeight for the whole range, the height
+ // including hidden rows has to be used (same behavior as 3.2).
+ unsigned long nOldHeights = mpRowHeights->getSumValue(nStartRow, nEndRow);
// FIXME: should we test for overflows?
long nHeightDif = (long) (unsigned long) nNewHeight *
(nEndRow - nStartRow + 1) - nOldHeights;
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 0509f2afa5fa..b2801df7f54a 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -841,7 +841,7 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm )
}
else if( mnObjType == EXC_OBJTYPE_DROPDOWN )
{
- rStrm << sal_uInt16( 0 ) << mnLineCount;
+ rStrm << sal_uInt16( 0 ) << mnLineCount << sal_uInt16( 0 ) << sal_uInt16( 0 );
}
rStrm.EndRecord();
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 82c276d98f2c..b90a51ed6bee 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -66,7 +66,8 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt
mbBaseButton(true),
mbPopupButton(false),
mbHasHiddenMember(false),
- mbPopupPressed(false)
+ mbPopupPressed(false),
+ mbPopupLeft(false)
{
if (pZoomX)
maZoomX = *pZoomX;
@@ -88,10 +89,15 @@ void ScDPFieldButton::setText(const OUString& rText)
maText = rText;
}
-void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize)
+void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL)
{
maPos = rPos;
maSize = rSize;
+ if (bLayoutRTL)
+ {
+ // rPos is the logical-left position, adjust maPos to visual-left (inside the cell border)
+ maPos.X() -= maSize.Width() - 1;
+ }
}
void ScDPFieldButton::setDrawBaseButton(bool b)
@@ -114,6 +120,11 @@ void ScDPFieldButton::setPopupPressed(bool b)
mbPopupPressed = b;
}
+void ScDPFieldButton::setPopupLeft(bool b)
+{
+ mbPopupLeft = b;
+}
+
void ScDPFieldButton::draw()
{
const long nMargin = 2;
@@ -179,7 +190,12 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const
if (nH > 18)
nH = 18;
- rPos.setX(maPos.getX() + maSize.getWidth() - nW);
+ // #i114944# AutoFilter button is left-aligned in RTL.
+ // DataPilot button is always right-aligned for now, so text output isn't affected.
+ if (mbPopupLeft)
+ rPos.setX(maPos.getX());
+ else
+ rPos.setX(maPos.getX() + maSize.getWidth() - nW);
rPos.setY(maPos.getY() + maSize.getHeight() - nH);
rSize.setWidth(nW);
rSize.setHeight(nH);
diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx
index 45badf0c88fd..25cb3e05acac 100644
--- a/sc/source/ui/inc/dpcontrol.hxx
+++ b/sc/source/ui/inc/dpcontrol.hxx
@@ -69,11 +69,12 @@ public:
~ScDPFieldButton();
void setText(const ::rtl::OUString& rText);
- void setBoundingBox(const Point& rPos, const Size& rSize);
+ void setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL);
void setDrawBaseButton(bool b);
void setDrawPopupButton(bool b);
void setHasHiddenMember(bool b);
void setPopupPressed(bool b);
+ void setPopupLeft(bool b);
void draw();
void getPopupBoundingBox(Point& rPos, Size& rSize) const;
@@ -94,6 +95,7 @@ private:
bool mbPopupButton;
bool mbHasHiddenMember;
bool mbPopupPressed;
+ bool mbPopupLeft;
};
// ============================================================================
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index ec584213898c..669f1fda010d 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -145,7 +145,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent&
// Check if the mouse cursor is clicking on the popup arrow box.
mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY(), pDoc));
- mpFilterButton->setBoundingBox(aScrPos, aScrSize);
+ mpFilterButton->setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ mpFilterButton->setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
Point aPopupPos;
Size aPopupSize;
mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -371,6 +372,8 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove )
bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj)
{
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
// Get the geometry of the cell.
Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich);
long nSizeX, nSizeY;
@@ -379,7 +382,8 @@ bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddres
// Check if the mouse cursor is clicking on the popup arrow box.
ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings());
- aBtn.setBoundingBox(aScrPos, aScrSize);
+ aBtn.setBoundingBox(aScrPos, aScrSize, bLayoutRTL);
+ aBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
Point aPopupPos;
Size aPopupSize;
aBtn.getPopupBoundingBox(aPopupPos, aPopupSize);
@@ -520,9 +524,16 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
}
}
+ BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+
Rectangle aCellRect(rScrPos, rScrSize);
const Size& rPopupSize = mpDPFieldPopup->getWindowSize();
- if (rScrSize.getWidth() > rPopupSize.getWidth())
+ if (bLayoutRTL)
+ {
+ // RTL: rScrPos is logical-left (visual right) position, always right-align with that
+ aCellRect.SetPos(Point(rScrPos.X() - rPopupSize.Width() + 1, rScrPos.Y()));
+ }
+ else if (rScrSize.getWidth() > rPopupSize.getWidth())
{
// If the cell width is larger than the popup window width, launch it
// right-aligned with the cell.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index ba73fbf00269..372dcc582a45 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1291,7 +1291,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
- aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL
aCellBtn.setDrawBaseButton(false);
aCellBtn.setDrawPopupButton(true);
aCellBtn.setHasHiddenMember(bArrowState);
@@ -1315,17 +1316,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
long nPosX = aScrPos.X();
long nPosY = aScrPos.Y();
- if ( bLayoutRTL )
- {
- // overwrite the right, not left (visually) grid as long as the
- // left/right colors of the button borders aren't mirrored.
- nPosX -= nSizeX - 2;
- }
+ // bLayoutRTL is handled in setBoundingBox
String aStr;
pDoc->GetString(nCol, nRow, nTab, aStr);
aCellBtn.setText(aStr);
- aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1));
+ aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL);
+ aCellBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
aCellBtn.setDrawBaseButton(true);
aCellBtn.setDrawPopupButton(pInfo->bPopupButton);
aCellBtn.setHasHiddenMember(pInfo->bFilterActive);
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6d40d304fb13..61289cc7f931 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -80,7 +80,7 @@
#include <math.h>
//! Autofilter-Breite mit column.cxx zusammenfassen
-#define DROPDOWN_BITMAP_SIZE 17
+#define DROPDOWN_BITMAP_SIZE 18
#define DRAWTEXT_MAX 32767
@@ -1274,7 +1274,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
( static_cast<const ScMergeFlagAttr&>(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue() & SC_MF_AUTO ) &&
( !bBreak || pRefDevice == pFmtDevice ) )
{
- long nFilter = Min( nMergeSizeY, (long) DROPDOWN_BITMAP_SIZE );
+ // filter drop-down width is now independent from row height
+ const long nFilter = DROPDOWN_BITMAP_SIZE;
BOOL bFit = ( nNeeded + nFilter <= nMergeSizeX );
if ( bFit || bCellIsValue )
{
@@ -3516,20 +3517,11 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
eOrient!=SVX_ORIENTATION_STACKED &&
pInfo && pInfo->bAutoFilter)
{
- if (pRowInfo[nArrY].nHeight < DROPDOWN_BITMAP_SIZE)
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,pRowInfo[nArrY].nHeight)).Height();
- else
- nAvailWidth -= pRowInfo[nArrY].nHeight;
- }
+ // filter drop-down width is now independent from row height
+ if (bPixelToLogic)
+ nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
else
- {
- if (bPixelToLogic)
- nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height();
- else
- nAvailWidth -= DROPDOWN_BITMAP_SIZE;
- }
+ nAvailWidth -= DROPDOWN_BITMAP_SIZE;
long nComp = nEngineWidth;
if (nAvailWidth<nComp) nAvailWidth=nComp;
}