summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-07 16:44:47 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-07 16:44:47 +0100
commit04c7d5013b9b87709b913e26190fb347a4916566 (patch)
tree9e7f08da39d977c19d4c02cd02c864db8e0a5fec /sw
parent761f7b584ee4ba4d34e983733d49357a4b8c15be (diff)
Replace some constexpr functions with static data members
(I leave the DOCUMENTBORDER TODO alone, as that one is of type long while defDocumentBorder is of type sal_uInt16, so cleaning that up likely is a little more effort.) Change-Id: Ie9972e2f38b0ca9812e09f1c9d9fbded1046fda0
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/swtypes.hxx2
-rw-r--r--sw/inc/viewopt.hxx10
-rw-r--r--sw/source/core/layout/layact.cxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx2
4 files changed, 8 insertions, 8 deletions
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 3c2110ccd955..8fe08352119e 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -84,7 +84,7 @@ const SwTwips lMinBorder = 1134;
// Margin left and above document.
// Half of it is gap between the pages.
-//TODO: Replace with SwViewOption::GetDefDocumentBorder()
+//TODO: Replace with SwViewOption::defDocumentBorder
#define DOCUMENTBORDER 284L
// Constant strings.
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index b44dd1d8a479..1bb138a889f5 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -377,14 +377,14 @@ public:
void SetDivisionY( short n ){ m_nDivisionY = n; }
// Default margin left and above document: 284 twips == 5.0 mm.
- static constexpr sal_uInt16 GetDefDocumentBorder() { return 284; }
+ static constexpr sal_uInt16 defDocumentBorder = 284;
// Default gap between pages: 284 twips == 5.0 mm.
- static constexpr sal_uInt16 GetDefGapBetweenPages() { return 284; }
+ static constexpr sal_uInt16 defGapBetweenPages = 284;
// Minimum edge-to-text distance: 22 twips == 0.4 mm.
- static constexpr sal_uInt16 GetMinGapBetweenPages() { return 22; }
+ static constexpr sal_uInt16 minGapBetweenPages = 22;
- sal_uInt16 GetDocumentBorder() const { return IsWhitespaceHidden() ? GetMinGapBetweenPages() : GetDefDocumentBorder(); }
- sal_uInt16 GetGapBetweenPages() const { return IsWhitespaceHidden() ? GetMinGapBetweenPages() : GetDefGapBetweenPages(); }
+ sal_uInt16 GetDocumentBorder() const { return IsWhitespaceHidden() ? minGapBetweenPages : defDocumentBorder; }
+ sal_uInt16 GetGapBetweenPages() const { return IsWhitespaceHidden() ? minGapBetweenPages : defGapBetweenPages; }
sal_uInt8 GetPagePrevRow() const { return m_nPagePreviewRow; }
void SetPagePrevRow( sal_uInt8 n ) { m_nPagePreviewRow = n; }
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 666ea3c252eb..33d53347c605 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1291,7 +1291,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
{
const SwViewShell *pSh = pLay->getRootFrame()->GetCurrShell();
const SwTwips nHalfDocBorder = pSh ? pSh->GetViewOptions()->GetGapBetweenPages()
- : SwViewOption::GetDefGapBetweenPages();
+ : SwViewOption::defGapBetweenPages;
const bool bLeftToRightViewLayout = m_pRoot->IsLeftToRightViewLayout();
const bool bPrev = bLeftToRightViewLayout ? pLay->GetPrev() : pLay->GetNext();
const bool bNext = bLeftToRightViewLayout ? pLay->GetNext() : pLay->GetPrev();
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index bb859f58cc62..170428358634 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1965,7 +1965,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
const long nVisWidth = mnViewWidth - 2 * nBorder;
const long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages()
: (pSh ? pSh->GetViewOptions()->GetGapBetweenPages()
- : SwViewOption::GetDefGapBetweenPages());
+ : SwViewOption::defGapBetweenPages);
// check how many pages fit into the first page layout row:
SwPageFrame* pPageFrame = static_cast<SwPageFrame*>(Lower());