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 f34a66bf54c0..e94832e99597 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -47,6 +47,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : mpScData( 0 ), mcBuiltIn( EXC_BUILTIN_UNKNOWN ), mnScTab( SCTAB_MAX ), + mbFunction( false ), mbVBName( false ) { ExcelToSc& rFmlaConv = GetOldFmlaConverter(); @@ -95,7 +96,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 @@ -215,7 +217,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 bb79ca34215c..bf260a76548e 100644 --- a/sc/source/filter/inc/xiname.hxx +++ b/sc/source/filter/inc/xiname.hxx @@ -51,6 +51,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: @@ -59,7 +60,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 ef525d6d8447..de40dd9d1868 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -37,7 +37,7 @@ #include "conflictsdlg.hrc" #include "scresid.hxx" #include "viewdata.hxx" -#include "tabview.hxx" +#include "dbfunc.hxx" //============================================================================= @@ -625,7 +625,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 3bb6c0bcf6a4..41bf1a16859f 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -804,6 +804,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 @@ -963,15 +973,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 569e9bf876ad..5fe990aad697 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -73,6 +73,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 |