compilerplugins/clang/virtualdead.unusedparams.results |    6 -
 forms/source/richtext/attributedispatcher.cxx          |    2 
 forms/source/richtext/attributedispatcher.hxx          |    2 
 forms/source/richtext/richtextcontrol.cxx              |    2 
 forms/source/richtext/richtextcontrol.hxx              |    2 
 forms/source/richtext/richtextimplcontrol.cxx          |    6 -
 forms/source/richtext/textattributelistener.hxx        |    4 -
 sc/source/ui/view/viewfun2.cxx                         |   49 +++++++-------
 sc/source/ui/view/viewfun3.cxx                         |   30 ++++----
 sc/source/ui/view/viewfun4.cxx                         |    6 -
 sc/source/ui/view/viewfunc.cxx                         |   58 ++++++++---------
 sc/source/ui/view/viewutil.cxx                         |    4 -
 12 files changed, 83 insertions(+), 88 deletions(-)

New commits:
commit 1acc7c2fe72a48db0590a57ad447a47eb9d8a62e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Oct 18 15:40:37 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Oct 21 18:13:44 2019 +0200

    loplugin:virtualdead unused params in forms
    
    Change-Id: Iac26ba57443060474f4f33c4f449a69eca8c1063
    Reviewed-on: https://gerrit.libreoffice.org/81236
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/virtualdead.unusedparams.results 
b/compilerplugins/clang/virtualdead.unusedparams.results
index 685ee43e2b3c..e4f4db66e909 100644
--- a/compilerplugins/clang/virtualdead.unusedparams.results
+++ b/compilerplugins/clang/virtualdead.unusedparams.results
@@ -67,12 +67,6 @@ extensions/source/bibliography/loadlisteneradapter.hxx:110
 extensions/source/bibliography/loadlisteneradapter.hxx:111
     void bib::OLoadListener::_reloading(const struct 
com::sun::star::lang::EventObject &,)
     0
-forms/source/richtext/textattributelistener.hxx:32
-    void frm::ITextAttributeListener::onAttributeStateChanged(int,const struct 
frm::AttributeState &,)
-    10
-forms/source/richtext/textattributelistener.hxx:44
-    void frm::ITextSelectionListener::onSelectionChanged(const struct 
ESelection &,)
-    0
 include/canvas/base/bufferedgraphicdevicebase.hxx:230
     void canvas::BufferedGraphicDeviceBase::windowShown(const struct 
com::sun::star::lang::EventObject &,)
     0
diff --git a/forms/source/richtext/attributedispatcher.cxx 
b/forms/source/richtext/attributedispatcher.cxx
index dd81f3129cc7..0cabb526c75f 100644
--- a/forms/source/richtext/attributedispatcher.cxx
+++ b/forms/source/richtext/attributedispatcher.cxx
@@ -98,7 +98,7 @@ namespace frm
     }
 
 
-    void OAttributeDispatcher::onAttributeStateChanged( AttributeId 
_nAttributeId, const AttributeState& /*_rState*/ )
+    void OAttributeDispatcher::onAttributeStateChanged( AttributeId 
_nAttributeId )
     {
         OSL_ENSURE( _nAttributeId == m_nAttributeId, 
"OAttributeDispatcher::onAttributeStateChanged: wrong attribute!" );
 
diff --git a/forms/source/richtext/attributedispatcher.hxx 
b/forms/source/richtext/attributedispatcher.hxx
index 42a673209da1..685825f5c88f 100644
--- a/forms/source/richtext/attributedispatcher.hxx
+++ b/forms/source/richtext/attributedispatcher.hxx
@@ -61,7 +61,7 @@ namespace frm
         virtual void SAL_CALL dispatch( const css::util::URL& URL, const 
css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
 
         // ITextAttributeListener
-        virtual void    onAttributeStateChanged( AttributeId _nAttributeId, 
const AttributeState& _rState ) override;
+        virtual void    onAttributeStateChanged( AttributeId _nAttributeId ) 
override;
 
         // ORichTextFeatureDispatcher
         virtual void    disposing( ::osl::ClearableMutexGuard& 
_rClearBeforeNotify ) override;
diff --git a/forms/source/richtext/richtextcontrol.cxx 
b/forms/source/richtext/richtextcontrol.cxx
index 7e1b9bebcfd9..810d8e50c860 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -635,7 +635,7 @@ namespace frm
     }
 
 
-    void ORichTextPeer::onSelectionChanged( const ESelection& /*_rSelection*/ )
+    void ORichTextPeer::onSelectionChanged()
     {
         AttributeDispatchers::iterator aDispatcherPos = m_aDispatchers.find( 
SID_COPY );
         if ( aDispatcherPos != m_aDispatchers.end() )
diff --git a/forms/source/richtext/richtextcontrol.hxx 
b/forms/source/richtext/richtextcontrol.hxx
index 0c552848df5b..94aa8ce54e7c 100644
--- a/forms/source/richtext/richtextcontrol.hxx
+++ b/forms/source/richtext/richtextcontrol.hxx
@@ -117,7 +117,7 @@ namespace frm
         virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch 
> > SAL_CALL queryDispatches( const css::uno::Sequence< 
css::frame::DispatchDescriptor >& Requests ) override;
 
         // ITextSelectionListener
-        virtual void    onSelectionChanged( const ESelection& _rSelection ) 
override;
+        virtual void    onSelectionChanged() override;
 
     private:
         SingleAttributeDispatcher implCreateDispatcher( SfxSlotId _nSlotId, 
const css::util::URL& _rURL );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx 
b/forms/source/richtext/richtextimplcontrol.cxx
index 2aeedc11d2ef..844ba9d6e119 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -152,7 +152,7 @@ namespace frm
             if ( aCurrentSelection != m_aLastKnownSelection )
             {
                 m_aLastKnownSelection = aCurrentSelection;
-                m_pSelectionListener->onSelectionChanged( 
m_aLastKnownSelection );
+                m_pSelectionListener->onSelectionChanged();
             }
         }
     }
