summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2013-03-04 16:56:53 +0100
committerPetr Mladek <pmladek@suse.cz>2013-03-04 16:56:53 +0100
commit08e4a33966786b29550406fbd20ec8bb4f04d5b4 (patch)
tree1b184355689670680ac48eeefb4144babc76bea9 /sc
parentbafef6a9e36380c7c75169e600632914fe099453 (diff)
parent5b932053079c0ed73ea23fd802d5f2f7c291ec25 (diff)
Merge tag 'libreoffice-3.6.5.2' into suse-3.6
Tag libreoffice-3.6.5.2 Conflicts: editeng/source/editeng/impedit3.cxx instsetoo_native/util/openoffice.lst oovbaapi/UnoApi_oovbaapi.mk sc/source/filter/oox/workbookhelper.cxx sc/source/ui/app/scmod.cxx sc/source/ui/cctrl/checklistmenu.cxx solenv/inc/minor.mk writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/DomainMapper_Impl.hxx writerfilter/source/dmapper/PropertyMap.cxx Change-Id: I7ea70b82b3b874cbe78354d5dd97307e63842e72
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/xmlwrap.hxx2
-rw-r--r--sc/source/core/data/conditio.cxx11
-rw-r--r--sc/source/core/data/dpcache.cxx6
-rw-r--r--sc/source/filter/excel/xestyle.cxx8
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx13
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx14
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx20
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx3
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx3
-rw-r--r--sc/source/ui/inc/tabview.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx3
-rw-r--r--sc/source/ui/view/tabview.cxx27
-rw-r--r--sc/source/ui/view/tabview4.cxx36
14 files changed, 75 insertions, 75 deletions
diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx
index b045c753e4c0..89aa051b9e4b 100644
--- a/sc/inc/xmlwrap.hxx
+++ b/sc/inc/xmlwrap.hxx
@@ -71,7 +71,7 @@ class ScXMLImportWrapper
com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xWriter,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aDescriptor,
const rtl::OUString& sName, const rtl::OUString& sMediaType, const rtl::OUString& sComponentName,
- const sal_Bool bPlainText, com::sun::star::uno::Sequence<com::sun::star::uno::Any>& aArgs,
+ com::sun::star::uno::Sequence<com::sun::star::uno::Any>& aArgs,
ScMySharedData*& pSharedData);
public:
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index d0c40e930247..1a056eabf2b2 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1520,7 +1520,10 @@ bool lcl_CutRange( ScRange& rRange, const ScRange& rOther )
void ScConditionalFormat::DoRepaint( const ScRange* pModified )
{
if(pModified)
- pDoc->RepaintRange(*pModified);
+ {
+ if(maRanges.Intersects(*pModified))
+ pDoc->RepaintRange(*pModified);
+ }
else
{
// all conditional format cells
@@ -1547,7 +1550,11 @@ void ScConditionalFormat::CompileXML()
void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
{
- maRanges.UpdateReference( eUpdateRefMode, pDoc, rRange, nDx, nDy, nDz );
+ if( eUpdateRefMode == URM_COPY && nDz != 0 )
+ maRanges.UpdateReference( URM_MOVE, pDoc, rRange, nDx, nDy, nDz );
+ else
+ maRanges.UpdateReference( eUpdateRefMode, pDoc, rRange, nDx, nDy, nDz );
+
for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
}
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 7f6435587e29..7fdf098d7c63 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -761,11 +761,11 @@ void ScDPCache::PostInit()
maEmptyRows.build_tree();
typedef mdds::flat_segment_tree<SCROW, bool>::const_reverse_iterator itr_type;
- itr_type it = maEmptyRows.rbegin(), itEnd = maEmptyRows.rend();
- OSL_ENSURE(it != itEnd, "corrupt flat_segment_tree instance!");
+ itr_type it = maEmptyRows.rbegin();
+ OSL_ENSURE(it != maEmptyRows.rend(), "corrupt flat_segment_tree instance!");
mnDataSize = maFields[0].maData.size();
++it; // Skip the first position.
- OSL_ENSURE(it != itEnd, "buggy version of flat_segment_tree is used.");
+ OSL_ENSURE(it != maEmptyRows.rend(), "buggy version of flat_segment_tree is used.");
if (it->second)
{
SCROW nLastNonEmpty = it->first - 1;
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 8426a53d0812..83f2650306e1 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2025,7 +2025,6 @@ void XclExpXF::Init( const SfxItemSet& rItemSet, sal_Int16 nScript,
GETITEMVALUE( rItemSet, SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) : nForceScNumFmt;
mnXclNumFmt = GetNumFmtBuffer().Insert( mnScNumFmt );
mbFmtUsed = ScfTools::CheckItem( rItemSet, ATTR_VALUE_FORMAT, IsStyleXF() );
-
// alignment
mbAlignUsed = maAlignment.FillFromItemSet( rItemSet, bForceLineBreak, GetBiff(), IsStyleXF() );
@@ -2112,10 +2111,12 @@ void XclExpXF::SaveXml( XclExpXmlStream& rStrm )
sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
sal_Int32 nXfId = 0;
+ const XclExpXF* pStyleXF = NULL;
if( IsCellXF() )
{
sal_uInt16 nXFIndex = rStrm.GetRoot().GetXFBuffer().GetXFIndex( mnParentXFId );
nXfId = rStrm.GetRoot().GetXFBuffer().GetXmlStyleIndex( nXFIndex );
+ pStyleXF = rStrm.GetRoot().GetXFBuffer().GetXFById( mnParentXFId );
}
rStyleSheet->startElement( XML_xf,
@@ -2135,8 +2136,13 @@ void XclExpXF::SaveXml( XclExpXmlStream& rStrm )
FSEND );
if( mbAlignUsed )
maAlignment.SaveXml( rStrm );
+ else if ( pStyleXF )
+ pStyleXF->GetAlignmentData().SaveXml( rStrm );
if( mbProtUsed )
maProtection.SaveXml( rStrm );
+ else if ( pStyleXF )
+ pStyleXF->GetProtectionData().SaveXml( rStrm );
+
// OOXTODO: XML_extLst
rStyleSheet->endElement( XML_xf );
}
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index dce942c04dae..a8d37a7c5f2d 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -591,11 +591,6 @@ void WorkbookGlobals::finalize()
// #i79826# enable updating automatic row height after loading the document
aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true );
- // Insert all pivot tables. Must be done after loading all sheets and
- // formulas, because data pilots expect existing source data on
- // creation.
- getPivotTables().finalizeImport();
-
// #i76026# enable Undo after loading the document
aPropSet.setProperty( PROP_IsUndoEnabled, true );
// disable editing read-only documents (e.g. from read-only files)
@@ -664,6 +659,14 @@ void WorkbookHelper::finalizeWorkbookImport()
// need to import formulas before scenarios
mrBookGlob.getFormulaBuffer().finalizeImport();
+
+ // Insert all pivot tables. Must be done after loading all sheets and
+ // formulas, because data pilots expect existing source data on
+ // creation.
+ getPivotTables().finalizeImport();
+
+ // need to import formulas before scenarios
+ mrBookGlob.getFormulaBuffer().finalizeImport();
/* Insert scenarios after all sheet processing is done, because new hidden
sheets are created for scenarios which would confuse code that relies
on certain sheet indexes. Must be done after pivot tables too. */
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 910c4ee99f60..050dbdc54d00 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -632,7 +632,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
uno::Reference<frame::XModel>& xModel, uno::Reference<uno::XInterface>& xWriter,
uno::Sequence<beans::PropertyValue>& aDescriptor, const rtl::OUString& sName,
const rtl::OUString& sMediaType, const rtl::OUString& sComponentName,
- const sal_Bool bPlainText, uno::Sequence<uno::Any>& aArgs, ScMySharedData*& pSharedData)
+ uno::Sequence<uno::Any>& aArgs, ScMySharedData*& pSharedData)
{
sal_Bool bRet(false);
uno::Reference<io::XOutputStream> xOut;
@@ -653,10 +653,8 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
{
xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny(sMediaType));
OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") );
- if (bPlainText)
- xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), uno::makeAny(false));
- // even plain stream should be encrypted in encrypted documents
+ // advise storage impl to use common encryption
xSet->setPropertyValue( aUseCommonPassPropName, uno::makeAny(sal_True) );
}
@@ -858,7 +856,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaExporter")),
- sal_True, aMetaArgs, pSharedData);
+ aMetaArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta export end" );
}
@@ -899,7 +897,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisStylesExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLStylesExporter")),
- false, aStylesArgs, pSharedData);
+ aStylesArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "styles export end" );
}
@@ -923,7 +921,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisContentExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLContentExporter")),
- false, aDocArgs, pSharedData);
+ aDocArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "content export end" );
}
@@ -951,7 +949,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sTextMediaType,
bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisSettingsExporter"))
: rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLSettingsExporter")),
- false, aSettingsArgs, pSharedData);
+ aSettingsArgs, pSharedData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "settings export end" );
}
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 0408458f9704..cf29eaecce39 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -55,6 +55,8 @@ using namespace ::com::sun::star::accessibility;
//===== internal ============================================================
+// FIXME: really unclear why we have an ScAccessibleTableBase with
+// only this single sub-class
ScAccessibleSpreadsheet::ScAccessibleSpreadsheet(
ScAccessibleDocument* pAccDoc,
ScTabViewShell* pViewShell,
diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
index c1408dbd005d..82203391f674 100644
--- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx
@@ -272,7 +272,7 @@ sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 /* nRow
return false;
}
- //===== XAccessibleExtendedTable ========================================
+// ===== XAccessibleExtendedTable ========================================
sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
@@ -315,7 +315,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumn( sal_Int32 nChildI
return nChildIndex % static_cast<sal_Int32>(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
}
- //===== XAccessibleContext ==============================================
+// ===== XAccessibleContext ==============================================
sal_Int32 SAL_CALL
ScAccessibleTableBase::getAccessibleChildCount(void)
@@ -323,9 +323,16 @@ sal_Int32 SAL_CALL
{
SolarMutexGuard aGuard;
IsObjectValid();
- return static_cast<sal_Int32>(maRange.aEnd.Row() - maRange.aStart.Row() + 1) *
- (maRange.aEnd.Col() - maRange.aStart.Col() + 1);
-// return 1;
+
+ // FIXME: representing rows & columns this way is a plain and simple madness.
+ // this needs a radical re-think.
+ sal_Int64 nMax = ((sal_Int64)(maRange.aEnd.Row() - maRange.aStart.Row() + 1) *
+ (sal_Int64)(maRange.aEnd.Col() - maRange.aStart.Col() + 1));
+ if (nMax > SAL_MAX_INT32)
+ nMax = SAL_MAX_INT32;
+ if (nMax < 0)
+ return 0;
+ return static_cast<sal_Int32>(nMax);
}
uno::Reference< XAccessible > SAL_CALL
@@ -339,6 +346,9 @@ uno::Reference< XAccessible > SAL_CALL
if (nIndex >= getAccessibleChildCount() || nIndex < 0)
throw lang::IndexOutOfBoundsException();
+ // FIXME: representing rows & columns this way is a plain and simple madness.
+ // this needs a radical re-think.
+
sal_Int32 nRow(0);
sal_Int32 nColumn(0);
sal_Int32 nTemp(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index d7f87f160fd9..2b9a25f26d7f 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -915,6 +915,9 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(Window* pParent, ScDocument* pDoc)
maTabStopCtrls.push_back(&maBtnUnselectSingle);
maTabStopCtrls.push_back(&maBtnOk);
maTabStopCtrls.push_back(&maBtnCancel);
+
+ // Enable type-ahead search in the check list box.
+ maChecks.SetStyle(maChecks.GetStyle() | WB_QUICK_SEARCH);
}
ScCheckListMenuWindow::~ScCheckListMenuWindow()
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index e424763326d6..9fea320c87f6 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1330,6 +1330,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
if ( pDestObj )
{
pDestObj->ReloadGroupTableData();
+ pDestObj->SyncAllDimensionMembers();
pDestObj->InvalidateData(); // before getting the new output area
// make sure the table has a name (not set by dialog)
@@ -1472,8 +1473,6 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi)
for (; it != itEnd; ++it)
{
ScDPObject* pObj = *it;
- if (!pObj->SyncAllDimensionMembers())
- continue;
// This action is intentionally not undoable since it modifies cache.
DataPilotUpdate(pObj, pObj, false, bApi);
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 2288480f4075..3b3e49055489 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/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b71841798bbe..68ad24cc5a70 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1074,7 +1074,8 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
pFilterFloat->SetPopupModeEndHdl( LINK( this, ScGridWindow, PopupModeEndHdl ) );
pFilterBox = new ScFilterListBox(
pFilterFloat, this, nCol, nRow, bDataSelect ? SC_FILTERBOX_DATASELECT : SC_FILTERBOX_FILTER );
- if ( bLayoutRTL )
+ // Fix for bug fdo#44925
+ if (Application::GetSettings().GetLayoutRTL() != bLayoutRTL)
pFilterBox->EnableMirroring();
nSizeX += 1;
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