[Libreoffice-commits] .: Branch 'integration/dev300_m101' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Mar 14 13:26:30 PDT 2011


 sc/source/core/data/dpobject.cxx |    9 --
 sc/source/core/data/funcdesc.cxx |    8 --
 sc/source/core/data/global2.cxx  |    1 
 sc/source/core/data/pivot2.cxx   |   27 ++++----
 sc/source/ui/docshell/docsh.cxx  |    2 
 sc/source/ui/inc/fieldwnd.hxx    |   33 ++--------
 sc/source/ui/inc/pvlaydlg.hxx    |   40 +++++++++---
 sc/source/ui/inc/tabview.hxx     |    2 
 sc/source/ui/view/drawview.cxx   |    7 --
 sc/source/ui/view/formatsh.cxx   |    3 
 sc/source/ui/view/gridwin2.cxx   |    4 -
 sc/source/ui/view/prevwsh.cxx    |   96 -----------------------------
 sc/source/ui/view/tabview3.cxx   |    4 -
 sc/source/ui/view/tabvwsh4.cxx   |  128 ---------------------------------------
 sc/source/ui/view/tabvwsha.cxx   |   86 --------------------------
 sc/source/ui/view/tabvwshf.cxx   |   10 +--
 sc/source/ui/view/viewfun3.cxx   |    3 
 sc/source/ui/view/viewfun6.cxx   |    2 
 sc/source/ui/view/viewfun7.cxx   |   11 +++
 19 files changed, 83 insertions(+), 393 deletions(-)

New commits:
commit 523a8f41388f6d938901fd12651c5c499029c291
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Mar 14 16:24:03 2011 -0400

    Various fixes for build breakages, for sc.

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 4967fec..2292dcd 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1841,14 +1841,7 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
     rParam.nTab = aOutRange.aStart.Tab();
     // ppLabelArr / nLabels is not changed
 
-    SCCOL nColAdd = 0;
-    if ( bForFile )
-    {
-        // in old file format, columns are within document, not within source range
-
-        DBG_ASSERT( pSheetDesc, "FillOldParam: bForFile, !pSheetDesc" );
-        nColAdd = pSheetDesc->GetSourceRange().aStart.Col();
-    }
+    SCCOL nColAdd = pSheetDesc->GetSourceRange().aStart.Col();
 
     bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN );
     lcl_FillOldFields(
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index c4cb2d6..8b32f34 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -84,7 +84,6 @@ ScFuncDesc::ScFuncDesc() :
         nFIndex         (0),
         nCategory       (0),
         nArgCount       (0),
-        nHelpId         (0),
         bIncomplete     (false),
         bHasSuppressedArgs(false)
 {}
@@ -122,7 +121,7 @@ void ScFuncDesc::Clear()
 
     nFIndex = 0;
     nCategory = 0;
-    nHelpId = 0;
+    sHelpId = rtl::OString();
     bIncomplete = false;
     bHasSuppressedArgs = false;
 }
@@ -343,9 +342,9 @@ void ScFuncDesc::initArgumentInfo()  const
     }
 }
 
-long ScFuncDesc::getHelpId() const
+::rtl::OString ScFuncDesc::getHelpId() const
 {
-    return (long)nHelpId;
+    return sHelpId;
 }
 
 sal_uInt32 ScFuncDesc::getParameterCount() const
@@ -816,7 +815,6 @@ ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
 {
     rbSuppressed = (bool)GetNum();
     pDesc->nCategory = GetNum();
-    pDesc->nHelpId = GetNum() + 32768; //! Hack, see scfuncs.src
     pDesc->nArgCount = GetNum();
     sal_uInt16 nArgs = pDesc->nArgCount;
     if (nArgs >= VAR_ARGS)
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index ef249d4..894f8b4 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -48,6 +48,7 @@
 #include "compiler.hxx"
 #include "paramisc.hxx"
 #include "dpglobal.hxx"
+#include "pivot.hxx"
 
 #include "sc.hrc"
 #include "globstr.hrc"
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index 0553b5c..8c96ab6 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -130,19 +130,20 @@ ScPivotParam::ScPivotParam()
 
 bool ScPivotParam::operator==( const ScPivotParam& r ) const
 {
-    return
-        (nCol == r.nCol)
-     &&	(nRow == r.nRow)
-     && (nTab == r.nTab)
-     && (bIgnoreEmptyRows  == r.bIgnoreEmptyRows)
-     && (bDetectCategories == r.bDetectCategories)
-     && (bMakeTotalCol == r.bMakeTotalCol)
-     && (bMakeTotalRow == r.bMakeTotalRow)
-     && (maLabelArray.size() == r.maLabelArray.size())  // ! only size??
-     && (maPageArr == r.maPageArr)
-     && (maColArr == r.maColArr)
-     && (maRowArr == r.maRowArr)
-     && (maDataArr == r.maDataArr);
+    bool bEqual = (nCol == r.nCol)
+                 &&	(nRow == r.nRow)
+                 && (nTab == r.nTab)
+                 && (bIgnoreEmptyRows  == r.bIgnoreEmptyRows)
+                 && (bDetectCategories == r.bDetectCategories)
+                 && (bMakeTotalCol == r.bMakeTotalCol)
+                 && (bMakeTotalRow == r.bMakeTotalRow)
+                 && (maLabelArray.size() == r.maLabelArray.size())
+                 && maPageFields == r.maPageFields
+                 && maColFields == r.maColFields
+                 && maRowFields == r.maRowFields
+                 && maDataFields == r.maDataFields;
+
+    return bEqual;
 }
 
 // ============================================================================
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 4928cc7..46687e8 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2595,7 +2595,7 @@ ScDocShell::~ScDocShell()
 
 //------------------------------------------------------------------
 
-SfxUndoManager* ScDocShell::GetUndoManager()
+::svl::IUndoManager* ScDocShell::GetUndoManager()
 {
     return aDocument.GetUndoManager();
 }
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index e9aaee8..7835855 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -29,7 +29,6 @@
 #ifndef SC_FIELDWND_HXX
 #define SC_FIELDWND_HXX
 
-#include <utility>
 #include <vector>
 #include "address.hxx"
 #include "dpglobal.hxx"
@@ -41,33 +40,19 @@
 class ScDPLayoutDlg;
 class ScAccessibleDataPilotControl;
 
-const size_t PIVOTFIELD_INVALID = static_cast< size_t >( -1 );
+//===================================================================
 
-// ============================================================================
-
-/** Type of the pivot table field window. */
-enum ScPivotFieldType
-{
-    PIVOTFIELDTYPE_PAGE,            /// Window for all page fields.
-    PIVOTFIELDTYPE_COL,             /// Window for all column fields.
-    PIVOTFIELDTYPE_ROW,             /// Window for all row fields.
-    PIVOTFIELDTYPE_DATA,            /// Window for all data fields.
-    PIVOTFIELDTYPE_SELECT           /// Selection window with all fields.
-};
-
-/** Type of an end tracking event. */
-enum ScPivotFieldEndTracking
+/** Type of content area. */
+enum ScDPFieldType
 {
-    ENDTRACKING_SUSPEND,            /// Stop tracking in this window, but tracking still active (in another window).
-    ENDTRACKING_CANCEL,             /// Tracking has been cancelled.
-    ENDTRACKING_DROP                /// Tracking has ended, a field has been dropped.
+    TYPE_PAGE,              /// Area for all page fields.
+    TYPE_ROW,               /// Area for all row fields.
+    TYPE_COL,               /// Area for all column fields.
+    TYPE_DATA,              /// Area for all data fields.
+    TYPE_SELECT             /// Selection area with all fields.
 };
 
-// ============================================================================
-
-typedef ::std::pair< const ScPivotFuncData*, size_t > ScPivotFuncDataEntry;
-
-// ============================================================================
+//-------------------------------------------------------------------
 
 /**
  * Represents a field area in the DataPilot layout dialog.  This base class
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index 1b04a14..72e3bdf 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -29,8 +29,9 @@
 #ifndef SC_PVLAYDLG_HXX
 #define SC_PVLAYDLG_HXX
 
-#include <memory>
 #include <vector>
+#include <memory>
+#include <boost/shared_ptr.hpp>
 
 #include <vcl/lstbox.hxx>
 #include <vcl/scrbar.hxx>
@@ -39,12 +40,35 @@
 #include "pivot.hxx"
 #include "anyrefdg.hxx"
 #include "fieldwnd.hxx"
+#include "formula/funcutl.hxx"
+
+/*==========================================================================*\
+
+    Eine Instanz der Klasse ScPivotLayoutDlg ist ein (semi-)modaler
+    Dialog, in dem mit der Maus Felder mit Spaltenueberschriften den
+    drei Pivot-Kategorien "Spalte", "Zeile" und "Daten" zugeordnet
+    werden koennen.
 
-// ============================================================================
+    Der Dialog erhaelt in der Struktur LabelData Informationen ueber
+    diese Ueberschriften (Name, Art (Zahl/String) und Funktionsmaske).
+    Weiterhin werden drei PivotFeld-Arrays uebergeben, mit denen die
+    drei Kategorie-Fenster initialisiert werden. Ein Kategorie-Fenster
+    wird durch eine Instanz der Klasse FieldWindow dargestellt. Ein
+    solches Fenster ist fuer die Darstellung der Datenstrukturen am
+    Schirm zustaendig. Es meldet Mausaktionen an den Dialog weiter und
+    bietet entsprechende Methoden zur Veraenderung der Darstellung.
+    Der Dialog sorgt fuer den Abgleich der interenen Datenstrukturen mit
+    der Bildschirmdarstellung. Ein weiteres FieldWindow (Select) bietet
+    alle Tabellenueberschriften zur Auswahl an, ist also "read-only".
+
+\*==========================================================================*/
+
+//============================================================================
 
 class ScViewData;
 class ScDocument;
 class ScRangeData;
+struct ScDPFuncData;
 class ScDPObject;
 
 //============================================================================
@@ -67,9 +91,9 @@ public:
     virtual                 ~ScDPLayoutDlg();
 
     virtual void            SetReference( const ScRange& rRef, ScDocument* pDoc );
-    virtual sal_Bool            IsRefInputMode() const { return bRefInputMode; }
+    virtual sal_Bool        IsRefInputMode() const { return bRefInputMode; }
     virtual void            SetActive();
-    virtual sal_Bool            Close();
+    virtual sal_Bool        Close();
     virtual void            StateChanged( StateChangedType nStateChange );
 
     void                    NotifyDoubleClick    ( ScDPFieldType eType, size_t nFieldIndex );
@@ -81,11 +105,7 @@ public:
     void                    NotifyRemoveField    ( ScDPFieldType eType, size_t nFieldIndex );
 
 protected:
-    virtual void        Tracking( const TrackingEvent& rTEvt );
-    virtual void        SetReference( const ScRange& rRef, ScDocument* pDoc );
-    virtual sal_Bool    IsRefInputMode() const;
-    virtual void        SetActive();
-    virtual sal_Bool    Close();
+    virtual void            Deactivate();
 
 private:
     typedef boost::shared_ptr< ScDPFuncData >   ScDPFuncDataRef;
@@ -179,7 +199,7 @@ private:
     String                  GetLabelString  ( SCsCOL nCol );
     bool                    IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType );
     String                  GetFuncString   ( sal_uInt16& rFuncMask, sal_Bool bIsValue = true );
