[Libreoffice-commits] .: 5 commits - sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Oct 13 05:41:03 PDT 2010


 sc/source/filter/excel/xeescher.cxx |    2 +-
 sc/source/ui/cctrl/dpcontrol.cxx    |   22 +++++++++++++++++++---
 sc/source/ui/inc/dpcontrol.hxx      |    4 +++-
 sc/source/ui/view/gridwin2.cxx      |   17 ++++++++++++++---
 sc/source/ui/view/gridwin4.cxx      |   13 +++++--------
 sc/source/ui/view/output2.cxx       |   22 +++++++---------------
 6 files changed, 49 insertions(+), 31 deletions(-)

New commits:
commit bd83ad4734389c86ae6ae8972d7ce050c169220e
Merge: 7eabce1... 92c2e0d...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Oct 13 11:30:54 2010 +0200

    Merge commit 'ooo/OOO330_m10'

commit 92c2e0db5c9d4d0a65048138c3a9fe59a47fa5de
Merge: d81eda1... 1fac384...
Author: obo <obo at openoffice.org>
Date:   Fri Oct 8 08:19:25 2010 +0200

    CWS-TOOLING: integrate CWS sw33bf10

commit d81eda10143c9444fea0f6042deff3f3b88bfd85
Merge: 3777925... 39a1290...
Author: obo <obo at openoffice.org>
Date:   Fri Oct 8 08:14:20 2010 +0200

    CWS-TOOLING: integrate CWS ooo33gsl10

commit 39a12901d9ced9b043e2a4103440405653db4d6b
Author: Niklas Nebel <nn at openoffice.org>
Date:   Wed Oct 6 17:08:15 2010 +0200

    ooo33gsl10: #i114944# handle AutoFilter button position on RTL sheets

diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 2b4cdd5..5bc12d7 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 f44155a..6cdcd6c 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 1105d9a..ef787e0 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 92ed90a..0c1dc2f 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 b717f7d..e26056b 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;
                                     }
commit 1fac3846804727924c30919bba18d04c40cc4fe2
Author: Daniel Rentz [dr] <daniel.rentz at oracle.com>
Date:   Wed Sep 29 13:31:35 2010 +0200

    sw33bf10: #i105461# write missing parts of OBJLBSDATA sub record

diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 3c771a2..a49ec43 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();


More information about the Libreoffice-commits mailing list