summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-10 15:03:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-13 08:17:42 +0200
commitb5c2f9dee910d26a07d3f796c882e6292ef5e8db (patch)
tree1ec38e7c6f56f7bd6ba8dbe7a96b7e2c6682d823 /sw
parente14aab54bdfec517aabea2c7afb5b36bd6ebc36b (diff)
convert CurRectType to scoped enum
and drop read-only enumerators RECT_OUTTABSECTION_PRT RECT_HEADERFOOTER_PRT Change-Id: I2d7d159cf5f1a2022c015e37df4aa71cae1e266c
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fesh.hxx27
-rw-r--r--sw/source/core/frmedt/fews.cxx32
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx2
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx4
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx2
-rw-r--r--sw/source/ui/misc/num.cxx4
-rw-r--r--sw/source/uibase/shells/frmsh.cxx8
-rw-r--r--sw/source/uibase/shells/grfsh.cxx12
-rw-r--r--sw/source/uibase/shells/tabsh.cxx2
-rw-r--r--sw/source/uibase/shells/textsh.cxx6
-rw-r--r--sw/source/uibase/uiview/swcli.cxx6
-rw-r--r--sw/source/uibase/uiview/view2.cxx4
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx6
-rw-r--r--sw/source/uibase/uiview/viewport.cxx2
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx74
-rw-r--r--sw/source/uibase/utlui/uitool.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx14
18 files changed, 105 insertions, 106 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 4b5af6012089..d3f2db36c79d 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -135,22 +135,19 @@ enum ObjCntType
};
//For GetAnyCurRect
-enum CurRectType
+enum class CurRectType
{
- RECT_PAGE, ///< Rect of current page.
- RECT_PAGE_CALC, ///< ... page will be formatted if required.
- RECT_PAGE_PRT, ///< Rect of current PrtArea of page.
- RECT_FRM, ///< Rect of current frame.
- RECT_FLY_EMBEDDED, ///< Rect of current FlyFrame.
- RECT_FLY_PRT_EMBEDDED, ///< Rect of PrtArea of FlyFrame
- RECT_SECTION, ///< Rect of current section.
- RECT_OUTTABSECTION, ///< Rect of current section but outside of table.
- RECT_SECTION_PRT, ///< Rect of current PrtArea of section.
- RECT_OUTTABSECTION_PRT, ///< Rect of current PrtArea of section but outside table.
- RECT_HEADERFOOTER, ///< Rect of current header/footer
- RECT_HEADERFOOTER_PRT, ///< Rect of PrtArea of current headers/footers
-
- RECT_PAGES_AREA ///< Rect covering the pages area
+ Page, ///< Rect of current page.
+ PageCalc, ///< ... page will be formatted if required.
+ PagePrt, ///< Rect of current PrtArea of page.
+ Frame, ///< Rect of current frame.
+ FlyEmbedded, ///< Rect of current FlyFrame.
+ FlyEmbeddedPrt, ///< Rect of PrtArea of FlyFrame
+ Section, ///< Rect of current section.
+ SectionOutsideTable, ///< Rect of current section but outside of table.
+ SectionPrt, ///< Rect of current PrtArea of section.
+ HeaderFooter, ///< Rect of current header/footer
+ PagesArea ///< Rect covering the pages area
};
struct SwGetCurColNumPara
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 3f596e2d370d..3c315709054c 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -111,50 +111,52 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
bool bFrame = true;
switch ( eType )
{
- case RECT_PAGE_PRT: bFrame = false;
+ case CurRectType::PagePrt: bFrame = false;
SAL_FALLTHROUGH;
- case RECT_PAGE : pFrame = pFrame->FindPageFrame();
+ case CurRectType::Page : pFrame = pFrame->FindPageFrame();
break;
- case RECT_PAGE_CALC: pFrame->Calc(Imp()->GetShell()->GetOut());
+ case CurRectType::PageCalc:pFrame->Calc(Imp()->GetShell()->GetOut());
pFrame = pFrame->FindPageFrame();
pFrame->Calc(Imp()->GetShell()->GetOut());
break;
- case RECT_FLY_PRT_EMBEDDED: bFrame = false;
+ case CurRectType::FlyEmbeddedPrt:
+ bFrame = false;
SAL_FALLTHROUGH;
- case RECT_FLY_EMBEDDED: pFrame = xObj.is() ? FindFlyFrame( xObj )
+ case CurRectType::FlyEmbedded:
+ pFrame = xObj.is() ? FindFlyFrame( xObj )
: pFrame->IsFlyFrame()
? pFrame
: pFrame->FindFlyFrame();
break;
- case RECT_OUTTABSECTION_PRT:
- case RECT_OUTTABSECTION : if( pFrame->IsInTab() )
+ case CurRectType::SectionOutsideTable :
+ if( pFrame->IsInTab() )
pFrame = pFrame->FindTabFrame();
else {
OSL_FAIL( "Missing Table" );
}
SAL_FALLTHROUGH;
- case RECT_SECTION_PRT:
- case RECT_SECTION: if( pFrame->IsInSct() )
+ case CurRectType::SectionPrt:
+ case CurRectType::Section:
+ if( pFrame->IsInSct() )
pFrame = pFrame->FindSctFrame();
else {
OSL_FAIL( "Missing section" );
}
- if( RECT_OUTTABSECTION_PRT == eType ||
- RECT_SECTION_PRT == eType )
+ if( CurRectType::SectionPrt == eType )
bFrame = false;
break;
- case RECT_HEADERFOOTER_PRT: bFrame = false;
- SAL_FALLTHROUGH;
- case RECT_HEADERFOOTER: if( nullptr == (pFrame = pFrame->FindFooterOrHeader()) )
+ case CurRectType::HeaderFooter:
+ if( nullptr == (pFrame = pFrame->FindFooterOrHeader()) )
return GetLayout()->Frame();
break;
- case RECT_PAGES_AREA: return GetLayout()->GetPagesArea();
+ case CurRectType::PagesArea:
+ return GetLayout()->GetPagesArea();
default: break;
}
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 7e1428dcac40..6fe5ddeef3d0 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -186,7 +186,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
else if( nId == m_nParaStd )
{
aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,
- static_cast< sal_uInt16 >(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width()) ));
+ static_cast< sal_uInt16 >(rSh.GetAnyCurRect(CurRectType::PagePrt).Width()) ));
if (!bDrawParaDlg)
{
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index b4487598e7fa..8a0a68a6674a 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -719,8 +719,8 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void )
else
nWidth = rSh.GetAnyCurRect(
(FrameTypeFlags::FLY_ANY & rSh.GetFrameType( nullptr, true ))
- ? RECT_FLY_PRT_EMBEDDED
- : RECT_PAGE_PRT ).Width();
+ ? CurRectType::FlyEmbeddedPrt
+ : CurRectType::PagePrt ).Width();
SwTabCols aTabCols;
aTabCols.SetRight( nWidth );
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index f2f9ff4be585..8e8a203d59f0 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -420,7 +420,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
{
//set the cursor to the desired position - if no text content is here then
//new paragraphs are inserted
- const SwRect& rPageRect = rShell.GetAnyCurRect(RECT_PAGE);
+ const SwRect& rPageRect = rShell.GetAnyCurRect(CurRectType::Page);
const Point aGreetingPos( DEFAULT_LEFT_DISTANCE + rPageRect.Left(), GREETING_TOP_DISTANCE );
const bool bRet = rShell.SetShadowCursorPos( aGreetingPos, FILL_SPACE );
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index f1f88422ec91..7c1569b16d0c 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -2191,7 +2191,7 @@ void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh)
//set sensible values at the preview
m_pPreviewWin->SetAdjust(SVX_ADJUST_BLOCK);
m_pPreviewWin->SetLastLine(SVX_ADJUST_BLOCK);
- const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE );
+ const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page );
Size aPageSize(rPageRect.Width(), rPageRect.Height());
m_pPreviewWin->SetSize(aPageSize);
}
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 60a11be3afb6..757b2d78c15b 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -552,7 +552,7 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
{
pWrtSh = pSh;
- const SwTwips nWidth = pWrtSh->GetAnyCurRect(RECT_FRM).Width();
+ const SwTwips nWidth = pWrtSh->GetAnyCurRect(CurRectType::Frame).Width();
m_pDistBorderMF->SetMax(m_pDistBorderMF->Normalize( nWidth ), FUNIT_TWIP );
m_pDistNumMF->SetMax(m_pDistNumMF->Normalize( nWidth ), FUNIT_TWIP);
@@ -568,7 +568,7 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
m_pAlignedAtMF->SetLast(m_pAlignedAtMF->Normalize( nLast2 ), FUNIT_TWIP );
m_pIndentAtMF->SetLast(m_pIndentAtMF->Normalize( nLast2 ), FUNIT_TWIP );
- const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE);
+ const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(CurRectType::Page);
m_pPreviewWIN->SetPageWidth(rPrtRect.Width());
FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &pWrtSh->GetView()) != nullptr );
if(eMetric == FUNIT_MM)
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 4631e6cd6b6b..68c1e15a4fb7 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -430,12 +430,12 @@ void SwFrameShell::Execute(SfxRequest &rReq)
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
}
- const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE);
+ const SwRect &rPg = rSh.GetAnyCurRect(CurRectType::Page);
SwFormatFrameSize aFrameSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
aSet.Put(aFrameSize);
- const SwRect &rPr = rSh.GetAnyCurRect(RECT_PAGE_PRT);
+ const SwRect &rPr = rSh.GetAnyCurRect(CurRectType::PagePrt);
SwFormatFrameSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
aSet.Put(aPrtSize);
@@ -446,9 +446,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
// On % values initialize size
SwFormatFrameSize& rSize = const_cast<SwFormatFrameSize&>(static_cast<const SwFormatFrameSize&>(aSet.Get(RES_FRM_SIZE)));
if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED)
- rSize.SetWidth(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width());
+ rSize.SetWidth(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width());
if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != SwFormatFrameSize::SYNCED)
- rSize.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height());
+ rSize.SetHeight(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Height());
// disable vertical positioning for Math Objects anchored 'as char' if baseline alignment is activated
aSet.Put( SfxBoolItem( FN_MATH_BASELINE_ALIGNMENT,
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index ecbf5075b296..5a21c5ea6af2 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -149,8 +149,8 @@ void SwGrfShell::Execute(SfxRequest &rReq)
if( pGraphic )
{
Size aSize (
- convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width()),
- convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height()));
+ convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width()),
+ convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Height()));
SfxItemSet aSet( rSh.GetAttrPool(), RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF );
rSh.GetCurAttr( aSet );
@@ -262,7 +262,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
FieldUnit eMetric = ::GetDfltMetric((0 != (nHtmlMode&HTMLMODE_ON)));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
- const SwRect* pRect = &rSh.GetAnyCurRect(RECT_PAGE);
+ const SwRect* pRect = &rSh.GetAnyCurRect(CurRectType::Page);
SwFormatFrameSize aFrameSize( ATT_VAR_SIZE, pRect->Width(), pRect->Height());
aFrameSize.SetWhich( GetPool().GetWhich( SID_ATTR_PAGE_SIZE ) );
aSet.Put( aFrameSize );
@@ -274,7 +274,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
}
- pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT);
+ pRect = &rSh.GetAnyCurRect(CurRectType::PagePrt);
aFrameSize.SetWidth( pRect->Width() );
aFrameSize.SetHeight( pRect->Height() );
aFrameSize.SetWhich( GetPool().GetWhich(FN_GET_PRINT_AREA) );
@@ -286,9 +286,9 @@ void SwGrfShell::Execute(SfxRequest &rReq)
// At percentage values initialize size
SwFormatFrameSize aSizeCopy = static_cast<const SwFormatFrameSize&>(aSet.Get(RES_FRM_SIZE));
if (aSizeCopy.GetWidthPercent() && aSizeCopy.GetWidthPercent() != SwFormatFrameSize::SYNCED)
- aSizeCopy.SetWidth(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width());
+ aSizeCopy.SetWidth(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width());
if (aSizeCopy.GetHeightPercent() && aSizeCopy.GetHeightPercent() != SwFormatFrameSize::SYNCED)
- aSizeCopy.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height());
+ aSizeCopy.SetHeight(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Height());
// and now set the size for "external" tabpages
{
SvxSizeItem aSzItm( SID_ATTR_GRAF_FRMSIZE, aSizeCopy.GetSize() );
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 383546787103..01083d12c01a 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -984,7 +984,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if( pFact )
{
- const long nMaxVert = rSh.GetAnyCurRect( RECT_FRM ).Width() / MINLAY;
+ const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY;
ScopedVclPtr<SvxAbstractSplittTableDialog> pDlg(pFact->CreateSvxSplittTableDialog( GetView().GetWindow(), rSh.IsTableVertical(), nMaxVert ));
if( pDlg && (pDlg->Execute() == RET_OK) )
{
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index d12e0c68fcec..d7b7dc123d17 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -442,7 +442,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
if(pArgs)
{
Size aSize(aMgr.GetSize());
- aSize.Width() = GetShell().GetAnyCurRect(RECT_PAGE_PRT).Width();
+ aSize.Width() = GetShell().GetAnyCurRect(CurRectType::PagePrt).Width();
Point aPos = aMgr.GetPos();
RndStdIds eAnchor = FLY_AT_PARA;
if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET)
@@ -861,12 +861,12 @@ SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
// For the Area tab page.
GetShell().GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems(aSet);
- const SwRect &rPg = GetShell().GetAnyCurRect(RECT_PAGE);
+ const SwRect &rPg = GetShell().GetAnyCurRect(CurRectType::Page);
SwFormatFrameSize aFrameSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
aSet.Put(aFrameSize);
- const SwRect &rPr = GetShell().GetAnyCurRect(RECT_PAGE_PRT);
+ const SwRect &rPr = GetShell().GetAnyCurRect(CurRectType::PagePrt);
SwFormatFrameSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
aSet.Put(aPrtSize);
diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx
index f5f8f174e544..61f26823cc91 100644
--- a/sw/source/uibase/uiview/swcli.cxx
+++ b/sw/source/uibase/uiview/swcli.cxx
@@ -78,8 +78,8 @@ void SwOleClient::RequestNewObjectArea( Rectangle& aLogRect )
rSh.EndAllAction();
- SwRect aFrame( rSh.GetAnyCurRect( RECT_FLY_EMBEDDED, nullptr, GetObject() )),
- aPrt( rSh.GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, GetObject() ));
+ SwRect aFrame( rSh.GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, GetObject() )),
+ aPrt( rSh.GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, GetObject() ));
aLogRect.SetPos( aPrt.Pos() + aFrame.Pos() );
aLogRect.SetSize( aPrt.SSize() );
}
@@ -87,7 +87,7 @@ void SwOleClient::RequestNewObjectArea( Rectangle& aLogRect )
void SwOleClient::ObjectAreaChanged()
{
SwWrtShell &rSh = static_cast<SwView*>(GetViewShell())->GetWrtShell();
- SwRect aFrame( rSh.GetAnyCurRect( RECT_FLY_EMBEDDED, nullptr, GetObject() ));
+ SwRect aFrame( rSh.GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, GetObject() ));
if ( !aFrame.IsOver( rSh.VisArea() ) )
rSh.MakeVisible( aFrame );
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index f66b7d0bee7b..af44ff794712 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1430,8 +1430,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
// automatic mode: 1 Page, 2 Pages, 100%
// n Columns mode: n Pages, 100%
// n Columns book mode: nPages without gaps, 100%
- const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( RECT_PAGE_CALC ) );
- const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( RECT_PAGES_AREA ) ); // width of columns
+ const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) );
+ const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) ); // width of columns
Size aPageSize( aPageRect.SSize() );
aPageSize.Width() += pMgr->HasNotes() && pMgr->ShowNotes() ?
pMgr->GetSidebarWidth() + pMgr->GetSidebarBorderWidth() :
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index eef998e77d0b..059683e331de 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -92,8 +92,8 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
{
const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
- const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( RECT_PAGE_CALC ) );
- const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( RECT_PAGES_AREA ) );
+ const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) );
+ const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) );
Size aPageSize( aPageRect.SSize() );
Size aRootSize( aRootRect.SSize() );
@@ -166,7 +166,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
Point aPos;
if ( eZoomType == SvxZoomType::WHOLEPAGE )
- aPos.Y() = m_pWrtShell->GetAnyCurRect(RECT_PAGE).Top() - DOCUMENTBORDER;
+ aPos.Y() = m_pWrtShell->GetAnyCurRect(CurRectType::Page).Top() - DOCUMENTBORDER;
else
{
// Make sure that the cursor is in the visible range, so that
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 108df3dce08f..0c8e7dff8f65 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -75,7 +75,7 @@ bool SwView::IsDocumentBorder()
inline long GetLeftMargin( SwView &rView )
{
SvxZoomType eType = (SvxZoomType)rView.GetWrtShell().GetViewOptions()->GetZoomType();
- long lRet = rView.GetWrtShell().GetAnyCurRect(RECT_PAGE_PRT).Left();
+ long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left();
return eType == SvxZoomType::PERCENT ? lRet + DOCUMENTBORDER :
eType == SvxZoomType::PAGEWIDTH || eType == SvxZoomType::PAGEWIDTH_NOBORDER ? 0 :
lRet + DOCUMENTBORDER + nLeftOfst;
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 609646879e8e..9423c5990ae0 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -248,7 +248,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
const SwFormatFrameSize &rFrameSize = rDesc.GetMaster().GetFrameSize();
- const SwRect& rPageRect = rSh.GetAnyCurRect(RECT_PAGE);
+ const SwRect& rPageRect = rSh.GetAnyCurRect(CurRectType::Page);
const long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth();
const long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight();
@@ -267,7 +267,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if ( !bSect && (bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY) )
{
SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
- const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED);
+ const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded);
bool bVerticalFrame(false);
{
@@ -363,8 +363,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
{
//change the section indents and the columns if available
//at first determine the changes
- SwRect aSectRect = rSh.GetAnyCurRect(RECT_SECTION_PRT);
- const SwRect aTmpRect = rSh.GetAnyCurRect(RECT_SECTION);
+ SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt);
+ const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
aSectRect.Pos() += aTmpRect.Pos();
long nLeftDiff = aLongLR.GetLeft() - (long)(aSectRect.Left() - rPageRect.Left() );
long nRightDiff = aLongLR.GetRight() - (long)( rPageRect.Right() - aSectRect.Right());
@@ -426,7 +426,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
{
SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
- const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED);
+ const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded);
const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top();
const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower());
@@ -476,8 +476,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
{
//change the section indents and the columns if available
//at first determine the changes
- SwRect aSectRect = rSh.GetAnyCurRect(RECT_SECTION_PRT);
- const SwRect aTmpRect = rSh.GetAnyCurRect(RECT_SECTION);
+ SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt);
+ const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
aSectRect.Pos() += aTmpRect.Pos();
const long nLeftDiff = aLongULSpace.GetUpper() - (long)(aSectRect.Top() - rPageRect.Top());
const long nRightDiff = aLongULSpace.GetLower() - (long)(nPageHeight - aSectRect.Bottom() + rPageRect.Top());
@@ -879,7 +879,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
bSect ?
pSectFormat->GetCol() :
static_cast<const SwFormatCol&>(aSet.Get( RES_COL, false )));
- SwRect aCurRect = rSh.GetAnyCurRect(bSect ? RECT_SECTION_PRT : RECT_FLY_PRT_EMBEDDED);
+ SwRect aCurRect = rSh.GetAnyCurRect(bSect ? CurRectType::SectionPrt : CurRectType::FlyEmbeddedPrt);
const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
::lcl_ConvertToCols( aColItem, lWidth, aCols );
aSet.Put( aCols );
@@ -903,7 +903,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
else
{
SwFormatCol aCols( rDesc.GetMaster().GetCol() );
- const SwRect aPrtRect = rSh.GetAnyCurRect(RECT_PAGE_PRT);
+ const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt);
::lcl_ConvertToCols( aColItem,
bVerticalWriting ? aPrtRect.Height() : aPrtRect.Width(),
aCols );
@@ -1177,8 +1177,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
const bool bFrameSelection = rSh.IsFrameSelected();
const bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
// PageOffset/limiter
- const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, pPt );
- const SwRect& rPagePrtRect = rSh.GetAnyCurRect( RECT_PAGE_PRT, pPt );
+ const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page, pPt );
+ const SwRect& rPagePrtRect = rSh.GetAnyCurRect( CurRectType::PagePrt, pPt );
const long nPageWidth = rPageRect.Width();
const long nPageHeight = rPageRect.Height();
@@ -1275,8 +1275,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
rDesc.GetMaster().GetFooter().GetFooterFormat());
if( pFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash
{
- SwRect aRect( rSh.GetAnyCurRect( RECT_HEADERFOOTER, pPt));
- aRect.Pos() -= rSh.GetAnyCurRect( RECT_PAGE, pPt ).Pos();
+ SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt));
+ aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos();
const SvxLRSpaceItem& aLR = pFormat->GetLRSpace();
aLongLR.SetLeft ( (long)aLR.GetLeft() + (long)aRect.Left() );
aLongLR.SetRight( (nPageWidth -
@@ -1288,13 +1288,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SwRect aRect;
if( !bFrameSelection && ((nFrameType & FrameTypeFlags::COLSECT) || rSh.IsDirectlyInSection()) )
{
- aRect = rSh.GetAnyCurRect(RECT_SECTION_PRT, pPt);
- const SwRect aTmpRect = rSh.GetAnyCurRect(RECT_SECTION, pPt);
+ aRect = rSh.GetAnyCurRect(CurRectType::SectionPrt, pPt);
+ const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section, pPt);
aRect.Pos() += aTmpRect.Pos();
}
else if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
- aRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED, pPt);
+ aRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
else if( nFrameType & FrameTypeFlags::DRAWOBJ)
aRect = rSh.GetObjRect();
@@ -1341,14 +1341,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
{
// Convert document coordinates into page coordinates.
- const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED, pPt);
+ const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
aLongUL.SetUpper(rRect.Top() - rPageRect.Top());
aLongUL.SetLower(rPageRect.Bottom() - rRect.Bottom());
}
else if ( nFrameType & FrameTypeFlags::HEADER || nFrameType & FrameTypeFlags::FOOTER )
{
- SwRect aRect( rSh.GetAnyCurRect( RECT_HEADERFOOTER, pPt));
- aRect.Pos() -= rSh.GetAnyCurRect( RECT_PAGE, pPt ).Pos();
+ SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt));
+ aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos();
aLongUL.SetUpper( aRect.Top() );
aLongUL.SetLower( nPageHeight - aRect.Bottom() );
}
@@ -1504,7 +1504,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
if( IsTabColFromDoc() )
{
- const SwRect& rFlyPrtRect = rSh.GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, pPt );
+ const SwRect& rFlyPrtRect = rSh.GetAnyCurRect( CurRectType::FlyEmbeddedPrt, pPt );
aDistLR.SetLeft(rFlyPrtRect.Left());
aDistLR.SetRight(rFlyPrtRect.Left());
}
@@ -1739,8 +1739,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
else
--nNum;
SvxColumnItem aColItem(nNum);
- SwRect aRect = rSh.GetAnyCurRect(RECT_SECTION_PRT, pPt);
- const SwRect aTmpRect = rSh.GetAnyCurRect(RECT_SECTION, pPt);
+ SwRect aRect = rSh.GetAnyCurRect(CurRectType::SectionPrt, pPt);
+ const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section, pPt);
::lcl_FillSvxColumn(rCol, bVerticalWriting ? aRect.Height() : aRect.Width(), aColItem, 0);
@@ -1778,11 +1778,11 @@ void SwView::StateTabWin(SfxItemSet& rSet)
else
nNum--;
SvxColumnItem aColItem(nNum);
- const SwRect &rSizeRect = rSh.GetAnyCurRect(RECT_FLY_PRT_EMBEDDED, pPt);
+ const SwRect &rSizeRect = rSh.GetAnyCurRect(CurRectType::FlyEmbeddedPrt, pPt);
bool bUseVertical = bFrameHasVerticalColumns || (!bFrameSelection && bVerticalWriting);
const long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width();
- const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED, pPt);
+ const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2;
::lcl_FillSvxColumn(rCol, lWidth, aColItem, nDist2);
@@ -1818,7 +1818,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
nNum--;
SvxColumnItem aColItem(nNum);
- const SwRect aPrtRect = rSh.GetAnyCurRect(RECT_PAGE_PRT, pPt);
+ const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt, pPt);
const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetFormatAttr(RES_BOX));
long nDist = rBox.GetSmallestDistance();
@@ -1999,11 +1999,11 @@ void SwView::StateTabWin(SfxItemSet& rSet)
sal_uInt16 nNum = rSh.GetCurOutColNum();
const sal_uInt16 nCount = std::min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size()));
const SwRect aRect( rSh.GetAnyCurRect( pFormat
- ? RECT_FLY_PRT_EMBEDDED
- : RECT_PAGE_PRT, pPt ));
+ ? CurRectType::FlyEmbeddedPrt
+ : CurRectType::PagePrt, pPt ));
const SwRect aAbsRect( rSh.GetAnyCurRect( pFormat
- ? RECT_FLY_EMBEDDED
- : RECT_PAGE, pPt ));
+ ? CurRectType::FlyEmbedded
+ : CurRectType::Page, pPt ));
// The width of the frame or within the page margins.
const sal_uInt16 nTotalWidth = (sal_uInt16)aRect.Width();
@@ -2064,8 +2064,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if( nFrameType & FrameTypeFlags::FLY_ANY && IsTabColFromDoc() )
{
SwRect aRect( rSh.GetAnyCurRect(
- RECT_FLY_PRT_EMBEDDED, pPt ) );
- aRect.Pos() += rSh.GetAnyCurRect( RECT_FLY_EMBEDDED,
+ CurRectType::FlyEmbeddedPrt, pPt ) );
+ aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded,
pPt ).Pos();
aRectangle.Left() = aRect.Left() - rPageRect.Left();
@@ -2091,15 +2091,15 @@ void SwView::StateTabWin(SfxItemSet& rSet)
: FrameTypeFlags::COLSECT )
);
//So you can also drag with the mouse, without being in the table.
- CurRectType eRecType = RECT_PAGE_PRT;
+ CurRectType eRecType = CurRectType::PagePrt;
size_t nNum = IsTabColFromDoc() ?
rSh.GetCurMouseColNum( m_aTabColFromDocPos ):
rSh.GetCurOutColNum();
const SwFrameFormat* pFormat = nullptr;
if( bColSct )
{
- eRecType = bSectOutTable ? RECT_OUTTABSECTION
- : RECT_SECTION;
+ eRecType = bSectOutTable ? CurRectType::SectionOutsideTable
+ : CurRectType::Section;
const SwSection *pSect = rSh.GetAnySection( bSectOutTable, pPt );
OSL_ENSURE( pSect, "Which section?");
pFormat = pSect->GetFormat();
@@ -2107,7 +2107,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
else if( bFrame )
{
pFormat = rSh.GetFlyFrameFormat();
- eRecType = RECT_FLY_PRT_EMBEDDED;
+ eRecType = CurRectType::FlyEmbeddedPrt;
}
const SwFormatCol* pCols = pFormat ? &pFormat->GetCol():
@@ -2121,8 +2121,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
// the absolute position must be added here
SwRect aRect( rSh.GetAnyCurRect( eRecType, pPt ) );
- if(RECT_FLY_PRT_EMBEDDED == eRecType)
- aRect.Pos() += rSh.GetAnyCurRect( RECT_FLY_EMBEDDED,
+ if(CurRectType::FlyEmbeddedPrt == eRecType)
+ aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded,
pPt ).Pos();
const sal_uInt16 nTotalWidth = (sal_uInt16)aRect.Width();
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index d40e71ce6fa7..4efd976b1bda 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -763,11 +763,11 @@ SwTwips GetTableWidth( SwFrameFormat* pFormat, SwTabCols& rCols, sal_uInt16 *pPe
{
if ( nullptr == pSh->GetFlyFrameFormat() )
{
- nWidth = pSh->GetAnyCurRect(RECT_PAGE_PRT).Width();
+ nWidth = pSh->GetAnyCurRect(CurRectType::PagePrt).Width();
}
else
{
- nWidth = pSh->GetAnyCurRect(RECT_FLY_PRT_EMBEDDED).Width();
+ nWidth = pSh->GetAnyCurRect(CurRectType::FlyEmbeddedPrt).Width();
}
}
else
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 67e4ad51fd8a..fb208b93a56d 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -410,8 +410,8 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
{
- SwRect aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() );
- aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, nullptr, xObj.GetObject() ).Pos();
+ SwRect aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
+ aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
MapMode aMapMode( MapUnit::MapTwip );
Size aSize = xObj.GetSize( &aMapMode );
aArea.Width( aSize.Width() );
@@ -640,7 +640,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
{
// TODO/MBA: testing
SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
- : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() ));
+ : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
if( !aRect.IsEmpty() )
{
// TODO/LEAN: getMapUnit can switch object to running state
@@ -761,7 +761,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
if ( pFlyPrtRect )
aObjArea = pFlyPrtRect->SSize();
else
- aObjArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() ).SSize();
+ aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize();
// differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
long nX, nY;
@@ -795,8 +795,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() );
- aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, nullptr, xObj.GetObject() ).Pos();
+ aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() );
+ aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos();
}
if ( bUseObjectSize )
@@ -808,7 +808,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
{
const Point &rPoint = pFlyFrameFormat->GetLastFlyFramePrtRectPos();
SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
- : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() ));
+ : GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ));
aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
}
aArea.Width ( _aVisArea.Width() );