-    sal_Bool                    Contains        ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt );
+    sal_Bool                Contains        ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt );
     void                    Remove          ( ScDPFuncDataVec* pArr, size_t nAt );
     void                    Insert          ( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt );
 
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 3a11b25..583a689 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -382,7 +382,7 @@ public:
 
     void			FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection = sal_True );
 
-    SC_DLLPUBLIC void            SetTabNo( SCTAB nTab, sal_Bool bNew = false, sal_Bool bExtendSelection = false );
+    SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false );
     void            SelectNextTab( short nDir, sal_Bool bExtendSelection = false );
 
     void			ActivateView( sal_Bool bActivate, sal_Bool bFirst );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index c124dfa..a75dfd8 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -487,12 +487,7 @@ void ScDrawView::MarkListHasChanged()
         uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef();
         DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" );
         if (xObj.is())
-            pViewSh->SetVerbs( xObj->getSupportedVerbs() );
-        else
-        {
-            OSL_FAIL("SdrOle2Obj ohne ObjRef");
-            pViewSh->SetVerbs( 0 );
-        }
+            xObj->getSupportedVerbs();
     }
     pViewSh->SetVerbs( aVerbs );
 
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index bae0587..213caea 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -107,9 +107,6 @@
 #define FormatForSelection
 #include "scslots.hxx"
 
-#define Interior
-#include <svx/svxslots.hxx>
-
 #include "scabstdlg.hxx"
 
 namespace {
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 769ced4..f390617 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -468,7 +468,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
         // out-of-bound dimension ID.  This should never happen!
         return;
 
-    const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim];
+    const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim];
 
     mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this, pViewData->GetDocument()));
     mpDPFieldPopup->setName(OUString(RTL_CONSTASCII_USTRINGPARAM("DataPilot field member popup")));
@@ -565,7 +565,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
         return;
 
     // Build a map of layout names to original names.
-    const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim];
+    const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim];
     MemNameMapType aMemNameMap;
     for (vector<ScDPLabelData::Member>::const_iterator itr = rLabelData.maMembers.begin(), itrEnd = rLabelData.maMembers.end();
            itr != itrEnd; ++itr)
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index b50a019..f5a530b 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -476,40 +476,6 @@ sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
     return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
 }
 
-PrintDialog* ScPreviewShell::CreatePrintDialog( Window* pParent )
-{
-    pDocShell->GetDocument()->SetPrintOptions();	// Optionen aus OFA am Printer setzen
-    (void)GetPrinter();
-
-    const long	 nCurPage	 = pPreview->GetPageNo()+1;
-    const long	 nDocPageMax = pPreview->GetTotalPages();
-    PrintDialog* pDlg        = new PrintDialog( pParent, true );
-// wenn zu langsam wieder einbauen
-//	if ( pPreview->AllTested() )
-//		nPageMax = pPreview->GetTotalPages();
-
-    pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
-    pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
-    pDlg->EnableSheetRange( false, PRINTSHEETS_SELECTED_CELLS );
-    bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
-    pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
-
-    if ( nDocPageMax > 0 )
-        pDlg->SetRangeText( String::CreateFromInt32( nCurPage ) );
-
-    pDlg->EnableRange	( PRINTDIALOG_ALL );
-    pDlg->EnableRange	( PRINTDIALOG_RANGE );
-    pDlg->SetFirstPage	( 1 );
-    pDlg->SetMinPage	( 1 );
-    pDlg->SetLastPage	( (sal_uInt16)nDocPageMax );
-    pDlg->SetMaxPage	( (sal_uInt16)nDocPageMax );
-    pDlg->EnableCollate	();
-
-    // Selektion hier nicht
-
-    return pDlg;
-}
-
 SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
 {
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
@@ -520,68 +486,6 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt
     return 0;
 }
 