@@ -255,11 +255,11 @@ namespace frm
         // is there a dedicated listener for this particular attribute?
         AttributeListenerPool::const_iterator aListenerPos = 
m_aAttributeListeners.find( _nAttribute );
         if ( aListenerPos != m_aAttributeListeners.end( ) )
-            aListenerPos->second->onAttributeStateChanged( _nAttribute, 
_rState );
+            aListenerPos->second->onAttributeStateChanged( _nAttribute );
 
         // call our global listener, if there is one
         if ( m_pTextAttrListener )
-            m_pTextAttrListener->onAttributeStateChanged( _nAttribute, _rState 
);
+            m_pTextAttrListener->onAttributeStateChanged( _nAttribute );
     }
 
 
diff --git a/forms/source/richtext/textattributelistener.hxx 
b/forms/source/richtext/textattributelistener.hxx
index 0593c49968ef..c33ccbc0f932 100644
--- a/forms/source/richtext/textattributelistener.hxx
+++ b/forms/source/richtext/textattributelistener.hxx
@@ -29,7 +29,7 @@ namespace frm
     class ITextAttributeListener
     {
     public:
-        virtual void    onAttributeStateChanged( AttributeId _nAttributeId, 
const AttributeState& _rState ) = 0;
+        virtual void    onAttributeStateChanged( AttributeId _nAttributeId ) = 
0;
 
     protected:
         ~ITextAttributeListener() {}
@@ -41,7 +41,7 @@ namespace frm
     class ITextSelectionListener
     {
     public:
-        virtual void    onSelectionChanged( const ESelection& _rSelection ) = 
0;
+        virtual void    onSelectionChanged() = 0;
 
     protected:
         ~ITextSelectionListener() {}
commit c219bcdc1ef4972f67e994ce153e21c144e636e9
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Oct 21 15:50:56 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Oct 21 18:13:06 2019 +0200

    sc: rowcol: tdf#50916 convert viewfunc
    
    Change-Id: I7058a426514bc3761f22476841267925bb175837
    Reviewed-on: https://gerrit.libreoffice.org/81240
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 184eed8ba2ef..17e1290eeb13 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -167,7 +167,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, 
ScMarkData* pMarkData )
         if (bChanged)
             rDoc.SetDrawPageSize(nTab);
         if ( bPaint && bChanged )
-            pDocSh->PostPaint( 0, nPaintY, nTab, MAXCOL, MAXROW, nTab,
+            pDocSh->PostPaint( 0, nPaintY, nTab, rDoc.MaxCol(), rDoc.MaxRow(), 
nTab,
                                                 PaintPartFlags::Grid | 
PaintPartFlags::Left );
     }
 
@@ -220,7 +220,7 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW 
nEndRow )
     }
 
     if ( bChanged )
-        pDocSh->PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab,
+        pDocSh->PostPaint( 0, nStartRow, nTab, rDoc.MaxCol(), rDoc.MaxRow(), 
nTab,
                                             PaintPartFlags::Grid | 
PaintPartFlags::Left );
 
     if (comphelper::LibreOfficeKit::isActive())
