diff options
-rw-r--r-- | include/sfx2/objsh.hxx | 2 | ||||
-rw-r--r-- | include/svx/framelinkarray.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/autofmt.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/framelinkarray.cxx | 61 | ||||
-rw-r--r-- | svx/source/dialog/frmsel.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/table/autoformatpreview.cxx | 4 |
7 files changed, 37 insertions, 52 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index c44a56b858da..49c2c2325eff 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -295,7 +295,7 @@ public: * @return true if the initialization is successful, false otherwise. */ void DoInitUnitTest(); - bool DoInitNew( SfxMedium* pMedium=nullptr ); + bool DoInitNew(); bool DoLoad( SfxMedium* pMedium ); bool DoLoadExternal( SfxMedium* pMed ); bool DoSave(); diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx index d46b3762a331..10c8f4da2d1c 100644 --- a/include/svx/framelinkarray.hxx +++ b/include/svx/framelinkarray.hxx @@ -290,8 +290,8 @@ public: sal_Int32 GetHeight() const; /** Returns the output range of the cell (nCol,nRow). - Returns total output range of merged ranges, if bExpandMerged is true. */ - basegfx::B2DRange GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged ) const; + Returns total output range of merged ranges. */ + basegfx::B2DRange GetCellRange( sal_Int32 nCol, sal_Int32 nRow ) const; // return output range of given row/col range in logical coordinates basegfx::B2DRange GetB2DRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ) const; diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 93ca94034434..375294c05358 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -246,7 +246,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo Size aStrSize; sal_uInt16 nFmtIndex = GetFormatIndex( nCol, nRow ); - const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow, true )); + const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow )); Point aPos(basegfx::fround(cellRange.getMinX()), basegfx::fround(cellRange.getMinY())); sal_uInt16 nRightX = 0; bool bJustify = pCurData->GetIncludeJustify(); @@ -370,7 +370,7 @@ void ScAutoFmtPreview::DrawBackground(vcl::RenderContext& rRenderContext) rRenderContext.SetLineColor(); rRenderContext.SetFillColor( pItem->GetColor() ); - const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true )); + const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow )); rRenderContext.DrawRect( tools::Rectangle( basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()), diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 4c3dcf140b94..0000a9b4f6df 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -437,7 +437,7 @@ void SfxObjectShell::DoInitUnitTest() pMedium = new SfxMedium; } -bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) +bool SfxObjectShell::DoInitNew() /* [Description] This from SvPersist inherited virtual method is called to initialize @@ -460,15 +460,11 @@ bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) { ModifyBlocker_Impl aBlock( this ); - pMedium = pMed; - if ( !pMedium ) - { - pMedium = new SfxMedium; - } + pMedium = new SfxMedium; pMedium->CanDisposeStorage_Impl( true ); - if ( InitNew( pMed ? pMed->GetStorage() : uno::Reference < embed::XStorage >() ) ) + if ( InitNew( nullptr ) ) { // empty documents always get their macros from the user, so there is no reason to restrict access pImpl->aMacroMode.allowMacroExecution(); diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 27e227c678ad..aabce64ba78e 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -919,46 +919,35 @@ sal_Int32 Array::GetHeight() const return GetRowPosition( mxImpl->mnHeight ) - GetRowPosition( 0 ); } -basegfx::B2DRange Array::GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged ) const +basegfx::B2DRange Array::GetCellRange( sal_Int32 nCol, sal_Int32 nRow ) const { - if(bExpandMerged) - { - // get the Range of the fully expanded cell (if merged) - const sal_Int32 nFirstCol(mxImpl->GetMergedFirstCol( nCol, nRow )); - const sal_Int32 nFirstRow(mxImpl->GetMergedFirstRow( nCol, nRow )); - const sal_Int32 nLastCol(mxImpl->GetMergedLastCol( nCol, nRow )); - const sal_Int32 nLastRow(mxImpl->GetMergedLastRow( nCol, nRow )); - const Point aPoint( GetColPosition( nFirstCol ), GetRowPosition( nFirstRow ) ); - const Size aSize( GetColWidth( nFirstCol, nLastCol ) + 1, GetRowHeight( nFirstRow, nLastRow ) + 1 ); - tools::Rectangle aRect(aPoint, aSize); - - // adjust rectangle for partly visible merged cells - const Cell& rCell = CELL( nCol, nRow ); - - if( rCell.IsMerged() ) - { - // not *sure* what exactly this is good for, - // it is just a hard set extension at merged cells, - // probably *should* be included in the above extended - // GetColPosition/GetColWidth already. This might be - // added due to GetColPosition/GetColWidth not working - // correctly over PageChanges (if used), but not sure. - aRect.AdjustLeft( -(rCell.mnAddLeft) ); - aRect.AdjustRight(rCell.mnAddRight ); - aRect.AdjustTop( -(rCell.mnAddTop) ); - aRect.AdjustBottom(rCell.mnAddBottom ); - } + // get the Range of the fully expanded cell (if merged) + const sal_Int32 nFirstCol(mxImpl->GetMergedFirstCol( nCol, nRow )); + const sal_Int32 nFirstRow(mxImpl->GetMergedFirstRow( nCol, nRow )); + const sal_Int32 nLastCol(mxImpl->GetMergedLastCol( nCol, nRow )); + const sal_Int32 nLastRow(mxImpl->GetMergedLastRow( nCol, nRow )); + const Point aPoint( GetColPosition( nFirstCol ), GetRowPosition( nFirstRow ) ); + const Size aSize( GetColWidth( nFirstCol, nLastCol ) + 1, GetRowHeight( nFirstRow, nLastRow ) + 1 ); + tools::Rectangle aRect(aPoint, aSize); - return vcl::unotools::b2DRectangleFromRectangle(aRect); - } - else - { - const Point aPoint( GetColPosition( nCol ), GetRowPosition( nRow ) ); - const Size aSize( GetColWidth( nCol, nCol ) + 1, GetRowHeight( nRow, nRow ) + 1 ); - const tools::Rectangle aRect(aPoint, aSize); + // adjust rectangle for partly visible merged cells + const Cell& rCell = CELL( nCol, nRow ); - return vcl::unotools::b2DRectangleFromRectangle(aRect); + if( rCell.IsMerged() ) + { + // not *sure* what exactly this is good for, + // it is just a hard set extension at merged cells, + // probably *should* be included in the above extended + // GetColPosition/GetColWidth already. This might be + // added due to GetColPosition/GetColWidth not working + // correctly over PageChanges (if used), but not sure. + aRect.AdjustLeft( -(rCell.mnAddLeft) ); + aRect.AdjustRight(rCell.mnAddRight ); + aRect.AdjustTop( -(rCell.mnAddTop) ); + aRect.AdjustBottom(rCell.mnAddBottom ); } + + return vcl::unotools::b2DRectangleFromRectangle(aRect); } // return output range of given row/col range in logical coordinates diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index d2c67d75f970..fed0d59d0d6d 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -424,7 +424,7 @@ void FrameSelectorImpl::InitBorderGeometry() { for( nRow = 0, nRows = maArray.GetRowCount(); nRow < nRows; ++nRow ) { - const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true )); + const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow )); const tools::Rectangle aRect( basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()), basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())); @@ -484,7 +484,7 @@ void FrameSelectorImpl::InitBorderGeometry() for( nRow = 0, nRows = maArray.GetRowCount(); nRow < nRows; ++nRow ) { // the usable area between horizontal/vertical frame borders of current quadrant - const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true )); + const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow )); const tools::Rectangle aRect( basegfx::fround(aCellRange.getMinX()) + nClV + 1, basegfx::fround(aCellRange.getMinY()) + nClH + 1, basegfx::fround(aCellRange.getMaxX()) - nClV + 1, basegfx::fround(aCellRange.getMaxY()) - nClH + 1); diff --git a/sw/source/ui/table/autoformatpreview.cxx b/sw/source/ui/table/autoformatpreview.cxx index df18f3d5dbd9..ed101b60a81c 100644 --- a/sw/source/ui/table/autoformatpreview.cxx +++ b/sw/source/ui/table/autoformatpreview.cxx @@ -234,7 +234,7 @@ void AutoFormatPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nC SvtScriptedTextHelper aScriptedText(rRenderContext); Size aStrSize; sal_uInt8 nFormatIndex = GetFormatIndex(nCol, nRow); - const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow, true)); + const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow)); const tools::Rectangle cellRect( basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()), basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())); @@ -324,7 +324,7 @@ void AutoFormatPreview::DrawBackground(vcl::RenderContext& rRenderContext) rRenderContext.Push(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR); rRenderContext.SetLineColor(); rRenderContext.SetFillColor(aBrushItem.GetColor()); - const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow, true)); + const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow)); rRenderContext.DrawRect(tools::Rectangle( basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()), basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()))); |