summaryrefslogtreecommitdiff
path: root/sw/inc/pagedesc.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-03-15 22:25:17 +0100
committerMichael Stahl <mstahl@redhat.com>2013-03-15 22:54:06 +0100
commit4dc78aee9bcdb6ea5e9dc47ebb4a4b9e590c725a (patch)
tree405736850c0c8e7e85db61f02fddf80e28ca5975 /sw/inc/pagedesc.hxx
parent859e94294bdfd8595c88dd7f14da09ead8b32a45 (diff)
fdo#61952: sw: fix left/right-only page styles and first-page
- remove PD_FIRST and GetFirstFmt: This flag makes no sense at all, since there are no "first-only" page styles (while there are left-only/right-only). - instead add a parameter to GetLeftFmt/GetRightFmt to request a first page format, if such exists and is not shared (regression from 02a934d03b101ce463a232f9cbb7b43e684de37e and fa0f42bafbf24e9141ddee728b160b5ab47077f2) Change-Id: I4d50c2c0cc4f3cf231eacba891df22d0bcf6c4df
Diffstat (limited to 'sw/inc/pagedesc.hxx')
-rw-r--r--sw/inc/pagedesc.hxx39
1 files changed, 10 insertions, 29 deletions
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index dbf314481ca2..45ca5dfa2167 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -118,9 +118,8 @@ namespace nsUseOnPage
const UseOnPage PD_NONE = 0x0000; ///< For internal use only.
const UseOnPage PD_LEFT = 0x0001;
const UseOnPage PD_RIGHT = 0x0002;
- const UseOnPage PD_FIRST = 0x0004;
- const UseOnPage PD_ALL = 0x0007;
- const UseOnPage PD_MIRROR = 0x000F;
+ const UseOnPage PD_ALL = 0x0003;
+ const UseOnPage PD_MIRROR = 0x0007;
const UseOnPage PD_HEADERSHARE = 0x0040;
const UseOnPage PD_FOOTERSHARE = 0x0080;
const UseOnPage PD_NOHEADERSHARE = 0xFFBF; ///< For internal use only.
@@ -204,12 +203,10 @@ public:
/** Layout uses the following methods to obtain a format in order
to be able to create a page. */
- inline SwFrmFmt *GetRightFmt();
- inline const SwFrmFmt *GetRightFmt() const;
- inline SwFrmFmt *GetLeftFmt();
- inline const SwFrmFmt *GetLeftFmt() const;
- inline SwFrmFmt *GetFirstFmt();
- inline const SwFrmFmt *GetFirstFmt() const;
+ SwFrmFmt *GetRightFmt(bool const bFirst = false);
+ inline const SwFrmFmt *GetRightFmt(bool const bFirst = false) const;
+ SwFrmFmt *GetLeftFmt(bool const bFirst = false);
+ inline const SwFrmFmt *GetLeftFmt(bool const bFirst = false) const;
sal_uInt16 GetRegHeight() const { return nRegHeight; }
sal_uInt16 GetRegAscent() const { return nRegAscent; }
@@ -306,29 +303,13 @@ inline void SwPageDesc::ResetAllLeftAttr()
ResetAllAttr( sal_True );
}
-inline SwFrmFmt *SwPageDesc::GetRightFmt()
+inline const SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst) const
{
- return nsUseOnPage::PD_RIGHT & eUse ? &aMaster : 0;
+ return const_cast<SwPageDesc*>(this)->GetRightFmt(bFirst);
}
-inline const SwFrmFmt *SwPageDesc::GetRightFmt() const
+inline const SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst) const
{
- return nsUseOnPage::PD_RIGHT & eUse ? &aMaster : 0;
-}
-inline SwFrmFmt *SwPageDesc::GetLeftFmt()
-{
- return nsUseOnPage::PD_LEFT & eUse ? &aLeft : 0;
-}
-inline const SwFrmFmt *SwPageDesc::GetLeftFmt() const
-{
- return nsUseOnPage::PD_LEFT & eUse ? &aLeft : 0;
-}
-inline SwFrmFmt *SwPageDesc::GetFirstFmt()
-{
- return nsUseOnPage::PD_FIRST & eUse ? &aFirst : 0;
-}
-inline const SwFrmFmt *SwPageDesc::GetFirstFmt() const
-{
- return nsUseOnPage::PD_FIRST & eUse ? &aFirst : 0;
+ return const_cast<SwPageDesc*>(this)->GetLeftFmt(bFirst);
}
class SwPageDescExt