[Libreoffice-commits] .: 7 commits - sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Nov 1 08:29:36 PDT 2010


 sc/source/filter/excel/xiname.cxx      |    6 ++++--
 sc/source/filter/inc/xiname.hxx        |    4 +++-
 sc/source/ui/miscdlgs/conflictsdlg.cxx |    4 ++--
 sc/source/ui/unoobj/docuno.cxx         |   26 +++++++++++++++++++-------
 sc/source/ui/view/pfuncache.cxx        |    2 ++
 5 files changed, 30 insertions(+), 12 deletions(-)

New commits:
commit 287d59ff7b1002f698ecf4a4e7a6a08ec4e6269a
Merge: 0721832... 9a6aaec...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Nov 1 16:07:04 2010 +0100

    Merge branch 'master' of ssh://git.freedesktop.org/git/libreoffice/calc

commit 0721832dce822121f1d0332367710371b7b48746
Merge: 1a7305a... 2a75245...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Nov 1 13:49:11 2010 +0100

    Merge commit 'ooo/OOO330_m13'

commit 2a75245b7f40a23fc5d866912aa8dacd3637448f
Merge: c26e034... c929d03...
Author: obo <obo at openoffice.org>
Date:   Thu Oct 28 10:55:51 2010 +0200

    CWS-TOOLING: integrate CWS calc61

commit c929d0319d72247a9fb3db00aac412a3ef836589
Author: Niklas Nebel <nn at openoffice.org>
Date:   Wed Oct 27 17:08:35 2010 +0200

    calc61: #i115266# handle multiple selection for printing, return valid settings for invalid selection, catch exception from getRenderer

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ccf3ddf..bbfd906 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 a15d607..4db10a2 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
commit c26e034840bb7bde528e0636395577cc98133db7
Merge: fcd5e60... ed8dc81...
Author: obo <obo at openoffice.org>
Date:   Mon Oct 25 14:37:52 2010 +0200

    CWS-TOOLING: integrate CWS calc33stopper1

commit ed8dc81ebfb48d90b1a96fb9a7fc3b2bb5eba6d2
Author: Daniel Rentz [dr] <daniel.rentz at oracle.com>
Date:   Fri Oct 22 11:56:55 2010 +0200

    calc33stopper1: #i79854# do not create defined names in Calc for functions

diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 5596d26..9cef1f9 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 174b46c..d6e2f28 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.
 };
 
 // ----------------------------------------------------------------------------
commit 64953c94a4a92f0ff77476b853480630387d7b3e
Author: Niklas Nebel <nn at openoffice.org>
Date:   Fri Oct 22 11:44:41 2010 +0200

    calc33stopper1: #i115183# no reinterpret_cast between ScDBFunc* and ScTabView*

diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 161c647..694cfaa 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();


More information about the Libreoffice-commits mailing list