-void ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog )
-{
-    SfxViewShell::PreparePrint( pPrintDialog );
-
-    ScMarkData aMarkData;
-    aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
-    pDocShell->PreparePrint( pPrintDialog, &aMarkData );
-}
-
-ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter,
-                                 PrintDialog *pPrintDialog, sal_Bool bSilent, sal_Bool bIsAPI )
-{
-    ErrCode nRet = ERRCODE_IO_ABORT;
-
-    ScMarkData aMarkData;
-    aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
-
-    if ( pDocShell->CheckPrint( pPrintDialog, &aMarkData, false, bIsAPI ) )
-    {
-        // SfxViewShell::DoPrint calls Print (after StartJob etc.)
-        nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
-    }
-
-    return nRet;
-}
-
-sal_uInt16 ScPreviewShell::Print( SfxProgress& rProgress, sal_Bool bIsAPI, PrintDialog* pPrintDialog )
-{
-    pDocShell->GetDocument()->SetPrintOptions();	// Optionen aus OFA am Printer setzen
-
-    // get the list of affected sheets before SfxViewShell::Print
-    bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
-
-    ScMarkData aMarkData;
-    aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), true );
-
-    uno::Sequence< sal_Int32 > aSheets;
-    SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
-    sal_Int32 nPrinted = 0;
-    for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab )
-    {
-        if ( bAllTabs || aMarkData.GetTableSelect( nTab ) )
-        {
-            aSheets.realloc( nPrinted + 1 );
-            aSheets[nPrinted] = nTab;
-            ++nPrinted;
-        }
-    }
-
-    uno::Sequence < beans::PropertyValue > aProps(1);
-    aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PrintSheets" ));
-    aProps[0].Value <<= aSheets;
-    SetAdditionalPrintOptions( aProps );
-
-    SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
-    pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, false, bIsAPI );
-
-    return 0;
-}
-
-//------------------------------------------------------------------------
-
 void ScPreviewShell::Activate(sal_Bool bMDI)
 {
     SfxViewShell::Activate(bMDI);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 08d62a8..856b2dc 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1429,7 +1429,7 @@ void ScTabView::SelectNextTab( short nDir, sal_Bool bExtendSelection )
 
 //	SetTabNo	- angezeigte Tabelle
 
-void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection, bool bSameTabButMoved )
+void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved )
 {
     if ( !ValidTab(nTab) )
     {
@@ -1561,7 +1561,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
                     pGridWin[i]->UpdateEditViewPos();
         }
 
-        TabChanged();										// DrawView
+        TabChanged(bSameTabButMoved);										// DrawView
         UpdateVisibleRange();
 
         aViewData.GetViewShell()->WindowChanged();			// falls das aktive Fenster anders ist
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index e8405d7..6e02b99 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1097,62 +1097,6 @@ sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
     return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
 }
 
-PrintDialog* ScTabViewShell::CreatePrintDialog( Window *pParent )
-{
-    ScDocShell*	pDocShell	= GetViewData()->GetDocShell();
-    ScDocument*	pDoc		= pDocShell->GetDocument();
-
-    pDoc->SetPrintOptions();				// Optionen aus OFA am Printer setzen
-    SfxPrinter* pPrinter = GetPrinter();
-
-    String			aStrRange;
-    PrintDialog*    pDlg        = new PrintDialog( pParent, true );
-    SCTAB			nTabCount	= pDoc->GetTableCount();
-    long			nDocPageMax = 0;
-
-    pDlg->EnableSheetRange( true, PRINTSHEETS_ALL );
-    pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS );
-    pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_CELLS );
-    bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets();
-    pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS );
-
-    // update all pending row heights with a single progress bar,
-    // instead of a separate progress for each sheet from ScPrintFunc
-    pDocShell->UpdatePendingRowHeights( MAXTAB, true );
-
-    ScMarkData aMarkData;
-    aMarkData.SelectTable( GetViewData()->GetTabNo(), true );
-
-    for ( SCTAB i=0; i<nTabCount; i++ )
-    {
-        if ( !bAllTabs && !aMarkData.GetTableSelect( i ) )
-            continue;
-        ScPrintFunc aPrintFunc( pDocShell, pPrinter, i );
-        nDocPageMax += aPrintFunc.GetTotalPages();
-    }
-
-    if ( nDocPageMax > 0 )
-    {
-        aStrRange = '1';
-        if ( nDocPageMax > 1 )
-        {
-            aStrRange += '-';
-            aStrRange += String::CreateFromInt32( nDocPageMax );
-        }
-    }
-
-    pDlg->SetRangeText	( aStrRange );
-    pDlg->EnableRange	( PRINTDIALOG_ALL );
-    pDlg->EnableRange	( PRINTDIALOG_RANGE );
-    pDlg->SetFirstPage	( 1 );
-    pDlg->SetMinPage	( 1 );
-    pDlg->SetLastPage	( (sal_uInt16)nDocPageMax );
-    pDlg->SetMaxPage	( (sal_uInt16)nDocPageMax );
-    pDlg->EnableCollate	();
-
-    return pDlg;
-}
-
 SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
 {
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
@@ -1163,78 +1107,6 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt
     return 0;
 }
 