@@ -624,12 +624,12 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
     SCROW nInsRow = nEndRow;
     if ( bRow && !bEndRowEmpty )
     {
-        if ( nInsRow < MAXROW )
+        if ( nInsRow < pDoc->MaxRow() )
         {
             ++nInsRow;
             while ( !pDoc->IsBlockEmpty( nTab, nStartCol, nInsRow, nEndCol, 
nInsRow ) )
             {
-                if ( nInsRow < MAXROW )
+                if ( nInsRow < pDoc->MaxRow() )
                 {
                     ++nInsRow;
                 }
@@ -650,12 +650,12 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
     SCCOL nInsCol = nEndCol;
     if ( bCol && !bEndColEmpty )
     {
-        if ( nInsCol < MAXCOL )
+        if ( nInsCol < pDoc->MaxCol() )
         {
             ++nInsCol;
             while ( !pDoc->IsBlockEmpty( nTab, nInsCol, nStartRow, nInsCol, 
nEndRow ) )
             {
-                if ( nInsCol < MAXCOL )
+                if ( nInsCol < pDoc->MaxCol() )
                 {
                     ++nInsCol;
                 }
@@ -956,7 +956,7 @@ void ScViewFunc::RemoveManualBreaks()
     {
         ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO ));
         pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
-        rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, 
InsertDeleteFlags::NONE, false, *pUndoDoc );
+        rDoc.CopyToDocument( 0,0,nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab, 
InsertDeleteFlags::NONE, false, *pUndoDoc );
         pDocSh->GetUndoManager()->AddUndoAction(
                                 std::make_unique<ScUndoRemoveBreaks>( pDocSh, 
nTab, std::move(pUndoDoc) ) );
     }
@@ -966,7 +966,7 @@ void ScViewFunc::RemoveManualBreaks()
 
     UpdatePageBreakData( true );
     pDocSh->SetDocumentModified();
-    pDocSh->PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PaintPartFlags::Grid );
+    pDocSh->PostPaint( 0,0,nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab, 
PaintPartFlags::Grid );
 }
 
 void ScViewFunc::SetPrintZoom(sal_uInt16 nScale)
@@ -1340,7 +1340,8 @@ void ScViewFunc::FillSimple( FillDir eDir )
             pDocSh->UpdateOle(&GetViewData());
             UpdateScrollBars();
 
-            bool bDoAutoSpell = 
pDocSh->GetDocument().GetDocOptions().IsAutoSpell();
+            auto& rDoc = pDocSh->GetDocument();
+            bool bDoAutoSpell = rDoc.GetDocOptions().IsAutoSpell();
             if ( bDoAutoSpell )
             {
                 // Copy AutoSpellData from above(left/right/below) if no 
selection.
@@ -1351,7 +1352,7 @@ void ScViewFunc::FillSimple( FillDir eDir )
                             aRange.aStart.IncRow(-1);
                     break;
                     case FILL_TO_TOP:
-                        if (aRange.aEnd.Row() < MAXROW && aRange.aStart.Row() 
== aRange.aEnd.Row())
+                        if (aRange.aEnd.Row() < rDoc.MaxRow() && 
aRange.aStart.Row() == aRange.aEnd.Row())
                             aRange.aEnd.IncRow(1);
                     break;
                     case FILL_TO_RIGHT:
@@ -1359,7 +1360,7 @@ void ScViewFunc::FillSimple( FillDir eDir )
                             aRange.aStart.IncCol(-1);
                     break;
                     case FILL_TO_LEFT:
-                        if (aRange.aEnd.Col() < MAXCOL && aRange.aStart.Col() 
== aRange.aEnd.Col())
+                        if (aRange.aEnd.Col() < rDoc.MaxCol() && 
aRange.aStart.Col() == aRange.aEnd.Col())
                             aRange.aEnd.IncCol(1);
                     break;
                 }
@@ -1670,19 +1671,19 @@ void ScViewFunc::FillCrossDblClick()
     SCCOL nEndX   = aRange.aEnd.Col();
     SCROW nEndY   = aRange.aEnd.Row();
 
-    if (nEndY >= MAXROW)
+    ScDocument* pDoc = GetViewData().GetDocument();
+
+    if (nEndY >= pDoc->MaxRow())
         // Nothing to fill.
         return;
 
-    ScDocument* pDoc = GetViewData().GetDocument();
-
     // Make sure the selection is not empty
     if ( pDoc->IsBlockEmpty( nTab, nStartX, nStartY, nEndX, nEndY ) )
         return;
 
     // If there is data in all columns immediately below the selection then
     // switch to overwriting fill.
-    SCROW nOverWriteEndRow = MAXROW;
+    SCROW nOverWriteEndRow = pDoc->MaxRow();
     for (SCCOL nCol = nStartX; nCol <= nEndX; ++nCol)
     {
         if (pDoc->HasData( nCol, nEndY + 1, nTab))
@@ -1720,7 +1721,7 @@ void ScViewFunc::FillCrossDblClick()
     // Non-overwriting fill follows.
 
     const bool bDataLeft = (nStartX > 0);
-    if (!bDataLeft && nEndX >= MAXCOL)
+    if (!bDataLeft && nEndX >= pDoc->MaxCol())
         // Absolutely no data left or right of selection.
         return;
 
@@ -1732,7 +1733,7 @@ void ScViewFunc::FillCrossDblClick()
     SCCOL nMovX = (bDataLeft ? nStartX - 1 : nEndX + 1);
     SCROW nMovY = nStartY;
     bool bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && pDoc->HasData( 
nMovX, nStartY + 1, nTab));
-    if (!bDataFound && bDataLeft && nEndX < MAXCOL)
+    if (!bDataFound && bDataLeft && nEndX < pDoc->MaxCol())
     {
         nMovX = nEndX + 1;  // check right
         bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && pDoc->HasData( 
nMovX, nStartY + 1, nTab));
@@ -1748,7 +1749,7 @@ void ScViewFunc::FillCrossDblClick()
             SCROW nY = nEndY + 1;
             // Get next row with data in this column.
             pDoc->FindAreaPos( nX, nY, nTab, SC_MOVE_DOWN);
-            if (nMovY == MAXROW && nY == MAXROW)
+            if (nMovY == pDoc->MaxRow() && nY == pDoc->MaxRow())
             {
                 // FindAreaPos() returns MAXROW also if there is no data at all
                 // from the start, so check if that contains data if the nearby
@@ -2445,7 +2446,7 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> 
&TheTabs, bool bRecord )
             else
                 pUndoDoc->AddUndoTab( nTab,nTab, true,true );       // incl. 
column/fow flags
 
-            rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, 
InsertDeleteFlags::ALL,false, *pUndoDoc );
+            rDoc.CopyToDocument(0,0,nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab, 
InsertDeleteFlags::ALL,false, *pUndoDoc );
             rDoc.GetName( nTab, aOldName );
             pUndoDoc->RenameTab( nTab, aOldName );
             if (rDoc.IsLinked(nTab))
