summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-26 13:28:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-27 10:24:59 +0100
commit68e6706fb931ed2f53c08bc9c0a02cbb559c8c53 (patch)
treed24225c6da5eda1cf7070f419deb3d2f6f94c36a /sw/source
parentbe5af6cefea2fa43479ec6124e2c847956144a6d (diff)
drop old tools/gen.hxx methods in sw
Change-Id: I1db8954b86e9b2ec27ecc1f65e8ff7715612d756 Reviewed-on: https://gerrit.libreoffice.org/50363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/frmedt/fetab.cxx8
-rw-r--r--sw/source/core/inc/flyfrms.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx18
-rw-r--r--sw/source/core/text/inftxt.hxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx3
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx6
-rw-r--r--sw/source/core/view/vdraw.cxx3
-rw-r--r--sw/source/core/view/vprint.cxx5
-rw-r--r--sw/source/filter/xml/xmltexti.cxx19
-rw-r--r--sw/source/ui/frmdlg/column.cxx3
-rw-r--r--sw/source/uibase/config/viewopt.cxx11
-rw-r--r--sw/source/uibase/uiview/viewport.cxx9
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx10
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx3
14 files changed, 64 insertions, 40 deletions
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index bf312fe6a642..e0595f05fe17 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1455,8 +1455,8 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point
aRectFnSet.GetLeft(aTabRect);
const SwTwips nTop = aRectFnSet.GetTop(aTabRect);
- SwTwips& rPointX = aRectFnSet.IsVert() ? aPt.Y() : aPt.X();
- SwTwips& rPointY = aRectFnSet.IsVert() ? aPt.X() : aPt.Y();
+ SwTwips const rPointX = aRectFnSet.IsVert() ? aPt.Y() : aPt.X();
+ SwTwips const rPointY = aRectFnSet.IsVert() ? aPt.X() : aPt.Y();
const SwTwips nXDiff = aRectFnSet.XDiff( nLeft, rPointX ) * ( bRTL ? -1 : 1 );
const SwTwips nYDiff = aRectFnSet.YDiff( nTop, rPointY );
@@ -1485,9 +1485,9 @@ static const SwCellFrame *lcl_FindFrame( const SwLayoutFrame *pLay, const Point
if ( bCloseToRow && bCloseToCol )
aPt = bRTL ? aTabRect.TopRight() : aRectFnSet.GetPos(aTabRect);
else if ( bCloseToRow )
- rPointX = nLeft;
+ aRectFnSet.IsVert() ? aPt.setY(nLeft) : aPt.setX(nLeft);
else if ( bCloseToCol )
- rPointY = nTop;
+ aRectFnSet.IsVert() ? aPt.setX(nTop) : aPt.setY(nTop);
if ( !bCloseToRow && !bCloseToCol )
bSearchForFrameInTab = false;
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index c0fafd733efc..e59a7fe332b1 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -228,7 +228,7 @@ public:
void RegistFlys();
//see layact.cxx
- void AddRefOfst( long nOfst ) { aRef.Y() += nOfst; }
+ void AddRefOfst( long nOfst ) { aRef.AdjustY( nOfst ); }
// #i26791#
virtual void MakeObjPos() override;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index e79c37e4564e..bc9b35e7be7b 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6439,10 +6439,14 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
const bool bHori = rP1.Y() == rP2.Y();
// use pointers to member function in order to unify flow
- typedef long& (Point:: *pmfPt)();
- const pmfPt pmfPtX = &Point::X;
- const pmfPt pmfPtY = &Point::Y;
- const pmfPt pDirPt = bHori ? pmfPtX : pmfPtY;
+ typedef long (Point:: *pmfPtGet)() const;
+ typedef void (Point:: *pmfPtSet)(long);
+ const pmfPtGet pDirPtX = &Point::X;
+ const pmfPtGet pDirPtY = &Point::Y;
+ const pmfPtGet pDirPt = bHori ? pDirPtX : pDirPtY;
+ const pmfPtSet pDirPtSetX = &Point::setX;
+ const pmfPtSet pDirPtSetY = &Point::setY;
+ const pmfPtSet pDirPtSet = bHori ? pDirPtSetX : pDirPtSetY;
Point aP1( rP1 );
Point aP2( rP2 );
@@ -6511,10 +6515,10 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
const long nDrDirSz = bHori ? aDrSz.Width() : aDrSz.Height();
if ( (aP1.*pDirPt)() >= nDrDirPt && (aP1.*pDirPt)() <= nDrDirPt + nDrDirSz )
- (aP1.*pDirPt)() = nDrDirPt + nDrDirSz;
+ (aP1.*pDirPtSet)( nDrDirPt + nDrDirSz );
if ( (aP2.*pDirPt)() >= nDrDirPt && (aP1.*pDirPt)() < (nDrDirPt - 1) )
- (aP2.*pDirPt)() = nDrDirPt - 1;
+ (aP2.*pDirPtSet)( nDrDirPt - 1 );
}
aIter.Next();
}
@@ -6528,7 +6532,7 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
nullptr, nSubColor, gProp );
}
aP1 = aP2;
- (aP1.*pDirPt)() += 1;
+ (aP1.*pDirPtSet)( (aP1.*pDirPt)() + 1 );
aP2 = rP2;
}
}
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 78a896f9f231..91f7ef655fb0 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -391,9 +391,9 @@ public:
SwTextPaintInfo( SwTextFrame *pFrame, const SwRect &rPaint );
SwTwips X() const { return aPos.X(); }
- void X( const long nNew ) { aPos.X() = nNew; }
+ void X( const long nNew ) { aPos.setX(nNew); }
SwTwips Y() const { return aPos.Y(); }
- void Y( const SwTwips nNew ) { aPos.Y() = nNew; }
+ void Y( const SwTwips nNew ) { aPos.setY(nNew); }
SwTextFly& GetTextFly() { return aTextFly; }
const SwTextFly& GetTextFly() const { return aTextFly; }
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index cb59f4ddae79..f93ed469dd21 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2908,7 +2908,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
Size aSz( aSize.Width, aSize.Height );
if ( !aSz.Width() || !aSz.Height() )
{
- aSz.Width() = aSz.Height() = 5000;
+ aSz.setWidth(5000);
+ aSz.setHeight(5000);
aSz = OutputDevice::LogicToLogic(aSz,
MapMode(MapUnit::Map100thMM), MapMode(aRefMap));
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index edcc554a5d24..f7fdcc0efae4 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -97,8 +97,10 @@ void SwPagePreviewLayout::ClearPreviewLayoutSizes()
maMaxPageSize.setWidth( 0 );
maMaxPageSize.setHeight( 0 );
- maPreviewDocRect.Left() = maPreviewDocRect.Top() = 0;
- maPreviewDocRect.Right() = maPreviewDocRect.Bottom() = 0;
+ maPreviewDocRect.SetLeft( 0 );
+ maPreviewDocRect.SetTop( 0 );
+ maPreviewDocRect.SetRight( 0 );
+ maPreviewDocRect.SetBottom( 0 );
mnColWidth = mnRowHeight = 0;
mnPreviewLayoutWidth = mnPreviewLayoutHeight = 0;
}
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 0af8f1f0dc55..fabae25e722c 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -264,7 +264,8 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz )
pObj->Move( aSz );
// Don't let large objects disappear to the top
- aSz.Width() = aSz.Height() = 0;
+ aSz.setWidth(0);
+ aSz.setHeight(0);
if ( aObjBound.Right() < aDocRect.Left() )
aSz.setWidth( (aDocRect.Left() - aObjBound.Right()) + MINFLY );
if ( aObjBound.Bottom() < aDocRect.Top() )
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index d7884a6f190c..4683d9ad984d 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -210,7 +210,10 @@ void SwViewShell::InitPrt( OutputDevice *pOutDev )
pOutDev->SetFillColor();
}
else
- maPrtOffset.X() = maPrtOffset.Y() = 0;
+ {
+ maPrtOffset.setX(0);
+ maPrtOffset.setY(0);
+ }
if ( !mpWin )
mpOut = pOutDev;
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 0986e089a6ae..cf4f328c47b3 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -94,7 +94,7 @@ const XMLServiceMapEntry_Impl aServiceMap[] =
};
static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
sal_Int32 nHeight, sal_Int32 nWidth,
- long *pTwipHeight=nullptr, long *pTwipWidth=nullptr )
+ Size *pTwipSize = nullptr )
{
if( nWidth > 0 && nHeight > 0 )
{
@@ -110,10 +110,11 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet,
SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR );
rItemSet.Put( aAnchor );
- if( pTwipWidth )
- *pTwipWidth = nWidth;
- if( pTwipHeight )
- *pTwipHeight = nHeight;
+ if( pTwipSize )
+ {
+ pTwipSize->setWidth( nWidth );
+ pTwipSize->setHeight( nHeight);
+ }
}
static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObject >& xObj,
@@ -238,7 +239,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
Size aTwipSize( 0, 0 );
tools::Rectangle aVisArea( 0, 0, nWidth, nHeight );
lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
- &aTwipSize.Height(), &aTwipSize.Width() );
+ &aTwipSize );
SwFrameFormat *pFrameFormat = nullptr;
SwOLENode *pOLENd = nullptr;
@@ -550,7 +551,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink(
RES_FRMATR_END>{} );
Size aTwipSize( 0, 0 );
lcl_putHeightAndWidth( aItemSet, nHeight, nWidth,
- &aTwipSize.Height(), &aTwipSize.Width() );
+ &aTwipSize );
// We'll need a (valid) URL. If we don't have do not insert the link and return early.
// Copy URL into URL object on the way.
@@ -810,14 +811,14 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
{
sal_Int32 nVal = SIZE_NOT_SET;
rProp.maValue >>= nVal;
- aMargin.Width() = nVal;
+ aMargin.setWidth( nVal );
}
break;
case CTF_FRAME_MARGIN_VERT:
{
sal_Int32 nVal = SIZE_NOT_SET;
rProp.maValue >>= nVal;
- aMargin.Height() = nVal;
+ aMargin.setHeight( nVal );
}
break;
}
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 528570fd4699..15fe828b5692 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -1417,7 +1417,8 @@ void ColumnValueSet::UserDraw(const UserDrawEvent& rUDEvt)
Point aEnd(aBLPos.X() + nEnds[j], 0);
for( sal_uInt16 i = 0; i < 12; i ++)
{
- aStart.Y() = aEnd.Y() = aBLPos.Y() + nTop + i * nStep;
+ aStart.setY( aBLPos.Y() + nTop + i * nStep);
+ aEnd.setY( aStart.Y() );
pDev->DrawLine(aStart, aEnd);
}
}
diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index d291dc76ce50..90eb12c95c95 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -195,9 +195,16 @@ SwViewOption::SwViewOption() :
ViewOptFlags2::AnyRuler;
if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum())
- m_aSnapSize.Width() = m_aSnapSize.Height() = 720; // 1/2"
+ {
+ m_aSnapSize.setWidth(720); // 1/2"
+ m_aSnapSize.setHeight(720); // 1/2"
+
+ }
else
- m_aSnapSize.Width() = m_aSnapSize.Height() = 567; // 1 cm
+ {
+ m_aSnapSize.setWidth(567); // 1 cm
+ m_aSnapSize.setHeight(567); // 1 cm
+ }
m_nDivisionX = m_nDivisionY = 1;
m_bSelectionInReadonly = !utl::ConfigManager::IsFuzzing() && SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly();
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index c1ce4ffe4d1a..dba6610de692 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -101,12 +101,9 @@ static void lcl_GetPos(SwView const * pView,
if ( !bHori && nTmp > lSize )
lDelta -= nTmp - lSize;
- // use a reference to access/modify the correct coordinate
- // returned by accessors to non-const object
- long & rCoord = bHori ? rPos.X() : rPos.Y();
- rCoord += lDelta;
- if ( bBorder && rCoord < DOCUMENTBORDER )
- rCoord = DOCUMENTBORDER;
+ bHori ? rPos.AdjustX(lDelta) : rPos.AdjustY(lDelta);
+ if ( bBorder && (bHori ? rPos.X() : rPos.Y()) < DOCUMENTBORDER )
+ bHori ? rPos.setX(DOCUMENTBORDER) : rPos.setY(DOCUMENTBORDER);
}
// Set zero ruler
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 4fad05c26eda..4dab2bb0a4bf 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -2067,7 +2067,10 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aRectangle.AdjustLeft(aRect.Left() );
}
if(pFormat) // Range in frame - here you may up to the edge
- aRectangle.Left() = aRectangle.Right() = 0;
+ {
+ aRectangle.SetLeft(0);
+ aRectangle.SetRight(0);
+ }
else
{
// Move the rectangle to the correct absolute position.
@@ -2210,7 +2213,10 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aRectangle.SetRight( aPageLRSpace.GetRight() );
}
else
- aRectangle.Left() = aRectangle.Right() = 0;
+ {
+ aRectangle.SetLeft(0);
+ aRectangle.SetRight(0);
+ }
SfxRectangleItem aLR( SID_RULER_LR_MIN_MAX , aRectangle);
rSet.Put(aLR);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 697adae10c90..1bb5fedd7588 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -282,7 +282,8 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
Size aSz( pFrameMgr->GetSize() );
if ( !aSz.Width() || !aSz.Height() )
{
- aSz.Width() = aSz.Height() = 567;
+ aSz.setWidth(567);
+ aSz.setHeight( 567);
pFrameMgr->SetSize( aSz );
}
else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )