diff options
author | Petr Mladek <pmladek@suse.cz> | 2013-05-01 13:05:06 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-05-01 13:05:06 +0200 |
commit | 93e11e4fb697aaea63c99308f980e4c932bd1efa (patch) | |
tree | 1892e49932d8d7b7656ae504113a40e4e39f876f /sc | |
parent | a5b6a379a2d628040db98060c2adfe8f2fac5607 (diff) | |
parent | c6786add5a58268e11aa027c47054344040db1bc (diff) |
Merge tag 'libreoffice-4.0.3.2' into suse-4.0
Tag libreoffice-4.0.3.2
Conflicts:
basic/qa/cppunit/test_vba.cxx
basic/source/runtime/step2.cxx
dictionaries
helpcontent2
instsetoo_native/util/openoffice.lst
libvisio/UnpackedTarball_visio.mk
sc/source/ui/vba/vbaapplication.cxx
sc/source/ui/vba/vbavalidation.cxx
solenv/inc/minor.mk
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
translations
Change-Id: Ic1f06489175f3db92d6bbcebb9732fadc1c61fed
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 39 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/conditio.cxx | 21 | ||||
-rw-r--r-- | sc/source/core/data/dpoutput.cxx | 73 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 21 | ||||
-rw-r--r-- | sc/source/core/tool/addincol.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 14 | ||||
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx | 91 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.src | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaapplication.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/vba/vbavalidation.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 77 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 19 |
19 files changed, 333 insertions, 90 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 ); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 2bdb401c45b7..c782f89ed53b 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1347,7 +1347,7 @@ SCROW ScColumn::FindNextVisibleRowWithContent(SCROW nRow, bool bForward) const bool bThere = Search( nRow, nIndex ); if( bThere && !maItems[nIndex].pCell->IsBlank()) return nRow; - else if(nIndex >= maItems.size()) + else if((bThere ? nIndex+1 : nIndex) >= maItems.size()) return MAXROW; else { diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index a6ba7363048d..d37891adb483 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -526,6 +526,15 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, { bool bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz >= 1 ); bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz <= -1 ); + if(pCondFormat) + aSrcPos = pCondFormat->GetRange().Combine().aStart; + ScAddress aOldSrcPos = aSrcPos; + bool bChangedPos = false; + if(eUpdateRefMode == URM_INSDEL && rRange.In(aSrcPos)) + { + aSrcPos.Move(nDx, nDy, nDz); + bChangedPos = aSrcPos != aOldSrcPos; + } bool bChanged1 = false; bool bChanged2 = false; @@ -533,7 +542,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, if (pFormula1) { if ( bInsertTab ) - lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged1, nDz ); + lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), aOldSrcPos.Tab(), bChanged1, nDz ); else { ScCompiler aComp( mpDoc, aSrcPos, *pFormula1 ); @@ -543,18 +552,18 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, else { bool bSizeChanged; - aComp.UpdateReference( eUpdateRefMode, aSrcPos, rRange, nDx, + aComp.UpdateReference( eUpdateRefMode, aOldSrcPos, rRange, nDx, nDy, nDz, bChanged1, bSizeChanged ); } } - if (bChanged1) + if (bChanged1 || bChangedPos) DELETEZ(pFCell1); // is created again in IsValid } if (pFormula2) { if ( bInsertTab ) - lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged2, nDz ); + lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), aOldSrcPos.Tab(), bChanged2, nDz ); else { ScCompiler aComp( mpDoc, aSrcPos, *pFormula2); @@ -564,12 +573,12 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode, else { bool bSizeChanged; - aComp.UpdateReference( eUpdateRefMode, aSrcPos, rRange, nDx, + aComp.UpdateReference( eUpdateRefMode, aOldSrcPos, rRange, nDx, nDy, nDz, bChanged2, bSizeChanged ); } } - if (bChanged2) + if (bChanged2 || bChangedPos) DELETEZ(pFCell2); // is created again in IsValid } } diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index be2518c0fae1..72fe4ded9503 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1292,6 +1292,23 @@ void lcl_GetTableVars( sal_Int32& rGrandTotalCols, sal_Int32& rGrandTotalRows, s rtl::OUString aSourceName; rtl::OUString aGivenName; ScDPOutput::GetDataDimensionNames( aSourceName, aGivenName, xDim ); + try + { + uno::Any aValue = xDimProp->getPropertyValue( + rtl::OUString::createFromAscii(SC_UNO_DP_LAYOUTNAME) ); + + if( aValue.hasValue() ) + { + OUString strLayoutName; + + if( aValue >>= strLayoutName ) + if ( strLayoutName.getLength() > 0 ) + aGivenName = strLayoutName; + } + } + catch(uno::Exception&) + { + } rDataNames.push_back( aSourceName ); rGivenNames.push_back( aGivenName ); @@ -1690,11 +1707,19 @@ void lcl_FilterInclude( std::vector<bool>& rResult, std::vector< sal_Int32 >& rS { // grand total is always automatic sal_Int32 nDataPos = j - ( nSize - nGrandTotals ); - OSL_ENSURE( nDataPos < (sal_Int32)rDataNames.size(), "wrong data count" ); - rtl::OUString aSourceName( rDataNames[nDataPos] ); // vector contains source names - rtl::OUString aGivenName( rGivenNames[nDataPos] ); + if (nDataPos >= 0 && nDataPos < (sal_Int32)rDataNames.size() && + nDataPos < (sal_Int32)rGivenNames.size()) + { + OUString aSourceName( rDataNames[nDataPos] ); // vector contains source names + OUString aGivenName( rGivenNames[nDataPos] ); - rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ); + rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ); + } + else + { + OSL_FAIL( "wrong data count for grand total" ); + rResult[j] = false; + } } } @@ -1730,27 +1755,49 @@ void lcl_FilterInclude( std::vector<bool>& rResult, std::vector< sal_Int32 >& rS rtl::OUString aSourceName( rDataNames[nDataPos] ); // vector contains source names rtl::OUString aGivenName( rGivenNames[nDataPos] ); - OSL_ENSURE( nFuncPos < aSubTotals.getLength(), "wrong subtotal count" ); - rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ) && + if (nFuncPos < aSubTotals.getLength()) + { + rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ) && aSubTotals[nFuncPos] == aFilter.meFunction; + } + else + { + OSL_FAIL( "wrong subtotal count for manual subtotals and several data fields" ); + rResult[j] = false; + } } else { // manual subtotals for a single data field - OSL_ENSURE( nSubTotalCount < aSubTotals.getLength(), "wrong subtotal count" ); - rResult[j] = ( aSubTotals[nSubTotalCount] == aFilter.meFunction ); + if (nSubTotalCount < aSubTotals.getLength()) + { + rResult[j] = ( aSubTotals[nSubTotalCount] == aFilter.meFunction ); + } + else + { + OSL_FAIL( "wrong subtotal count for manual subtotals for a single data field" ); + rResult[j] = false; + } } } else // automatic subtotals { if ( rBeforeDataLayout ) { - OSL_ENSURE( nSubTotalCount < (sal_Int32)rDataNames.size(), "wrong data count" ); - rtl::OUString aSourceName( rDataNames[nSubTotalCount] ); // vector contains source names - rtl::OUString aGivenName( rGivenNames[nSubTotalCount] ); + if (nSubTotalCount < (sal_Int32)rDataNames.size() && + nSubTotalCount < (sal_Int32)rGivenNames.size()) + { + OUString aSourceName( rDataNames[nSubTotalCount] ); // vector contains source names + OUString aGivenName( rGivenNames[nSubTotalCount] ); - rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ); + rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ); + } + else + { + OSL_FAIL( "wrong data count for automatic subtotals" ); + rResult[j] = false; + } } // if a function was specified, automatic subtotals never match @@ -1805,6 +1852,8 @@ void lcl_StripSubTotals( std::vector<bool>& rResult, const std::vector<sal_Int32 // if a subtotal is included, clear the result flag for the columns/rows that the subtotal includes sal_Int32 nStart = nPos - rSubtotal[nPos]; OSL_ENSURE( nStart >= 0, "invalid subtotal count" ); + if (nStart < 0) + nStart = 0; for (sal_Int32 nPrev = nStart; nPrev < nPos; nPrev++) rResult[nPrev] = false; diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index e18d241ba54b..74ba29bb6331 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -38,6 +38,7 @@ #include <sal/macros.h> #include <tools/rcid.h> #include <unotools/charclass.hxx> +#include <unotools/securityoptions.hxx> #include <stdlib.h> #include <time.h> #include <ctype.h> @@ -925,13 +926,25 @@ void ScGlobal::OpenURL( const String& rURL, const String& rTarget ) { // OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow // aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier. + //SvtSecurityOptions to access Libreoffice global security parameters + SvtSecurityOptions aSecOpt; + bool bProceedHyperlink = false; + if ( (nScClickMouseModifier & KEY_MOD1) && aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK )) // control-click -> into new window + { + //Ctrl key is pressed and ctrl+click hyperlink security control is set + bProceedHyperlink = true; + } + else if( !aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ) ) + { + //ctrl+click hyperlink security control is disabled just click will do + bProceedHyperlink = true; + } + if ( !bProceedHyperlink ) + return; SfxStringItem aUrl( SID_FILE_NAME, rURL ); SfxStringItem aTarget( SID_TARGETNAME, rTarget ); - - if ( nScClickMouseModifier & KEY_MOD1 ) // control-click -> into new window - aTarget.SetValue(rtl::OUString("_blank")); - + aTarget.SetValue(rtl::OUString("_blank")); SfxViewFrame* pFrame = NULL; String aReferName; if ( pScActiveViewShell ) diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 8f637815581a..6c92d4cd3f29 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -291,6 +291,7 @@ void ScUnoAddInCollection::Initialize() { uno::Any aAddInAny = xEnum->nextElement(); + try { uno::Reference<uno::XInterface> xIntFac; aAddInAny >>= xIntFac; @@ -321,6 +322,8 @@ void ScUnoAddInCollection::Initialize() } } } + } catch ( const uno::Exception& ) { + SAL_WARN ( "sc", "Failed to initialize create instance of sheet.AddIn" ); } } } diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 1553a9b3e631..3ed918933666 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4591,6 +4591,13 @@ void ScInterpreter::ScColumn() SCCOL nCols; SCROW nRows; pMyFormulaCell->GetMatColsRows( nCols, nRows); + if (nCols == 0) + { + // Happens if called via ScViewFunc::EnterMatrix() + // ScFormulaCell::GetResultDimensions() as of course a + // matrix result is not available yet. + nCols = 1; + } ScMatrixRef pResMat = GetNewMat( static_cast<SCSIZE>(nCols), 1); if (pResMat) { @@ -4667,6 +4674,13 @@ void ScInterpreter::ScRow() SCCOL nCols; SCROW nRows; pMyFormulaCell->GetMatColsRows( nCols, nRows); + if (nRows == 0) + { + // Happens if called via ScViewFunc::EnterMatrix() + // ScFormulaCell::GetResultDimensions() as of course a + // matrix result is not available yet. + nRows = 1; + } ScMatrixRef pResMat = GetNewMat( 1, static_cast<SCSIZE>(nRows)); if (pResMat) { diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 0a92ffc2721a..e6c22408609d 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -1128,17 +1128,26 @@ size_t ScMatrixImpl::Count(bool bCountStrings) const void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE& rC, SCSIZE& rR) const { SCSIZE nRowSize = maMat.size().row; - rC = nIndex / nRowSize; + SAL_WARN_IF( !nRowSize, "sc", "ScMatrixImpl::CalcPosition: 0 rows!"); + rC = nRowSize > 1 ? nIndex / nRowSize : nIndex; rR = nIndex - rC*nRowSize; } // ============================================================================ ScMatrix::ScMatrix( SCSIZE nC, SCSIZE nR) : - pImpl(new ScMatrixImpl(nC, nR)), nRefCnt(0) {} + pImpl(new ScMatrixImpl(nC, nR)), nRefCnt(0) +{ + SAL_WARN_IF( !nC, "sc", "ScMatrix with 0 columns!"); + SAL_WARN_IF( !nR, "sc", "ScMatrix with 0 rows!"); +} ScMatrix::ScMatrix(SCSIZE nC, SCSIZE nR, double fInitVal) : - pImpl(new ScMatrixImpl(nC, nR, fInitVal)), nRefCnt(0) {} + pImpl(new ScMatrixImpl(nC, nR, fInitVal)), nRefCnt(0) +{ + SAL_WARN_IF( !nC, "sc", "ScMatrix with 0 columns!"); + SAL_WARN_IF( !nR, "sc", "ScMatrix with 0 rows!"); +} ScMatrix::~ScMatrix() { diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index b7cc8db178a2..703fc8b1c36a 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1782,7 +1782,9 @@ BorderLineModel* Border::getBorderLine( sal_Int32 nElement ) switch( nElement ) { case XLS_TOKEN( left ): return &maModel.maLeft; + case XLS_TOKEN( start ): return &maModel.maLeft; case XLS_TOKEN( right ): return &maModel.maRight; + case XLS_TOKEN( end ): return &maModel.maRight; case XLS_TOKEN( top ): return &maModel.maTop; case XLS_TOKEN( bottom ): return &maModel.maBottom; case XLS_TOKEN( diagonal ): return &maModel.maDiagonal; diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx index 035004ae60f4..8490572dfe96 100644 --- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx @@ -259,7 +259,7 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex) AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::CHILD; aEvent.Source = uno::Reference< XAccessibleContext >(this); - aEvent.NewValue <<= xTempAcc; + aEvent.OldValue <<= xTempAcc; CommitChange(aEvent); // gone child - event @@ -270,25 +270,41 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex) void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex) { - OSL_ENSURE(static_cast<size_t>(nOldIndex) < maChildren.size() && - static_cast<size_t>(nNewIndex) < maChildren.size(), "did not recognize a child count change"); - - uno::Reference < XAccessible > xTempAcc = maChildren[nOldIndex].xWeakAcc; - if (xTempAcc.is() && maChildren[nOldIndex].pAcc) - maChildren[nOldIndex].pAcc->ResetFocused(); + if (0 <= nOldIndex && static_cast<size_t>(nOldIndex) < maChildren.size()) + { + uno::Reference < XAccessible > xTempAcc = maChildren[nOldIndex].xWeakAcc; + if (xTempAcc.is() && maChildren[nOldIndex].pAcc) + maChildren[nOldIndex].pAcc->ResetFocused(); + } + else + { + SAL_WARN( "sc", "ScAccessibleDataPilotControl::FieldFocusChange() old index out of bounds: " << nOldIndex); + } - xTempAcc = maChildren[nNewIndex].xWeakAcc; - if (xTempAcc.is() && maChildren[nNewIndex].pAcc) - maChildren[nNewIndex].pAcc->SetFocused(); + if (0 <= nNewIndex && static_cast<size_t>(nNewIndex) < maChildren.size()) + { + uno::Reference < XAccessible > xTempAcc = maChildren[nNewIndex].xWeakAcc; + if (xTempAcc.is() && maChildren[nNewIndex].pAcc) + maChildren[nNewIndex].pAcc->SetFocused(); + } + else + { + SAL_WARN( "sc", "ScAccessibleDataPilotControl::FieldFocusChange() new index out of bounds: " << nNewIndex); + } } void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex) { - OSL_ENSURE(static_cast<size_t>(nIndex) < maChildren.size(), "did not recognize a child count change"); - - uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; - if (xTempAcc.is() && maChildren[nIndex].pAcc) - maChildren[nIndex].pAcc->ChangeName(); + if (0 <= nIndex && static_cast<size_t>(nIndex) < maChildren.size()) + { + uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; + if (xTempAcc.is() && maChildren[nIndex].pAcc) + maChildren[nIndex].pAcc->ChangeName(); + } + else + { + SAL_WARN( "sc", "ScAccessibleDataPilotControl::FieldNameChange() index out of bounds: " << nIndex); + } } void ScAccessibleDataPilotControl::GotFocus() @@ -298,9 +314,16 @@ void ScAccessibleDataPilotControl::GotFocus() OSL_ENSURE(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change"); sal_Int32 nIndex(mpFieldWindow->GetSelectedField()); - uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; - if (xTempAcc.is() && maChildren[nIndex].pAcc) - maChildren[nIndex].pAcc->SetFocused(); + if (0 <= nIndex && static_cast<size_t>(nIndex) < maChildren.size()) + { + uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; + if (xTempAcc.is() && maChildren[nIndex].pAcc) + maChildren[nIndex].pAcc->SetFocused(); + } + else + { + SAL_WARN( "sc", "ScAccessibleDataPilotControl::GotFocus() field index out of bounds: " << nIndex); + } } } @@ -311,9 +334,21 @@ void ScAccessibleDataPilotControl::LostFocus() OSL_ENSURE(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change"); sal_Int32 nIndex(mpFieldWindow->GetSelectedField()); - uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; - if (xTempAcc.is() && maChildren[nIndex].pAcc) - maChildren[nIndex].pAcc->ResetFocused(); + if (0 <= nIndex && static_cast<size_t>(nIndex) < maChildren.size()) + { + uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; + if (xTempAcc.is() && maChildren[nIndex].pAcc) + maChildren[nIndex].pAcc->ResetFocused(); + } + else + { + // This may actually happen if the last field is dropped somewhere + // and was already removed from the pane by dragging it away. This + // is odd.. looks like all LostFocus() are called for the previous + // field of the same original pane in the remove case? + SAL_WARN_IF( nIndex != -1 || !maChildren.empty(), "sc", + "ScAccessibleDataPilotControl::LostFocus() field index out of bounds: " << nIndex); + } } } @@ -390,10 +425,7 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getAccessibleChildCount(void) { SolarMutexGuard aGuard; IsObjectValid(); - if (mpFieldWindow) - return mpFieldWindow->GetFieldCount(); - else - return 0; + return static_cast<sal_Int32>(maChildren.size()); } uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibleChild(sal_Int32 nIndex) @@ -404,14 +436,19 @@ uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibl uno::Reference<XAccessible> xAcc; if (mpFieldWindow) { - if (nIndex < 0 || static_cast< size_t >( nIndex ) >= mpFieldWindow->GetFieldCount()) + if (nIndex < 0 || static_cast< size_t >( nIndex ) >= maChildren.size()) throw lang::IndexOutOfBoundsException(); - OSL_ENSURE(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change"); + OSL_ENSURE( mpFieldWindow->GetFieldCount() == maChildren.size() // all except ... + || mpFieldWindow->GetFieldCount() == maChildren.size() + 1, // in CommitChange during RemoveField + "did not recognize a child count change"); uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc; if (!xTempAcc.is()) { + if (static_cast< size_t >( nIndex ) >= mpFieldWindow->GetFieldCount()) + throw lang::IndexOutOfBoundsException(); + maChildren[nIndex].pAcc = new ScAccessibleDataPilotButton(this, mpFieldWindow, nIndex); xTempAcc = maChildren[nIndex].pAcc; maChildren[nIndex].xWeakAcc = xTempAcc; diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index cad35323de62..e17d1e06103e 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -62,6 +62,10 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bE aBtnNamedRange.Disable(); FreeResource(); + + // Intentionally hide this to see if someone complains. Eventually we'll + // remove this option. + aBtnExternal.Show(false); } ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg() diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src index 569023d6881e..4a388d6f7725 100644 --- a/sc/source/ui/dbgui/dapitype.src +++ b/sc/source/ui/dbgui/dapitype.src @@ -26,7 +26,7 @@ ModalDialog RID_SCDLG_DAPITYPE OutputSize = TRUE ; HelpId = HID_DATAPILOT_TYPE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 241 , 76 ) ; + Size = MAP_APPFONT ( 241 , 63 ) ; Moveable = TRUE ; Closeable = FALSE ; diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 78d04ac16a0d..4ee9d1109307 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -168,9 +168,19 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) // ListBox selection: if ( aSortData.maKeyState[0].bDoSort ) { + // Make sure that the all sort keys are reset + for ( sal_uInt16 i=nSortKeyCount; i<aSortData.maKeyState.size(); i++ ) + { + maSortKeyCtrl.AddSortKey(i+1); + maSortKeyItems[i].m_pLbSort->SetSelectHdl( LINK( this, + ScTabPageSortFields, SelectHdl ) ); + } + nSortKeyCount = aSortData.maKeyState.size(); + FillFieldLists(0); + for ( sal_uInt16 i=0; i<nSortKeyCount; i++ ) { - if ( i < aSortData.maKeyState.size() && aSortData.maKeyState[i].bDoSort ) + if (aSortData.maKeyState[i].bDoSort ) { maSortKeyItems[i].m_pLbSort->SelectEntryPos( GetFieldSelPos( aSortData.maKeyState[i].nField ) ); @@ -193,7 +203,6 @@ void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) maSortKeyItems[i].DisableField(); else maSortKeyItems[i].EnableField(); - } else { diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 67b02abd950f..d39b45f54afd 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1384,6 +1384,21 @@ void SAL_CALL ScVbaApplication::Undo() throw (uno::RuntimeException) dispatchExecute( pViewShell, SID_UNDO ); } +void SAL_CALL ScVbaApplication::OnKey( const ::rtl::OUString& Key, const uno::Any& Procedure ) throw (uno::RuntimeException) +{ + try + { + // Perhaps we can catch some excel specific + // related behaviour here + VbaApplicationBase::OnKey( Key, Procedure ); + } + catch( container::NoSuchElementException& ) + { + // #TODO special handling for unhandled + // bindings + } +} + rtl::OUString ScVbaApplication::getServiceImplName() { diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index 7431370625ed..b318c8d2c556 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -369,6 +369,9 @@ ScVbaValidation::getType() throw (uno::RuntimeException) case sheet::ValidationType_TEXT_LEN: nExcelType = excel::XlDVType::xlValidateTextLength; break; + case sheet::ValidationType_MAKE_FIXED_SIZE: + default: + break; }; } return nExcelType; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f67717d69954..e51a33afe31b 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1261,32 +1261,63 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pDlg->SetOtherDoc( bOtherDoc ); // if ChangeTrack MoveMode disable pDlg->SetChangeTrack( pDoc->GetChangeTrack() != NULL ); - // cut/move references may disable shift - // directions if source and destination ranges intersect - if ( !bOtherDoc ) + // fdo#56098 disable shift if necessary + if ( !bOtherDoc && pOwnClip ) { - if ( pOwnClip && pOwnClip->GetDocument()->IsCutMode() ) + ScViewData* pData = GetViewData(); + if ( pData->GetMarkData().GetTableSelect( pData->GetTabNo() ) ) { - ScViewData* pData = GetViewData(); - if ( pData->GetMarkData().GetTableSelect( - pData->GetTabNo() ) ) + SCCOL nStartX, nEndX, nClipStartX, nClipSizeX, nRangeSizeX; + SCROW nStartY, nEndY, nClipStartY, nClipSizeY, nRangeSizeY; + SCTAB nStartTab, nEndTab; + pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY ); + pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, sal_True ); + + if ( !( pData->GetSimpleArea( nStartX, nStartY, nStartTab, + nEndX, nEndY, nEndTab ) == SC_MARK_SIMPLE && + nStartTab == nEndTab ) ) { - SCCOL nPosX = pData->GetCurX(); - SCROW nPosY = pData->GetCurY(); - SCCOL nClipStartX, nClipSizeX; - SCROW nClipStartY, nClipSizeY; - pOwnClip->GetDocument()->GetClipStart( nClipStartX, nClipStartY ); - // for CutMode, filtered rows can always be included - pOwnClip->GetDocument()->GetClipArea( nClipSizeX, nClipSizeY, sal_True ); - int nDisableShift = 0; - if ( nClipStartX <= nPosX + nClipSizeX && - nPosX <= nClipStartX + nClipSizeX ) - nDisableShift |= SC_CELL_SHIFT_DISABLE_DOWN; - if ( nClipStartY <= nPosY + nClipSizeY && - nPosY <= nClipStartY + nClipSizeY ) - nDisableShift |= SC_CELL_SHIFT_DISABLE_RIGHT; - if ( nDisableShift ) - pDlg->SetCellShiftDisabled( nDisableShift ); + // the destination is not a simple range, + // assume the destination as the current cell + nStartX = nEndX = pData->GetCurX(); + nStartY = nEndY = pData->GetCurY(); + nStartTab = pData->GetTabNo(); + } + // we now have clip- and range dimensions + // the size of the destination area is the larger of the two + nRangeSizeX = nClipSizeX >= nEndX - nStartX ? nClipSizeX : nEndX - nStartX; + nRangeSizeY = nClipSizeY >= nEndY - nStartY ? nClipSizeY : nEndY - nStartY; + // When the source and destination areas intersect things may go wrong, + // especially if the area contains references. This may produce data loss + // (e.g. formulas that get wrong references), this scenario _must_ be avoided. + ScRange aSource( nClipStartX, nClipStartY, nStartTab, + nClipStartX + nClipSizeX, nClipStartY + nClipSizeY, nStartTab ); + ScRange aDest( nStartX, nStartY, nStartTab, + nStartX + nRangeSizeX, nStartY + nRangeSizeY, nStartTab ); + if ( aSource.Intersects( aDest ) ) + pDlg->SetCellShiftDisabled( SC_CELL_SHIFT_DISABLE_DOWN | SC_CELL_SHIFT_DISABLE_RIGHT ); + else + { + //no conflict with intersecting ranges, + //check if paste plus shift will fit on sheet + //and disable shift-option if no fit + int nDisableShiftX = 0; + int nDisableShiftY = 0; + + //check if horizontal shift will fit + if ( !pData->GetDocument()->IsBlockEmpty( nStartTab, + MAXCOL - nRangeSizeX, nStartY, + MAXCOL, nStartY + nRangeSizeY, false ) ) + nDisableShiftX = SC_CELL_SHIFT_DISABLE_RIGHT; + + //check if vertical shift will fit + if ( !pData->GetDocument()->IsBlockEmpty( nStartTab, + nStartX, MAXROW - nRangeSizeY, + nStartX + nRangeSizeX, MAXROW, false ) ) + nDisableShiftY = SC_CELL_SHIFT_DISABLE_DOWN; + + if ( nDisableShiftX || nDisableShiftY ) + pDlg->SetCellShiftDisabled( nDisableShiftX | nDisableShiftY ); } } } diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 1ab57f6d665c..0e4a72036d44 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -178,7 +178,7 @@ namespace { long DelayDeleteAbstractDialog( void *pAbstractDialog, void * /*pArg*/ ) { - delete reinterpret_cast<VclAbstractDialog*>( pAbstractDialog ); + delete reinterpret_cast<SfxAbstractTabDialog*>( pAbstractDialog ); return 0; } } diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index adf45ee6de17..fb9f27540737 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -292,10 +292,13 @@ void getChartSourceRanges(ScDocument* pDoc, const SdrMarkList& rObjs, std::vecto std::vector<OUString>::const_iterator it = aRangeReps.begin(), itEnd = aRangeReps.end(); for (; it != itEnd; ++it) { - ScRange aRange; + ScRangeList aRange; ScAddress aAddr; if (aRange.Parse(*it, pDoc, pDoc->GetAddressConvention()) & SCA_VALID) - rRanges.push_back(aRange); + { + for(size_t i = 0; i < aRange.size(); ++i) + rRanges.push_back(*aRange[i]); + } else if (aAddr.Parse(*it, pDoc, pDoc->GetAddressConvention()) & SCA_VALID) rRanges.push_back(aAddr); } diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 45e9f026cbac..543c70c5fd78 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -482,7 +482,24 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage // Umrandungs-Items holen und in den Set packen: GetSelectionFrame( aLineOuter, aLineInner ); - pOldSet->Put( aLineOuter ); + //Fix border incorrect for RTL fdo#62399 + if( pDoc->IsLayoutRTL( GetViewData()->GetTabNo() ) ) + { + SvxBoxItem aNewFrame( aLineOuter ); + if ( aLineInner.IsValid(VALID_LEFT) ) + aNewFrame.SetLine( aLineOuter.GetLeft(), BOX_LINE_RIGHT ); + if ( aLineInner.IsValid(VALID_RIGHT) ) + aNewFrame.SetLine( aLineOuter.GetRight(), BOX_LINE_LEFT ); + if ( aLineInner.IsValid(VALID_TOP) ) + aNewFrame.SetLine( aLineOuter.GetTop(), BOX_LINE_TOP ); + if ( aLineInner.IsValid(VALID_BOTTOM) ) + aNewFrame.SetLine( aLineOuter.GetBottom() , BOX_LINE_BOTTOM ); + + pOldSet->Put( aNewFrame ); + } + else + pOldSet->Put( aLineOuter ); + pOldSet->Put( aLineInner ); // NumberFormat Value aus Value und Language erzeugen und eintueten |