-void ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog )
-{
-    ScDocShell* pDocShell = GetViewData()->GetDocShell();
-
-    SfxViewShell::PreparePrint( pPrintDialog );
-    pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() );
-}
-
-ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter,
-                                 PrintDialog *pPrintDialog, sal_Bool bSilent, sal_Bool bIsAPI )
-{
-    //	if SID_PRINTDOCDIRECT is executed and there's a selection,
-    //	ask if only the selection should be printed
-
-    const ScMarkData& rMarkData = GetViewData()->GetMarkData();
-    if ( !pPrintDialog && !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) )
-    {
-        SvxPrtQryBox aQuery( GetDialogParent() );
-        short nBtn = aQuery.Execute();
-
-        if ( nBtn == RET_CANCEL )
-            return ERRCODE_IO_ABORT;
-
-        if ( nBtn == RET_OK )
-            bPrintSelected = true;
-    }
-
-    ErrCode nRet = ERRCODE_IO_ABORT;
-
-    ScDocShell* pDocShell = GetViewData()->GetDocShell();
-    if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) )
-    {
-        // get the list of affected sheets before SfxViewShell::Print
-        bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
-
-        uno::Sequence<sal_Int32> aSheets;
-        SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
-        sal_uInt16 nPrinted = 0;
-        for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
-            if ( bAllTabs || rMarkData.GetTableSelect(nTab) )
-            {
-                aSheets.realloc( nPrinted + 1 );
-                aSheets[nPrinted] = nTab;
-                ++nPrinted;
-            }
-
-        uno::Sequence < beans::PropertyValue > aProps(1);
-        aProps[0].Name=::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintSheets"));
-        aProps[0].Value <<= aSheets;
-        SetAdditionalPrintOptions( aProps );
-
-        // SfxViewShell::DoPrint calls Print (after StartJob etc.)
-        nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
-    }
-
-    bPrintSelected = false;
-
-    return nRet;
-}
-
-sal_uInt16 ScTabViewShell::Print( SfxProgress& rProgress, sal_Bool bIsAPI,
-                                       PrintDialog* pPrintDialog )
-{
-    ScDocShell* pDocShell = GetViewData()->GetDocShell();
-    pDocShell->GetDocument()->SetPrintOptions();	// Optionen aus OFA am Printer setzen
-
-    SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog );
-    pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(),
-                        GetDialogParent(), bPrintSelected, bIsAPI );
-    return 0;
-}
-
 void ScTabViewShell::StopEditShell()
 {
     if ( pEditShell != NULL && !bDontSwitch )
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index a02fc44..9bbb2e6 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -738,92 +738,6 @@ void ScTabViewShell::GetSaveState( SfxItemSet& rSet )
     }
 }
 
