summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-05 12:24:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-06 07:46:11 +0100
commit97ebc98f0e956712d242e13f15531742f844a738 (patch)
treef8f59969604c4cac28a3efba17c4c281752fa62f /sw/source/core/layout/paintfrm.cxx
parent4b363760b9f196e139ee367d54252c4d6cbe25f3 (diff)
convert some macros to local functions
Change-Id: If2c89f0f53615f6200b6cd1fb6267cc9b47df927 Reviewed-on: https://gerrit.libreoffice.org/62884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r--sw/source/core/layout/paintfrm.cxx47
1 files changed, 29 insertions, 18 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f7b96f94e3ea..bfb80dbd8de8 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -121,22 +121,6 @@ using std::make_pair;
struct SwPaintProperties;
-//other subsidiary lines enabled?
-#define IS_SUBS (!gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && \
- !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() && \
- !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&\
- !gProp.pSGlobalShell->GetViewOptions()->IsWhitespaceHidden() &&\
- SwViewOption::IsDocBoundaries())
-//subsidiary lines for sections
-#define IS_SUBS_SECTION (!gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && \
- !gProp.pSGlobalShell->GetViewOptions()->IsReadonly()&&\
- !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&\
- SwViewOption::IsSectionBoundaries())
-#define IS_SUBS_FLYS (!gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && \
- !gProp.pSGlobalShell->GetViewOptions()->IsReadonly()&&\
- !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&\
- SwViewOption::IsObjectBoundaries())
-
//Class declaration; here because they are only used in this file
enum class SubColFlags {
Page = 0x01, //Helplines of the page
@@ -317,6 +301,32 @@ struct SwPaintProperties {
static SwPaintProperties gProp;
+static bool isSubsidiaryLinesFlysEnabled()
+{
+ return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
+ SwViewOption::IsObjectBoundaries();
+}
+//other subsidiary lines enabled?
+static bool isSubsidiaryLinesEnabled()
+{
+ return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsWhitespaceHidden() &&
+ SwViewOption::IsDocBoundaries();
+}
+//subsidiary lines for sections
+static bool isSubsidiaryLinesForSectionsEnabled()
+{
+ return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
+ !gProp.pSGlobalShell->GetViewOptions()->IsFormView() &&
+ SwViewOption::IsSectionBoundaries();
+}
+
+
namespace {
bool isTableBoundariesEnabled()
@@ -6325,7 +6335,8 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
/// Refreshes all subsidiary lines of a page.
void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
{
- if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || IS_SUBS_FLYS )
+ if ( isSubsidiaryLinesEnabled() || isTableBoundariesEnabled()
+ || isSubsidiaryLinesForSectionsEnabled() || isSubsidiaryLinesFlysEnabled() )
{
if ( rRect.HasArea() )
{
@@ -6359,7 +6370,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const
void SwLayoutFrame::RefreshLaySubsidiary( const SwPageFrame *pPage,
const SwRect &rRect ) const
{
- const bool bSubsOpt = IS_SUBS;
+ const bool bSubsOpt = isSubsidiaryLinesEnabled();
if ( bSubsOpt )
PaintSubsidiaryLines( pPage, rRect );