diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 17 | ||||
-rw-r--r-- | sc/source/core/tool/address.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xepage.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xiname.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/tokenuno.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 11 |
14 files changed, 67 insertions, 29 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 25864796da44..8e8ded033933 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1860,9 +1860,6 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const // ppLabelArr / nLabels is not changed SCCOL nSrcColOffset = 0; - if (IsSheetData()) - // source data column offset is only for internal sheet source. - nSrcColOffset = pSheetDesc->GetSourceRange().aStart.Col(); bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN ); lcl_FillOldFields( diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 3130ee05ba8d..f120b9011c34 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1303,6 +1303,12 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW bUpdated |= aCol[i].UpdateReference( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, pUndoDoc ); + if (mpRangeName) + { + ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );; + mpRangeName->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz ); + } + if ( bIncludeDraw ) UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos ); @@ -1410,6 +1416,9 @@ void ScTable::UpdateInsertTab(SCTAB nTable) } for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable); + if (mpRangeName) + mpRangeName->UpdateTabRef( nTable, 1); + if (IsStreamValid()) SetStreamValid(false); } @@ -1429,6 +1438,11 @@ void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo else for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL); + if (mpRangeName) + { + mpRangeName->UpdateTabRef( nTable, 2 ); + } + if (IsStreamValid()) SetStreamValid(false); } @@ -1443,6 +1457,9 @@ void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, rProgress.SetState( rProgress.GetState() + aCol[i].GetCodeCount() ); } + if (mpRangeName) + mpRangeName->UpdateTabRef(nOldPos, 3, nNewPos); + if (IsStreamValid()) SetStreamValid(false); if (pDBDataNoName) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 13101cc0a921..16b821a28738 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1420,7 +1420,7 @@ sal_uInt16 ScRange::ParseAny( const String& r, ScDocument* pDoc, if ( (nRet & nValid) != nValid ) { - ScAddress aAdr; + ScAddress aAdr(aStart);//initialize with currentPos as fallback for table number nRet = aAdr.Parse( r, pDoc, rDetails ); if ( nRet & SCA_VALID ) aStart = aEnd = aAdr; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index ad3052585784..e4eab3fa510f 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2892,18 +2892,17 @@ sal_Bool ScCompiler::IsNamedRange( const String& rUpperName ) { // IsNamedRange is called only from NextNewToken, with an upper-case string - // Try global named ranges first, then sheet local next. BTW does this - // order matter? - bool bGlobal = true; - ScRangeName* pRangeName = pDoc->GetRangeName(); + // try local names first + bool bGlobal = false; + ScRangeName* pRangeName = pDoc->GetRangeName(aPos.Tab()); const ScRangeData* pData = pRangeName->findByUpperName(rUpperName); if (!pData) { - pRangeName = pDoc->GetRangeName(aPos.Tab()); + pRangeName = pDoc->GetRangeName(); if (pRangeName) pData = pRangeName->findByUpperName(rUpperName); if (pData) - bGlobal = false; + bGlobal = true; } if (pData) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 9add45e417ec..7b1a3b447665 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -463,12 +463,15 @@ const String& ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const { if (ValidColRowOrReplicated( nC, nR )) { - if (maMat.get_type(nR, nC) == ::mdds::element_string) - return *maMat.get_string(nR, nC); - else + switch (maMat.get_type(nR, nC)) { - SetErrorAtInterpreter( GetError(nC, nR)); - DBG_ERRORFILE("ScMatrixImpl::GetString: access error, no string"); + case ::mdds::element_string: + return *maMat.get_string(nR, nC); + case ::mdds::element_empty: + return ScGlobal::GetEmptyString(); + default: + SetErrorAtInterpreter( GetError(nC, nR)); + OSL_FAIL("ScMatrixImpl::GetString: access error, no string"); } } else diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 95f44a3f19d0..4dacebe5909d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -57,6 +57,7 @@ using ::std::vector; #include <com/sun/star/sheet/ComplexReference.hpp> #include <com/sun/star/sheet/ExternalReference.hpp> #include <com/sun/star/sheet/ReferenceFlags.hpp> +#include <com/sun/star/sheet/NameToken.hpp> using namespace formula; using namespace com::sun::star; @@ -1175,6 +1176,13 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a else bError = true; } + else if ( aType.equals( cppu::UnoType<sheet::NameToken>::get() ) ) + { + sheet::NameToken aTokenData; + _aToken.Data >>= aTokenData; + if ( eOpCode == ocName ) + AddRangeName(aTokenData.Index, aTokenData.Global); + } else if ( aType.equals( cppu::UnoType<sheet::ExternalReference>::get() ) ) { sheet::ExternalReference aApiExtRef; diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 47396d620e41..3831bc7822ac 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -330,6 +330,14 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) : maData.maHorPageBreaks.push_back(nRow); } + if (maData.maHorPageBreaks.size() > 1026) + { + // Excel allows only up to 1026 page breaks. Trim any excess page breaks. + ScfUInt16Vec::iterator itr = maData.maHorPageBreaks.begin(); + ::std::advance(itr, 1026); + maData.maHorPageBreaks.erase(itr, maData.maHorPageBreaks.end()); + } + set<SCCOL> aColBreaks; rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true); for (set<SCCOL>::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr) diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 90be4dc022ec..8a80f5217dc1 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -271,7 +271,7 @@ const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nSc const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const { DBG_ASSERT( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" ); - return ( nXclNameIdx >= maNameList.size() ) ? NULL : &(maNameList.at( nXclNameIdx - 1 )); + return ( nXclNameIdx > maNameList.size() ) ? NULL : &(maNameList.at( nXclNameIdx - 1 )); } // ============================================================================ diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c7a79a164de5..10c4a5b83684 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1012,7 +1012,9 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) nColOffsetStart = nColOffset; } - ScEEParseEntry* pE = maList.back(); + ScEEParseEntry* pE = NULL; + if (maList.size()) + pE = maList.back(); NewActEntry( pE ); // neuer freifliegender pActEntry xLockedList = new ScRangeList; } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 60f7c051dd36..968b38a25711 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2066,7 +2066,8 @@ IMPL_LINK( ScInputHandler, ModifyHdl, void *, EMPTYARG ) sal_Bool ScInputHandler::DataChanging( sal_Unicode cTyped, sal_Bool bFromCommand ) // return sal_True = new view created { - pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE ); + if (pActiveViewSh) + pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE ); bInOwnChange = true; // disable ModifyHdl (reset in DataChanged) if ( eMode == SC_INPUT_NONE ) @@ -2283,7 +2284,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode ) return; } - if (eNewMode != SC_INPUT_NONE) + if (eNewMode != SC_INPUT_NONE && pActiveViewSh) // Disable paste mode when edit mode starts. pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE ); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8cb3d6e136e8..8f95c3e5e304 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1701,7 +1701,7 @@ void ScPosWnd::DoEnter() { // Note that SID_CURRENTCELL always expects address to // be in Calc A1 format. Convert the text. - ScRange aRange; + ScRange aRange(0,0,pViewData->GetTabNo()); aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention()); aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO); } diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 8c48f46a3f7d..2e6658b2b57f 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/sheet/ExternalReference.hpp> #include <com/sun/star/sheet/ReferenceFlags.hpp> #include <com/sun/star/sheet/AddressConvention.hpp> +#include <com/sun/star/sheet/NameToken.hpp> #include <com/sun/star/table/CellAddress.hpp> #include <svl/itemprop.hxx> @@ -395,7 +396,12 @@ bool ScTokenConversion::ConvertToTokenSequence( ScDocument& rDoc, } break; case svIndex: - rAPI.Data <<= static_cast<sal_Int32>( rToken.GetIndex() ); + { + sheet::NameToken aNameToken; + aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() ); + aNameToken.Global = static_cast<sal_Bool>( rToken.GetByte() ); + rAPI.Data <<= aNameToken; + } break; case svMatrix: if (!ScRangeToSequence::FillMixedArray( rAPI.Data, static_cast<const ScToken&>(rToken).GetMatrix(), true)) diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index e8867653be13..9c2bb98e1321 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -487,7 +487,7 @@ void ScDrawView::MarkListHasChanged() uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef(); DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" ); if (xObj.is()) - xObj->getSupportedVerbs(); + aVerbs = xObj->getSupportedVerbs(); } pViewSh->SetVerbs( aVerbs ); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index c1866a5be0a9..b69f2ace659a 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -52,7 +52,6 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <svx/sdr/contact/objectcontacttools.hxx> #include <svx/unoapi.hxx> -#include <svx/svdpage.hxx> #include "output.hxx" #include "document.hxx" @@ -1635,19 +1634,17 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor ) drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( ) { - SdrModel aModel; - SdrPage aSdrPage( aModel ); - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - if ( pDrawLayer ) - aSdrPage = *pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) ); + if (!pDrawLayer) + return NULL; basegfx::B2DRange aViewRange; + SdrPage *pDrawPage = pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) ); const drawinglayer::geometry::ViewInformation2D aNewViewInfos( basegfx::B2DHomMatrix( ), pDev->GetViewTransformation(), aViewRange, - GetXDrawPageForSdrPage( &aSdrPage ), + GetXDrawPageForSdrPage( pDrawPage ), 0.0, uno::Sequence< beans::PropertyValue >() ); |