diff options
-rw-r--r-- | sc/source/filter/excel/xiname.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/inc/xiname.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/conflictsdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/view/pfuncache.cxx | 2 |
5 files changed, 30 insertions, 12 deletions
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 5d21d91c9f53b..3d373f6c36ba4 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -45,6 +45,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : mpScData( 0 ), mcBuiltIn( EXC_BUILTIN_UNKNOWN ), mnScTab( SCTAB_MAX ), + mbFunction( false ), mbVBName( false ) { ExcelToSc& rFmlaConv = GetOldFmlaConverter(); @@ -93,7 +94,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : // 2) *** convert sheet index and name *** -------------------------------- - // Visual Basic procedure + // functions and VBA + mbFunction = ::get_flag( nFlags, EXC_NAME_FUNC ); mbVBName = ::get_flag( nFlags, EXC_NAME_VB ); // get built-in name, or convert characters invalid in Calc @@ -210,7 +212,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : // 4) *** create a defined name in the Calc document *** ------------------ // #163146# do not ignore hidden names (may be regular names created by VBA scripts) - if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbVBName ) + if( pTokArr /*&& (bBuiltIn || !::get_flag( nFlags, EXC_NAME_HIDDEN ))*/ && !mbFunction && !mbVBName ) { // create the Calc name data ScRangeData* pData = new ScRangeData( GetDocPtr(), maScName, *pTokArr, ScAddress(), nNameType ); diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx index ccf1b88af9473..b5d9ca642d4f5 100644 --- a/sc/source/filter/inc/xiname.hxx +++ b/sc/source/filter/inc/xiname.hxx @@ -50,6 +50,7 @@ public: inline SCTAB GetScTab() const { return mnScTab; } inline const ScRangeData* GetScRangeData() const { return mpScData; } inline bool IsGlobal() const { return mnScTab == SCTAB_MAX; } + inline bool IsFunction() const { return mbFunction; } inline bool IsVBName() const { return mbVBName; } private: @@ -58,7 +59,8 @@ private: const ScRangeData* mpScData; /// Pointer to Calc defined name (no ownership). sal_Unicode mcBuiltIn; /// Excel built-in name index. SCTAB mnScTab; /// Calc sheet index of local names. - bool mbVBName; /// true = Visual Basic procedure. + bool mbFunction; /// true = Name refers to a function (add-in or VBA). + bool mbVBName; /// true = Visual Basic procedure or function. }; // ---------------------------------------------------------------------------- diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 361f201281dcd..89f818e219289 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -36,7 +36,7 @@ #include "conflictsdlg.hrc" #include "scresid.hxx" #include "viewdata.hxx" -#include "tabview.hxx" +#include "dbfunc.hxx" //============================================================================= @@ -660,7 +660,7 @@ IMPL_LINK( ScConflictsDlg, UpdateSelectionHdl, Timer*, EMPTYARG ) return 0; } - ScTabView* pTabView = reinterpret_cast< ScTabView* >( mpViewData->GetView() ); + ScTabView* pTabView = mpViewData->GetView(); pTabView->DoneBlockMode(); BOOL bContMark = FALSE; SvLBoxEntry* pEntry = maLbConflicts.FirstSelected(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 3d3f0f4796017..c92525b8ca57b 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -815,6 +815,16 @@ BOOL ScModelObj::FillRenderMarkData( const uno::Any& aSelection, rMark.MarkFromRangeList( rRanges, FALSE ); rMark.MarkToSimple(); + if ( rMark.IsMultiMarked() ) + { + // #i115266# copy behavior of old printing: + // treat multiple selection like a single selection with the enclosing range + ScRange aMultiMarkArea; + rMark.GetMultiMarkArea( aMultiMarkArea ); + rMark.ResetMark(); + rMark.SetMarkArea( aMultiMarkArea ); + } + if ( rMark.IsMarked() && !rMark.IsMultiMarked() ) { // a sheet object is treated like an empty selection: print the used area of the sheet @@ -974,15 +984,17 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 ScMarkData aMark; ScPrintSelectionStatus aStatus; String aPagesStr; - if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) - throw lang::IllegalArgumentException(); - - if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) ) + // #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below + long nTotalPages = 0; + if ( FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) { - delete pPrintFuncCache; - pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus ); + if ( !pPrintFuncCache || !pPrintFuncCache->IsSameSelection( aStatus ) ) + { + delete pPrintFuncCache; + pPrintFuncCache = new ScPrintFuncCache( pDocShell, aMark, aStatus ); + } + nTotalPages = pPrintFuncCache->GetPageCount(); } - long nTotalPages = pPrintFuncCache->GetPageCount(); sal_Int32 nRenderer = lcl_GetRendererNum( nSelRenderer, aPagesStr, nTotalPages ); if ( nRenderer >= nTotalPages ) { diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index 6a206ef3eb130..b503d3a73fb75 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -72,6 +72,8 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark, long nThisTab = 0; if ( rMark.GetTableSelect( nTab ) ) { + pDoc->InvalidatePageBreaks( nTab ); // user print area (selection) may be different + ScPrintFunc aFunc( pDocSh, pPrinter, nTab, nAttrPage, 0, pSelRange, &aSelection.GetOptions() ); nThisTab = aFunc.GetTotalPages(); nFirstAttr[nTab] = aFunc.GetFirstPageNo(); // from page style or previous sheet |