@@ -2716,7 +2717,7 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
     for (i=0; i<nInsCount; i++)
         GetViewData().InsertTab(nTab);
     SetTabNo(nTab,true);
-    pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
+    pDocSh->PostPaint( 0,0,0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB,
                                 PaintPartFlags::Grid | PaintPartFlags::Top | 
PaintPartFlags::Left | PaintPartFlags::Extras );
 
     SfxApplication* pSfxApp = SfxGetpApp();
@@ -2853,7 +2854,7 @@ void ScViewFunc::MoveTable(
                 nErrVal = 0;        // total error
                 break;  // for
             }
-            ScRange aRange( 0, 0, TheTabs[j], MAXCOL, MAXROW, TheTabs[j] );
+            ScRange aRange( 0, 0, TheTabs[j], pDoc->MaxCol(), pDoc->MaxRow(), 
TheTabs[j] );
             aParam.maRanges.push_back(aRange);
         }
         pDoc->SetClipParam(aParam);
@@ -2935,7 +2936,7 @@ void ScViewFunc::MoveTable(
 
                 pDestViewSh->TabChanged();      // pages on the drawing layer
             }
-            pDestShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
+            pDestShell->PostPaint( 0,0,0, pDoc->MaxCol(), pDoc->MaxRow(), 
MAXTAB,
                                     PaintPartFlags::Grid | PaintPartFlags::Top 
| PaintPartFlags::Left |
                                     PaintPartFlags::Extras | 
PaintPartFlags::Size );
             //  PaintPartFlags::Size for outline
@@ -3116,7 +3117,7 @@ void ScViewFunc::ShowTable( const std::vector<OUString>& 
rNames )
         {
             pDocSh->GetUndoManager()->AddUndoAction( 
std::make_unique<ScUndoShowHideTab>( pDocSh, undoTabs, true ) );
         }
-        pDocSh->PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Extras);
+        pDocSh->PostPaint(0,0,0,rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, 
PaintPartFlags::Extras);
         pDocSh->SetDocumentModified();
     }
 }
@@ -3162,7 +3163,7 @@ void ScViewFunc::HideTable( const ScMarkData& rMark )
 
         //  Update views
         SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
-        pDocSh->PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Extras);
+        pDocSh->PostPaint(0,0,0,rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, 
PaintPartFlags::Extras);
         pDocSh->SetDocumentModified();
     }
 }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e39cdd488fac..7a39f5037fa2 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -937,7 +937,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
         // include filtered rows until TransposeClip can skip them
         bIncludeFiltered = true;
         pClipDoc->GetClipArea( nX, nY, true );
-        if ( nY > static_cast<sal_Int32>(MAXCOL) )                      // too 
many lines for transpose
+        if ( nY > static_cast<sal_Int32>(pClipDoc->MaxCol()) )                 
     // too many lines for transpose
         {
             ErrorMessage(STR_PASTE_FULL);
             return false;
@@ -1187,7 +1187,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
     nUndoEndCol = sal::static_int_cast<SCCOL>( nUndoEndCol + nEndCol );
     nUndoEndRow = sal::static_int_cast<SCROW>( nUndoEndRow + nEndRow ); // 
destination area, expanded for merged cells
 
-    if (nUndoEndCol>MAXCOL || nUndoEndRow>MAXROW)
+    if (nUndoEndCol>pClipDoc->MaxCol() || nUndoEndRow>pClipDoc->MaxRow())
     {
         ErrorMessage(STR_PASTE_FULL);
         return false;
@@ -1243,8 +1243,8 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
             pChangeTrack->ResetLastCut();   // no more cut-mode
     }
 
-    bool bColInfo = ( nStartRow==0 && nEndRow==MAXROW );
-    bool bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL );
+    bool bColInfo = ( nStartRow==0 && nEndRow==pDoc->MaxRow() );
+    bool bRowInfo = ( nStartCol==0 && nEndCol==pDoc->MaxCol() );
 
     ScDocumentUniquePtr pUndoDoc;
     std::unique_ptr<ScDocument> pRefUndoDoc;
