summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-01 15:58:31 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-01 15:58:31 +0100
commit9dc094a6791dcba4bf5828a6c00cca04d7815edc (patch)
tree72b3a745910aa6811a59a1aeed286defabcbee6d
parent5cb1bf1e0b4ad3d395c84bb24eb87c1a95954f8d (diff)
parent50b023a94b59bedf747e1c16e829b8a28d1842a8 (diff)
#i10000# changes from OOO330 m13
-rw-r--r--sc/source/filter/excel/xiname.cxx6
-rw-r--r--sc/source/filter/inc/xiname.hxx4
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx4
-rw-r--r--sc/source/ui/unoobj/docuno.cxx26
-rw-r--r--sc/source/ui/view/pfuncache.cxx2
5 files changed, 30 insertions, 12 deletions
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 5d21d91c9f53..3d373f6c36ba 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 ccf1b88af947..b5d9ca642d4f 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 361f201281dc..89f818e21928 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 3d3f0f479601..c92525b8ca57 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 6a206ef3eb13..b503d3a73fb7 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