-//------------------------------------------------------------------
-
-void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
-{
-    SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
-    SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
-    const SfxItemSet* pReqArgs = rReq.GetArgs();
-    ScDocShell* pDocSh = GetViewData()->GetDocShell();
-
-    sal_uInt16 nSlot = rReq.GetSlot();
-    switch ( nSlot )
-    {
-        case SID_UNDO:
-        case SID_REDO:
-            if ( pUndoManager )
-            {
-                sal_Bool bIsUndo = ( nSlot == SID_UNDO );
-
-                sal_uInt16 nCount = 1;
-                const SfxPoolItem* pItem;
-                if ( pReqArgs && pReqArgs->GetItemState( nSlot, true, &pItem ) == SFX_ITEM_SET )
-                    nCount = ((const SfxUInt16Item*)pItem)->GetValue();
-
-                // lock paint for more than one cell undo action (not for editing within a cell)
-                sal_Bool bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
-                if ( bLockPaint )
-                    pDocSh->LockPaint();
-
-                for (sal_uInt16 i=0; i<nCount; i++)
-                {
-                    if ( bIsUndo )
-                        pUndoManager->Undo(0);
-                    else
-                        pUndoManager->Redo(0);
-                }
-
-                if ( bLockPaint )
-                    pDocSh->UnlockPaint();
-
-                GetViewFrame()->GetBindings().InvalidateAll(false);
-            }
-            break;
-    }
-}
-
-void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
-{
-    SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
-    SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
-    SfxWhichIter aIter(rSet);
-    sal_uInt16 nWhich = aIter.FirstWhich();
-    while ( nWhich )
-    {
-        switch (nWhich)
-        {
-            case SID_GETUNDOSTRINGS:
-            case SID_GETREDOSTRINGS:
-                {
-                    SfxStringListItem aStrLst( nWhich );
-                    if ( pUndoManager )
-                    {
-                        List* pList = aStrLst.GetList();
-                        sal_Bool bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
-                        sal_uInt16 nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
-                        for (sal_uInt16 i=0; i<nCount; i++)
-                            pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
-                                                                 pUndoManager->GetRedoActionComment(i) ),
-                                           LIST_APPEND );
-                    }
-                    rSet.Put( aStrLst );
-                }
-                break;
-            default:
-                // get state from sfx view frame
-                GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
-        }
-
-        nWhich = aIter.NextWhich();
-    }
-}
-
-
-//------------------------------------------------------------------
-
 void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
 {
     ScViewOptions aViewOptions = GetViewData()->GetOptions();
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index dc6f5ba..605d379 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -424,11 +424,11 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
                     DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
 
-                    AbstractScStringInputDlg* pDlg = pFact->CreateScStringInputDlg( GetDialogParent(),
-                                                                                    aDlgTitle,
-                                                                                    String(ScResId(SCSTR_NAME)),
-                                                                                    aName,
-                                                                                    nSlot,RID_SCDLG_STRINPUT);
+                    AbstractScStringInputDlg* pDlg = pFact->CreateScStringInputDlg(
+                        GetDialogParent(), aDlgTitle, String(ScResId(SCSTR_NAME)),
+                        aName, GetStaticInterface()->GetSlot(nSlot)->GetCommand(),
+                        pHelpId, RID_SCDLG_STRINPUT);
+
                     DBG_ASSERT(pDlg, "Dialog create fail!");
 
                     while ( !bDone && nRet == RET_OK )
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index afa3d3e..5115ab0 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -181,6 +181,7 @@
 #include "docuno.hxx"
 #include "clipparam.hxx"
 #include "undodat.hxx"
+#include "drawview.hxx"
 
 using namespace com::sun::star;
 
@@ -1882,7 +1883,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
     ScDocShell* pDocSh = GetViewData()->GetDocShell();
     ScMarkData& rMark = GetViewData()->GetMarkData();
     ScDocShellModificator aModificator( *pDocSh );
-    SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+    ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
     if ( pDoc )
     {
         const sal_Bool bRecord( pDoc->IsUndoEnabled());
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 0190d77..1f89704 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -292,7 +292,7 @@ void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr)
     ScAddress aCurPos = pViewData->GetCurPos();
     ScDocShell* pDocSh = pViewData->GetDocShell();
     ScDocument* pDoc = pDocSh->GetDocument();
-    SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+    ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
     SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
     Date aActDate;
     double fDate = aActDate - *pFormatter->GetNullDate();
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index c6f4950..faf59d9 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -223,7 +223,16 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
         if ( pClient && pClient->IsObjectInPlaceActive() )
             nOptions |= SDRINSERT_DONTMARK;
 
-        // Set flag for ScDocument::UpdateChartListeners() which is
+        ::std::vector< ::rtl::OUString > aExcludedChartNames;
+        SCTAB nTab = GetViewData()->GetTabNo();
+        SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< sal_uInt16 >( nTab ) );
+        DBG_ASSERT( pPage, "Page?" );
+        if ( pPage )
+        {
+            ScChartHelper::GetChartNames( aExcludedChartNames, pPage );
+        }
+
+        // #89247# Set flag for ScDocument::UpdateChartListeners() which is
         // called during paste.
         if ( !bSameDocClipboard )
             GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( sal_True );


More information about the Libreoffice-commits mailing list