@@ -1401,7 +1401,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
             //      not charts?
             pUndoDoc->AddUndoTab( 0, nTabCount-1 );
             pRefUndoDoc->DeleteArea( nStartCol, nStartRow, nEndCol, nEndRow, 
aFilteredMark, InsertDeleteFlags::ALL );
-            pRefUndoDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
+            pRefUndoDoc->CopyToDocument( 0,0,0, pUndoDoc->MaxCol(), 
pUndoDoc->MaxRow(), nTabCount-1,
                                             InsertDeleteFlags::FORMULA, false, 
*pUndoDoc );
             pRefUndoDoc.reset();
         }
@@ -1437,12 +1437,12 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags 
nFlags, ScDocument* pClipDoc,
     if (bColInfo)
     {
         nPaint |= PaintPartFlags::Top;
-        nUndoEndCol = MAXCOL;               // just for drawing !
+        nUndoEndCol = pDoc->MaxCol();               // just for drawing !
     }
     if (bRowInfo)
     {
         nPaint |= PaintPartFlags::Left;
-        nUndoEndRow = MAXROW;               // just for drawing !
+        nUndoEndRow = pDoc->MaxRow();               // just for drawing !
     }
     pDocSh->PostPaint(
         ScRange(nStartCol, nStartRow, nStartTab, nUndoEndCol, nUndoEndRow, 
nEndTab),
@@ -1486,7 +1486,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
 
     if (bTranspose)
     {
-        if (static_cast<SCROW>(rCurPos.Col()) + nRowSize-1 > 
static_cast<SCROW>(MAXCOL))
+        if (static_cast<SCROW>(rCurPos.Col()) + nRowSize-1 > 
static_cast<SCROW>(pClipDoc->MaxCol()))
         {
             ErrorMessage(STR_PASTE_FULL);
             return false;
@@ -1547,7 +1547,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
             return false;
     }
 
-    bool bRowInfo = ( aMarkedRange.aStart.Col()==0 && 
aMarkedRange.aEnd.Col()==MAXCOL );
+    bool bRowInfo = ( aMarkedRange.aStart.Col()==0 && 
aMarkedRange.aEnd.Col()==pClipDoc->MaxCol() );
     ScDocumentUniquePtr pUndoDoc;
     if (pDoc->IsUndoEnabled())
     {
@@ -1593,7 +1593,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
     }
 
     if (bRowInfo)
-        pDocSh->PostPaint(aMarkedRange.aStart.Col(), 
aMarkedRange.aStart.Row(), nTab1, MAXCOL, MAXROW, nTab1, 
PaintPartFlags::Grid|PaintPartFlags::Left);
+        pDocSh->PostPaint(aMarkedRange.aStart.Col(), 
aMarkedRange.aStart.Row(), nTab1, pClipDoc->MaxCol(), pClipDoc->MaxRow(), 
nTab1, PaintPartFlags::Grid|PaintPartFlags::Left);
     else
     {
         ScRange aTmp = aMarkedRange;
@@ -1761,7 +1761,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
     // Refresh the range that includes all pasted ranges.  We only need to
     // refresh the current sheet.
     PaintPartFlags nPaint = PaintPartFlags::Grid;
-    bool bRowInfo = (aSrcRange.aStart.Col()==0 &&  
aSrcRange.aEnd.Col()==MAXCOL);
+    bool bRowInfo = (aSrcRange.aStart.Col()==0 &&  
aSrcRange.aEnd.Col()==pClipDoc->MaxCol());
     if (bRowInfo)
         nPaint |= PaintPartFlags::Left;
     pDocSh->PostPaint(aRanges, nPaint);
@@ -1974,8 +1974,8 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
                         pChangeTrack->ResetLastCut();   // no more cut-mode
         }
         ScRange aUserRange( nStartCol, nCurrentRow, nStartTab, nEndCol, 
nCurrentRow, nEndTab );
-        bool bColInfo = ( nStartRow==0 && nEndRow==MAXROW );
-        bool bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL );
+        bool bColInfo = ( nStartRow==0 && nEndRow==pDoc->MaxRow() );
+        bool bRowInfo = ( nStartCol==0 && nEndCol==pDoc->MaxCol() );
         SCCOL nUndoEndCol = nStartCol+aColLength-1;
         SCROW nUndoEndRow = nCurrentRow;
 
@@ -2009,12 +2009,12 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
         if (bColInfo)
         {
                 nPaint |= PaintPartFlags::Top;
-                nUndoEndCol = MAXCOL;                           // just for 
drawing !
+                nUndoEndCol = pDoc->MaxCol();                           // 
just for drawing !
         }
         if (bRowInfo)
         {
                 nPaint |= PaintPartFlags::Left;
-                nUndoEndRow = MAXROW;                           // just for 
drawing !
+                nUndoEndRow = pDoc->MaxRow();                           // 
just for drawing !
         }
 
         pDocSh->PostPaint(
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index fdde597eade9..c15cebe98098 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -110,8 +110,8 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
         if (nParCnt)
         {
             SCROW nEndRow = nStartRow + static_cast<SCROW>(nParCnt) - 1;
-            if (nEndRow > MAXROW)
-                nEndRow = MAXROW;
+            if (nEndRow > rDoc.MaxRow())
+                nEndRow = rDoc.MaxRow();
 
             ScDocumentUniquePtr pUndoDoc;
             if (bRecord)
@@ -130,7 +130,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
             {
                 std::unique_ptr<EditTextObject> 
pObject(pEngine->CreateTextObject(n));
                 EnterData(nStartCol, nRow, nTab, *pObject, true);
-                if( ++nRow > MAXROW )
+                if( ++nRow > rDoc.MaxRow() )
                     break;
             }
             rDoc.EnableUndo(bUndoEnabled);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 5c3d28ad871f..5bd55068f04f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -779,8 +779,8 @@ void ScViewFunc::EnterMatrix( const OUString& rString, 
::formula::FormulaGrammar
         SCSIZE nSizeY;
         aFormCell.GetResultDimensions( nSizeX, nSizeY );
         if ( nSizeX != 0 && nSizeY != 0 &&
-             nCol+nSizeX-1 <= sal::static_int_cast<SCSIZE>(MAXCOL) &&
-             nRow+nSizeY-1 <= sal::static_int_cast<SCSIZE>(MAXROW) )
+             nCol+nSizeX-1 <= sal::static_int_cast<SCSIZE>(pDoc->MaxCol()) &&
+             nRow+nSizeY-1 <= sal::static_int_cast<SCSIZE>(pDoc->MaxRow()) )
         {
             ScRange aResult( nCol, nRow, nTab,
                              sal::static_int_cast<SCCOL>(nCol+nSizeX-1),
@@ -1431,7 +1431,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const 
SfxStyleSheetBase* pStyleSheet )
                                 rViewData.GetZoomX(),
                                 rViewData.GetZoomY() );
 
-    pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, 
PaintPartFlags::Grid|PaintPartFlags::Left );
+    pDocSh->PostPaint( 0,0,0, pDoc->MaxCol(), pDoc->MaxRow(), MAXTAB, 
PaintPartFlags::Grid|PaintPartFlags::Left );
     aModificator.SetDocumentModified();
 
     ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
@@ -1457,7 +1457,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const 
SfxStyleSheetBase* pStyleSheet )
                                 rViewData.GetZoomX(),
                                 rViewData.GetZoomY() );
 
-    pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, 
PaintPartFlags::Grid|PaintPartFlags::Left );
+    pDocSh->PostPaint( 0,0,0, pDoc->MaxCol(), pDoc->MaxRow(), MAXTAB, 
PaintPartFlags::Grid|PaintPartFlags::Left );
     aModificator.SetDocumentModified();
 
     ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
@@ -1767,7 +1767,7 @@ void ScViewFunc::DeleteMulti( bool bRows )
         if ( bRows )
         {
             nStartCol = 0;
-            nEndCol   = MAXCOL;
+            nEndCol   = rDoc.MaxCol();
             nStartRow = static_cast<SCROW>(nStart);
             nEndRow   = static_cast<SCROW>(nEnd);
         }
@@ -1776,14 +1776,14 @@ void ScViewFunc::DeleteMulti( bool bRows )
             nStartCol = static_cast<SCCOL>(nStart);
             nEndCol   = static_cast<SCCOL>(nEnd);
             nStartRow = 0;
-            nEndRow   = MAXROW;
+            nEndRow   = rDoc.MaxRow();
         }
 
         // cell protection (only needed for first range, as all following 
cells are moved)
         if (i == 0)
         {
             // test to the end of the sheet
-            ScEditableTester aTester( &rDoc, nTab, nStartCol, nStartRow, 
MAXCOL, MAXROW );
+            ScEditableTester aTester( &rDoc, nTab, nStartCol, nStartRow, 
rDoc.MaxCol(), rDoc.MaxRow() );
             if (!aTester.IsEditable())
                 pErrorId = aTester.GetMessageId();
         }
@@ -1833,17 +1833,17 @@ void ScViewFunc::DeleteMulti( bool bRows )
             SCCOLROW nStart = rSpan.mnStart;
             SCCOLROW nEnd = rSpan.mnEnd;
             if (bRows)
