From b1f308d96609bf6a6bd6b563dcbec246a6910b0f Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 19 Oct 2012 01:21:22 +0200 Subject: fdo#44657 Remove hack that "simulates" a mirrored horizontal scrollbar. We are able to paint mirrored scrolbars with the 'gen' plugin, so just fix the rendering of the scroolbar with the Gtk+ plugin. Change-Id: I5dbd13420c6290e165ed2f5827769979298abf37 (cherry picked from commit bfa21ce5fa08f2c634ccb6162914be55aef9f3c2) Signed-off-by: Lior Kaplan --- sc/source/ui/inc/tabview.hxx | 2 +- sc/source/ui/view/tabview.cxx | 27 ++++++--------------------- sc/source/ui/view/tabview4.cxx | 36 +++++++++++------------------------- 3 files changed, 18 insertions(+), 47 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 8879b07dbf43..e090e72c72db 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -195,7 +195,7 @@ private: void UpdateVarZoom(); static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, bool bLayoutRTL ); - static long GetScrollBarPos( ScrollBar& rScroll, bool bLayoutRTL ); + static long GetScrollBarPos( ScrollBar& rScroll ); void GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY); void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 0a3ab2863051..0231f81ef9c3 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -342,6 +342,8 @@ void ScTabView::InitScrollBar( ScrollBar& rScrollBar, long nMaxVal ) rScrollBar.SetScrollHdl( LINK(this, ScTabView, ScrollHdl) ); rScrollBar.SetEndScrollHdl( LINK(this, ScTabView, EndScrollHdl) ); + + rScrollBar.EnableRTL( aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ) ); } // Scroll-Timer @@ -1095,15 +1097,14 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll ) if ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight ) { - bool bMirror = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ) != Application::GetSettings().GetLayoutRTL(); ScHSplitPos eWhich = (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT; - long nDelta = GetScrollBarPos( *pScroll, bMirror ) + nScrollMin - aViewData.GetPosX(eWhich); + long nDelta = GetScrollBarPos( *pScroll ) + nScrollMin - aViewData.GetPosX(eWhich); if (nDelta) ScrollX( nDelta, eWhich ); } else // VScroll... { ScVSplitPos eWhich = (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM; - long nDelta = GetScrollBarPos( *pScroll, false ) + nScrollMin - aViewData.GetPosY(eWhich); + long nDelta = GetScrollBarPos( *pScroll ) + nScrollMin - aViewData.GetPosY(eWhich); if (nDelta) ScrollY( nDelta, eWhich ); } } @@ -1126,7 +1127,6 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) SC_SPLIT_TOP : SC_SPLIT_BOTTOM ); bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ); - bool bMirror = bHoriz && (bLayoutRTL != Application::GetSettings().GetLayoutRTL()); ScrollType eType = pScroll->GetType(); if ( eType == SCROLL_DRAG ) @@ -1164,7 +1164,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) nScrollMin = aViewData.GetFixPosX(); if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom ) nScrollMin = aViewData.GetFixPosY(); - long nScrollPos = GetScrollBarPos( *pScroll, bMirror ) + nScrollMin; + long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin; String aHelpStr; Rectangle aRect; @@ -1199,21 +1199,6 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) if ( bOnlineScroll || eType != SCROLL_DRAG ) { - if ( bMirror ) - { - // change scroll type so visible/previous cells calculation below remains the same - switch ( eType ) - { - case SCROLL_LINEUP: eType = SCROLL_LINEDOWN; break; - case SCROLL_LINEDOWN: eType = SCROLL_LINEUP; break; - case SCROLL_PAGEUP: eType = SCROLL_PAGEDOWN; break; - case SCROLL_PAGEDOWN: eType = SCROLL_PAGEUP; break; - default: - { - // added to avoid warnings - } - } - } long nDelta = pScroll->GetDelta(); switch ( eType ) { @@ -1248,7 +1233,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom ) nScrollMin = aViewData.GetFixPosY(); - long nScrollPos = GetScrollBarPos( *pScroll, bMirror ) + nScrollMin; + long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin; nDelta = nScrollPos - nViewPos; if ( nScrollPos > nPrevDragPos ) { diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index a00edef04513..064a6670d2ec 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -337,30 +337,16 @@ void ScTabView::SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, if ( nVisible == 0 ) nVisible = 1; // #i59893# don't use visible size 0 - // RTL layout uses a negative range to simulate a mirrored scroll bar. - // SetScrollBar/GetScrollBarPos hide this so outside of these functions normal cell - // addresses can be used. + rScroll.SetRange( Range( 0, nRangeMax ) ); + rScroll.SetVisibleSize( nVisible ); + rScroll.SetThumbPos( nPos ); - if ( bLayoutRTL ) - { - rScroll.SetRange( Range( -nRangeMax, 0 ) ); - rScroll.SetVisibleSize( nVisible ); - rScroll.SetThumbPos( -nPos - nVisible ); - } - else - { - rScroll.SetRange( Range( 0, nRangeMax ) ); - rScroll.SetVisibleSize( nVisible ); - rScroll.SetThumbPos( nPos ); - } + rScroll.EnableRTL( bLayoutRTL ); } -long ScTabView::GetScrollBarPos( ScrollBar& rScroll, bool bLayoutRTL ) +long ScTabView::GetScrollBarPos( ScrollBar& rScroll ) { - if ( bLayoutRTL ) - return -rScroll.GetThumbPos() - rScroll.GetVisibleSize(); - else - return rScroll.GetThumbPos(); + return rScroll.GetThumbPos(); } // UpdateScrollBars - sichtbaren Bereich und Scrollweite der Scrollbars einstellen @@ -400,7 +386,7 @@ void ScTabView::UpdateScrollBars() sal_Bool bRight = ( aViewData.GetHSplitMode() != SC_SPLIT_NONE ); ScDocument* pDoc = aViewData.GetDocument(); SCTAB nTab = aViewData.GetTabNo(); - sal_Bool bMirror = pDoc->IsLayoutRTL( nTab ) != Application::GetSettings().GetLayoutRTL(); + bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); SCCOL nUsedX; SCROW nUsedY; pDoc->GetTableArea( nTab, nUsedX, nUsedY ); //! cachen !!!!!!!!!!!!!!! @@ -419,24 +405,24 @@ void ScTabView::UpdateScrollBars() nVisXL = aViewData.VisibleCellsX( SC_SPLIT_LEFT ); long nMaxXL = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_LEFT), nVisXL, MAXCOL, 0 ); - SetScrollBar( aHScrollLeft, nMaxXL, nVisXL, aViewData.GetPosX( SC_SPLIT_LEFT ), bMirror ); + SetScrollBar( aHScrollLeft, nMaxXL, nVisXL, aViewData.GetPosX( SC_SPLIT_LEFT ), bLayoutRTL ); nVisYB = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM ); long nMaxYB = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_BOTTOM), nVisYB, MAXROW, nStartY ); - SetScrollBar( aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, false ); + SetScrollBar( aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, bLayoutRTL ); if (bRight) { nVisXR = aViewData.VisibleCellsX( SC_SPLIT_RIGHT ); long nMaxXR = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_RIGHT), nVisXR, MAXCOL, nStartX ); - SetScrollBar( aHScrollRight, nMaxXR, nVisXR, aViewData.GetPosX( SC_SPLIT_RIGHT ) - nStartX, bMirror ); + SetScrollBar( aHScrollRight, nMaxXR, nVisXR, aViewData.GetPosX( SC_SPLIT_RIGHT ) - nStartX, bLayoutRTL ); } if (bTop) { nVisYT = aViewData.VisibleCellsY( SC_SPLIT_TOP ); long nMaxYT = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_TOP), nVisYT, MAXROW, 0 ); - SetScrollBar( aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), false ); + SetScrollBar( aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), bLayoutRTL ); } // Bereich testen -- cgit 'feature/BorderlineFix'>feature/BorderlineFix LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini
2014-11-03crashrep: get rid of tmpnam()Norbert Thiebaud
2014-08-17remove executable bitsThomas Arnhold
2014-07-15crashrep: loplugin:unreffunMichael Stahl
2014-05-27Remove unnecessary semicolonsPeter Senna Tschudin
2014-05-15Resolves fdo#70681: fixincludeguards.pl: all that's leftThomas Arnhold
2014-02-25Remove visual noise from crashrepAlexander Wilms
2013-12-13Targetted text updates, with seasonable changes before l10n freeze.Michael Meeks
2013-11-20Windows: Require at least Windows XP SP2Thomas Arnhold
2013-11-07remove INPATH and PROEXTMichael Stahl
2013-11-04remove redundant calls to OUString constructorNoel Grandin
2013-10-29gbuild: stop using stuff in OUTDIR/unittest/installMichael Stahl
2013-10-03fix thinkoDavid Tardon
2013-08-18Use subfolder names from <config_folders.h>Tor Lillqvist
2013-07-16gbuild: consolidate ULF copypaste in gb_CustomTarget_ulfex_ruleMichael Stahl
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák
2013-03-27Remove unused macro "PMAP_CMD"Julien Nabet
2013-03-25Remove unneeded project and projectroot parametersZolnai Tamás
2013-03-19removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings declarationsThomas Arnhold
2013-03-19automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStringsThomas Arnhold
2013-03-14remove legacy build.pl prj/build.lst files.Michael Meeks
2013-03-09fdo#43460: use isEmpty()Thomas Arnhold
2013-03-02remove minor.mkMatúš Kukan
2013-02-28remove all d.lstMichael Stahl
2013-02-28bin PATCH_SO_NAME crackAndras Timar
2013-02-13fix translation of crash reporterDavid Tardon
2013-02-13let's split this for easier cherry-pickingDavid Tardon
2013-02-13fdo#60386 fix l10n of windows shell extensionDavid Tardon
2013-01-26gbuild: do not copy boost headers aroundMichael Stahl
2013-01-26crashrep: fix conditionals: it used to be built in non-pro tooMichael Stahl
2013-01-22convert crashrep to gbuild and add to tail_buildPeter Foley
2013-01-07fix misleading comment.Michael Meeks
2012-12-27Some cppcheck cleaningJulien Nabet
2012-11-28We only support MSVC 2008 (_MSC_VER 1500) or laterTor Lillqvist
2012-10-01translations is a source-only moduleAndras Timar
2012-10-01use "LibreOffice" as the default value of ProductKey for crashrepTakeshi Abe
2012-08-11Remove unused local varsJulien Nabet
2012-07-02Remove unused definesThomas Arnhold
2012-07-01Remove unused definesThomas Arnhold
2012-06-22cleanup malingering vendor name in disabled codeMichael Meeks
2012-06-21re-base on ALv2 code.Michael Meeks
2012-06-14re-base on ALv2 code.Michael Meeks
2012-04-29make gbuild the default assumption of build.plBjoern Michaelsen
2012-04-21make comment reflect realityCaolán McNamara
2012-04-21WaE: crashrep warnings fixedDavid Ostrovsky
2012-03-23.txt files don't need executable bitsMichael Stahl
2012-03-23replace OpenOffice.org to LibreOffice in registry keysAndras Timar
2012-03-21chmod -xTor Lillqvist
2012-02-08Added READMEs for modules which used to be in componentsJosh Heidenreich
2011-12-10enhance VersionInfo resource of Windows excutablesAndras Timar