-                rDoc.CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, 
InsertDeleteFlags::ALL,false,*pUndoDoc );
+                rDoc.CopyToDocument( 0,nStart,nTab, rDoc.MaxCol(), nEnd,nTab, 
InsertDeleteFlags::ALL,false,*pUndoDoc );
             else
                 rDoc.CopyToDocument( static_cast<SCCOL>(nStart),0,nTab,
-                        static_cast<SCCOL>(nEnd),MAXROW,nTab,
+                        static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab,
                         InsertDeleteFlags::ALL,false,*pUndoDoc );
         }
 
         //  all Formulas because of references
         SCTAB nTabCount = rDoc.GetTableCount();
         pUndoDoc->AddUndoTab( 0, nTabCount-1 );
-        rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,MAXTAB, 
InsertDeleteFlags::FORMULA,false,*pUndoDoc );
+        rDoc.CopyToDocument( 0,0,0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB, 
InsertDeleteFlags::FORMULA,false,*pUndoDoc );
 
         pUndoData.reset(new ScRefUndoData( &rDoc ));
 
@@ -1859,13 +1859,13 @@ void ScViewFunc::DeleteMulti( bool bRows )
 
         if (bRows)
         {
-            rDoc.DeleteObjectsInArea(0, nStart, MAXCOL, nEnd, aFuncMark, true);
-            rDoc.DeleteRow(0, nTab, MAXCOL, nTab, nStart, 
static_cast<SCSIZE>(nEnd - nStart + 1));
+            rDoc.DeleteObjectsInArea(0, nStart, rDoc.MaxCol(), nEnd, 
aFuncMark, true);
+            rDoc.DeleteRow(0, nTab, rDoc.MaxCol(), nTab, nStart, 
static_cast<SCSIZE>(nEnd - nStart + 1));
         }
         else
         {
-            rDoc.DeleteObjectsInArea(nStart, 0, nEnd, MAXROW, aFuncMark, true);
-            rDoc.DeleteCol(0, nTab, MAXROW, nTab, static_cast<SCCOL>(nStart), 
static_cast<SCSIZE>(nEnd - nStart + 1));
+            rDoc.DeleteObjectsInArea(nStart, 0, nEnd, rDoc.MaxRow(), 
aFuncMark, true);
+            rDoc.DeleteCol(0, nTab, rDoc.MaxRow(), nTab, 
static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd - nStart + 1));
         }
     }
 
@@ -1874,8 +1874,8 @@ void ScViewFunc::DeleteMulti( bool bRows )
         SCCOLROW nFirstStart = aSpans[0].mnStart;
         SCCOL nStartCol = bRows ? 0 : static_cast<SCCOL>(nFirstStart);
         SCROW nStartRow = bRows ? static_cast<SCROW>(nFirstStart) : 0;
-        SCCOL nEndCol = MAXCOL;
-        SCROW nEndRow = MAXROW;
+        SCCOL nEndCol = rDoc.MaxCol();
+        SCROW nEndRow = rDoc.MaxRow();
 
         rDoc.RemoveFlagsTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, 
ScMF::Hor | ScMF::Ver );
         rDoc.ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab, true );
@@ -1888,19 +1888,19 @@ void ScViewFunc::DeleteMulti( bool bRows )
                 pDocSh, bRows, bNeedRefresh, nTab, aSpans, 
std::move(pUndoDoc), std::move(pUndoData)));
     }
 
-    if (!AdjustRowHeight(0, MAXROW))
+    if (!AdjustRowHeight(0, rDoc.MaxRow()))
     {
         if (bRows)
         {
             pDocSh->PostPaint(
                 0, aSpans[0].mnStart, nTab,
-                MAXCOL, MAXROW, nTab, (PaintPartFlags::Grid | 
PaintPartFlags::Left));
+                rDoc.MaxCol(), rDoc.MaxRow(), nTab, (PaintPartFlags::Grid | 
PaintPartFlags::Left));
         }
         else
         {
             pDocSh->PostPaint(
                 static_cast<SCCOL>(aSpans[0].mnStart), 0, nTab,
-                MAXCOL, MAXROW, nTab, (PaintPartFlags::Grid | 
PaintPartFlags::Top));
+                rDoc.MaxCol(), rDoc.MaxRow(), nTab, (PaintPartFlags::Grid | 
PaintPartFlags::Top));
         }
     }
 
@@ -2039,9 +2039,9 @@ void ScViewFunc::SetWidthOrHeight(
                 bool bOnlyMatrix;
                 bool bIsBlockEditable;
                 if (bWidth)
-                    bIsBlockEditable = rDoc.IsBlockEditable(nTab, 
rRange.mnStart, 0, rRange.mnEnd, MAXROW, &bOnlyMatrix);
+                    bIsBlockEditable = rDoc.IsBlockEditable(nTab, 
rRange.mnStart, 0, rRange.mnEnd, rDoc.MaxRow(), &bOnlyMatrix);
                 else
-                    bIsBlockEditable = rDoc.IsBlockEditable(nTab, 0, 
rRange.mnStart, MAXCOL, rRange.mnEnd, &bOnlyMatrix);
+                    bIsBlockEditable = rDoc.IsBlockEditable(nTab, 0, 
rRange.mnStart, rDoc.MaxCol(), rRange.mnEnd, &bOnlyMatrix);
                 return bIsBlockEditable || bOnlyMatrix;
             });
         if (!bAllowed)
@@ -2086,7 +2086,7 @@ void ScViewFunc::SetWidthOrHeight(
                 else
                     pUndoDoc->AddUndoTab( nTab, nTab, true );
                 rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
-                        static_cast<SCCOL>(nEnd), MAXROW, nTab, 
InsertDeleteFlags::NONE,
+                        static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, 
InsertDeleteFlags::NONE,
                         false, *pUndoDoc );
             }
             else
@@ -2095,7 +2095,7 @@ void ScViewFunc::SetWidthOrHeight(
                     pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
                 else
                     pUndoDoc->AddUndoTab( nTab, nTab, false, true );
-                rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, 
InsertDeleteFlags::NONE, false, *pUndoDoc );
+                rDoc.CopyToDocument( 0, nStart, nTab, rDoc.MaxCol(), nEnd, 
nTab, InsertDeleteFlags::NONE, false, *pUndoDoc );
             }
         }
 
@@ -2262,21 +2262,21 @@ void ScViewFunc::SetWidthOrHeight(
             if (bWidth)
             {
                 if (rDoc.HasAttrib( static_cast<SCCOL>(nStart),0,nTab,
-                            static_cast<SCCOL>(nEnd),MAXROW,nTab,
+                            static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab,
                             HasAttrFlags::Merged | HasAttrFlags::Overlapped ))
                     nStart = 0;
                 if (nStart > 0)             // go upwards because of Lines and 
cursor
                     --nStart;
                 pDocSh->PostPaint( static_cast<SCCOL>(nStart), 0, nTab,
-                        MAXCOL, MAXROW, nTab, PaintPartFlags::Grid | 
PaintPartFlags::Top );
+                        rDoc.MaxCol(), rDoc.MaxRow(), nTab, 
PaintPartFlags::Grid | PaintPartFlags::Top );
             }
             else
             {
-                if (rDoc.HasAttrib( 0,nStart,nTab, MAXCOL,nEnd,nTab, 
HasAttrFlags::Merged | HasAttrFlags::Overlapped ))
+                if (rDoc.HasAttrib( 0,nStart,nTab, rDoc.MaxCol(), nEnd,nTab, 
HasAttrFlags::Merged | HasAttrFlags::Overlapped ))
                     nStart = 0;
                 if (nStart != 0)
                     --nStart;
-                pDocSh->PostPaint( 0, nStart, nTab, MAXCOL, MAXROW, nTab, 
PaintPartFlags::Grid | PaintPartFlags::Left );
+                pDocSh->PostPaint( 0, nStart, nTab, rDoc.MaxCol(), 
rDoc.MaxRow(), nTab, PaintPartFlags::Grid | PaintPartFlags::Left );
             }
         }
 
@@ -2350,9 +2350,9 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool 
bOptimal )
 
     bool bAllowed, bOnlyMatrix;
     if ( eDir == DIR_LEFT || eDir == DIR_RIGHT )
-        bAllowed = rDoc.IsBlockEditable( nTab, nCol,0, nCol,MAXROW, 
&bOnlyMatrix );
+        bAllowed = rDoc.IsBlockEditable( nTab, nCol,0, nCol,rDoc.MaxRow(), 
&bOnlyMatrix );
     else
-        bAllowed = rDoc.IsBlockEditable( nTab, 0,nRow, MAXCOL,nRow, 
&bOnlyMatrix );
+        bAllowed = rDoc.IsBlockEditable( nTab, 0,nRow, rDoc.MaxCol(), nRow, 
&bOnlyMatrix );
     if ( !bAllowed && !bOnlyMatrix )
     {
         ErrorMessage(STR_PROTECTIONERR);
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 2cbc0ec22ffe..b4cf5faac6c1 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -261,10 +261,10 @@ bool ScViewUtil::FitToUnfilteredRows( ScRange & rRange, 
const ScDocument * pDoc,
     // Always fit the range on its first sheet.
     OSL_ENSURE( bOneTabOnly, "ScViewUtil::ExtendToUnfilteredRows: works only 
on one sheet");
     SCROW nStartRow = rRange.aStart.Row();
-    SCROW nLastRow = pDoc->LastNonFilteredRow(nStartRow, MAXROW, nTab);
+    SCROW nLastRow = pDoc->LastNonFilteredRow(nStartRow, pDoc->MaxRow(), nTab);
     if (ValidRow(nLastRow))
         rRange.aEnd.SetRow(nLastRow);
-    SCROW nCount = pDoc->CountNonFilteredRows(nStartRow, MAXROW, nTab);
+    SCROW nCount = pDoc->CountNonFilteredRows(nStartRow, pDoc->MaxRow(), nTab);
     return static_cast<size_t>(nCount) == nRows && bOneTabOnly;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to