[Libreoffice-commits] core.git: 2 commits - sc/inc sw/inc sw/qa sw/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 12 09:44:40 UTC 2016


 sc/inc/formularesult.hxx                        |    8 ++
 sw/inc/pagedesc.hxx                             |   70 ++++++++++++------------
 sw/qa/extras/uiwriter/uiwriter.cxx              |    2 
 sw/source/core/doc/DocumentStylePoolManager.cxx |   16 ++---
 sw/source/core/doc/docdesc.cxx                  |    2 
 sw/source/core/docnode/node.cxx                 |    4 -
 sw/source/core/edit/autofmt.cxx                 |    2 
 sw/source/core/layout/pagedesc.cxx              |   14 ++--
 sw/source/core/unocore/unostyle.cxx             |    2 
 sw/source/filter/ww8/docxexport.cxx             |    2 
 sw/source/filter/ww8/rtfexport.cxx              |    4 -
 sw/source/filter/ww8/wrtw8sty.cxx               |   24 ++++----
 sw/source/filter/ww8/ww8par.cxx                 |   10 +--
 sw/source/ui/chrdlg/break.cxx                   |    8 +-
 sw/source/uibase/app/appenv.cxx                 |    2 
 sw/source/uibase/app/applab.cxx                 |    2 
 sw/source/uibase/uiview/viewmdi.cxx             |    2 
 sw/source/uibase/uiview/viewtab.cxx             |    2 
 sw/source/uibase/utlui/uitool.cxx               |   30 +++++-----
 19 files changed, 109 insertions(+), 97 deletions(-)

New commits:
commit a77ff8446e7ed2255b11406b4ccce7ec742d7c67
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Oct 12 11:40:50 2016 +0200

    silence gcc4.8 warning
    
    Change-Id: I1e433d6011de22e018b5324754f00065f2bfa6eb

diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 43ff655..9150ab9 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -73,7 +73,15 @@ class ScFormulaResult
     bool                mbToken :1; // whether content of union is a token
     bool                mbEmpty :1; // empty cell result
     bool                mbEmptyDisplayedAsString :1;    // only if mbEmpty
+// GCC4.8 complains about 'ScFormulaResult::meMultiline is too small to hold all values of enum class ScFormulaResult::Multiline'
+#if defined __GNUC__ && !defined __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Werror"
+#endif
     Multiline           meMultiline :2; // result is multiline
+#if defined __GNUC__ && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
 
     /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
         prior to assigning other types */
commit cbd4266beff52cf210f1532b50f8bab74cb8ba8c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Oct 12 11:34:54 2016 +0200

    convert PD_ constants to typed_flags
    
    Change-Id: Ia651dfae33cb1e901f124541a1e12f240d4a7458

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index d234bfc..9e3bd2e 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -27,14 +27,16 @@
 #include <editeng/numitem.hxx>
 #include <editeng/borderline.hxx>
 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-
-using namespace ::com::sun::star;
+#include <o3tl/typed_flags_set.hxx>
 
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/identity.hpp>
 #include <boost/multi_index/ordered_index.hpp>
 #include <boost/multi_index/random_access_index.hpp>
 
+using namespace ::com::sun::star;
+
+
 class SfxPoolItem;
 class SwTextFormatColl;
 class SwNode;
@@ -121,20 +123,22 @@ public:
  * document (contents are created or removed according to SHARE-information).
  */
 
-typedef sal_uInt16 UseOnPage;
-namespace nsUseOnPage
+enum class UseOnPage : sal_uInt16
 {
-    const UseOnPage PD_NONE           = 0x0000; ///< For internal use only.
-    const UseOnPage PD_LEFT           = 0x0001;
-    const UseOnPage PD_RIGHT          = 0x0002;
-    const UseOnPage PD_ALL            = 0x0003;
-    const UseOnPage PD_MIRROR         = 0x0007;
-    const UseOnPage PD_HEADERSHARE    = 0x0040;
-    const UseOnPage PD_FOOTERSHARE    = 0x0080;
-    const UseOnPage PD_FIRSTSHARE     = 0x0100;
-    const UseOnPage PD_NOHEADERSHARE  = 0xFFBF; ///< For internal use only.
-    const UseOnPage PD_NOFOOTERSHARE  = 0xFF7F; ///< For internal use only.
-    const UseOnPage PD_NOFIRSTSHARE   = 0xFEFF;
+    NONE           = 0x0000, ///< For internal use only.
+    Left           = 0x0001,
+    Right          = 0x0002,
+    All            = 0x0003,
+    Mirror         = 0x0007,
+    HeaderShare    = 0x0040,
+    FooterShare    = 0x0080,
+    FirstShare     = 0x0100,
+    NoHeaderShare  = 0xFFBF, ///< For internal use only.
+    NoFooterShare  = 0xFF7F, ///< For internal use only.
+    NoFirstShare   = 0xFEFF
+};
+namespace o3tl {
+    template<> struct typed_flags<UseOnPage> : is_typed_flags<UseOnPage, 0xffff> {};
 }
 
 class SW_DLLPUBLIC SwPageDesc : public SwModify
@@ -206,7 +210,7 @@ public:
     bool IsHidden() const { return m_IsHidden; }
     void SetHidden(bool const bValue) { m_IsHidden = bValue; }
 
-    /// Same as WriteUseOn(), but the >= PD_HEADERSHARE part of the bitfield is not modified.
+    /// Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
     inline void      SetUseOn( UseOnPage eNew );
     inline UseOnPage GetUseOn() const;
 
@@ -296,44 +300,44 @@ inline void SwPageDesc::SetFollow( const SwPageDesc* pNew )
 
 inline bool SwPageDesc::IsHeaderShared() const
 {
-    return (m_eUse & nsUseOnPage::PD_HEADERSHARE) != 0;
+    return bool(m_eUse & UseOnPage::HeaderShare);
 }
 inline bool SwPageDesc::IsFooterShared() const
 {
-    return (m_eUse & nsUseOnPage::PD_FOOTERSHARE) != 0;
+    return bool(m_eUse & UseOnPage::FooterShare);
 }
 inline void SwPageDesc::ChgHeaderShare( bool bNew )
 {
     if ( bNew )
-        m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_HEADERSHARE);
+        m_eUse |= UseOnPage::HeaderShare;
     else
-        m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOHEADERSHARE);
+        m_eUse &= UseOnPage::NoHeaderShare;
 }
 inline void SwPageDesc::ChgFooterShare( bool bNew )
 {
     if ( bNew )
-        m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_FOOTERSHARE);
+        m_eUse |= UseOnPage::FooterShare;
     else
-        m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOFOOTERSHARE);
+        m_eUse &= UseOnPage::NoFooterShare;
 }
 inline void SwPageDesc::SetUseOn( UseOnPage eNew )
 {
-    UseOnPage eTmp = nsUseOnPage::PD_NONE;
-    if (m_eUse & nsUseOnPage::PD_HEADERSHARE)
-        eTmp = nsUseOnPage::PD_HEADERSHARE;
-    if (m_eUse & nsUseOnPage::PD_FOOTERSHARE)
-        eTmp = (UseOnPage) (eTmp | nsUseOnPage::PD_FOOTERSHARE);
-    if (m_eUse & nsUseOnPage::PD_FIRSTSHARE)
-        eTmp = (UseOnPage) (eTmp | nsUseOnPage::PD_FIRSTSHARE);
-    m_eUse = (UseOnPage) (eTmp | eNew);
+    UseOnPage eTmp = UseOnPage::NONE;
+    if (m_eUse & UseOnPage::HeaderShare)
+        eTmp = UseOnPage::HeaderShare;
+    if (m_eUse & UseOnPage::FooterShare)
+        eTmp |= UseOnPage::FooterShare;
+    if (m_eUse & UseOnPage::FirstShare)
+        eTmp |= UseOnPage::FirstShare;
+    m_eUse = eTmp | eNew;
 
 }
 inline UseOnPage SwPageDesc::GetUseOn() const
 {
     UseOnPage eRet = m_eUse;
-    eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOHEADERSHARE);
-    eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOFOOTERSHARE);
-    eRet = (UseOnPage) (eRet & nsUseOnPage::PD_NOFIRSTSHARE);
+    eRet &= UseOnPage::NoHeaderShare;
+    eRet &= UseOnPage::NoFooterShare;
+    eRet &= UseOnPage::NoFirstShare;
     return eRet;
 }
 
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 855f6a8..73d4de5 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1728,7 +1728,7 @@ void SwUiWriterTest::testTdf69282WithMirror()
     SwPageDesc* sPageDesc = source->MakePageDesc("SourceStyle");
     SwPageDesc* tPageDesc = target->MakePageDesc("TargetStyle");
     //Enabling Mirror
-    sPageDesc->SetUseOn(nsUseOnPage::PD_MIRROR);
+    sPageDesc->SetUseOn(UseOnPage::Mirror);
     SwFrameFormat& rSourceMasterFormat = sPageDesc->GetMaster();
     //Setting horizontal spaces on master
     SvxLRSpaceItem horizontalSpace(RES_LR_SPACE);
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index cffded8..5e1f71b 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1428,7 +1428,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
         {
             aSet.Put( aLR );
             aSet.Put( aUL );
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL | nsUseOnPage::PD_FIRSTSHARE );
+            pNewPgDsc->SetUseOn( UseOnPage::All | UseOnPage::FirstShare );
         }
         break;
 
@@ -1438,7 +1438,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
             aSet.Put( aLR );
             aSet.Put( aUL );
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
+            pNewPgDsc->SetUseOn( UseOnPage::All );
             if( RES_POOLPAGE_FIRST == nId )
                 pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_STANDARD ));
         }
@@ -1450,7 +1450,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             aSet.Put( aLR );
             aSet.Put( aUL );
             bSetLeft = false;
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT );
+            pNewPgDsc->SetUseOn( UseOnPage::Left );
             // this relies on GetPageDescFromPool() not going into infinite recursion
             // (by this point RES_POOLPAGE_LEFT will not reach this place again)
             pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_RIGHT ));
@@ -1462,7 +1462,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             aSet.Put( aLR );
             aSet.Put( aUL );
             bSetLeft = false;
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT );
+            pNewPgDsc->SetUseOn( UseOnPage::Right );
             pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_LEFT ));
         }
         break;
@@ -1477,7 +1477,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             aSet.Put( aLR );
             aSet.Put( aUL );
 
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
+            pNewPgDsc->SetUseOn( UseOnPage::All );
             pNewPgDsc->SetLandscape( true );
         }
         break;
@@ -1491,7 +1491,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             aSet.Put( aLR );
             aSet.Put( aUL );
 
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
+            pNewPgDsc->SetUseOn( UseOnPage::All );
         }
         break;
 
@@ -1501,7 +1501,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
             aSet.Put( aLR );
             aSet.Put( aUL );
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
+            pNewPgDsc->SetUseOn( UseOnPage::All );
             SwPageFootnoteInfo aInf( pNewPgDsc->GetFootnoteInfo() );
             aInf.SetLineWidth( 0 );
             aInf.SetTopDist( 0 );
@@ -1523,7 +1523,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
             aSet.Put( aFrameSz );
             aSet.Put( aLR );
             aSet.Put( aUL );
-            pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
+            pNewPgDsc->SetUseOn( UseOnPage::All );
             pNewPgDsc->SetLandscape( true );
         }
         break;
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index aebf7698..7d3d6fb 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -391,7 +391,7 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
     ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
 
     // Mirror at first if needed.
-    if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR )
+    if ( rChged.GetUseOn() == UseOnPage::Mirror )
         const_cast<SwPageDesc&>(rChged).Mirror();
     else
     {
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index c9bdc8b..8ab388c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -592,12 +592,12 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const
                     if( SwHeaderStartNode == pSttNd->GetStartNodeType())
                     {
                         nId = RES_HEADER;
-                        eAskUse = nsUseOnPage::PD_HEADERSHARE;
+                        eAskUse = UseOnPage::HeaderShare;
                     }
                     else
                     {
                         nId = RES_FOOTER;
-                        eAskUse = nsUseOnPage::PD_FOOTERSHARE;
+                        eAskUse = UseOnPage::FooterShare;
                     }
 
                     for( size_t n = pDoc->GetPageDescCnt(); n && !pPgDesc; )
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 08c350a..1109e5d 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1057,7 +1057,7 @@ bool SwAutoFormat::HasBreakAttr( const SwTextNode& rTextNd )
 
     if( SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem )
         && static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()
-        && nsUseOnPage::PD_NONE != static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()->GetUseOn() )
+        && UseOnPage::NONE != static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()->GetUseOn() )
         return true;
     return false;
 }
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index c5dce20..62784e0 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -48,7 +48,7 @@ SwPageDesc::SwPageDesc(const OUString& rName, SwFrameFormat *pFormat, SwDoc *con
     , m_nRegHeight( 0 )
     , m_nRegAscent( 0 )
     , m_nVerticalAdjustment( drawing::TextVerticalAdjust_TOP )
-    , m_eUse( (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE | nsUseOnPage::PD_FIRSTSHARE) )
+    , m_eUse( UseOnPage::All | UseOnPage::HeaderShare | UseOnPage::FooterShare | UseOnPage::FirstShare )
     , m_IsLandscape( false )
     , m_IsHidden( false )
     , m_pdList( nullptr )
@@ -324,29 +324,29 @@ bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
 
 SwFrameFormat *SwPageDesc::GetLeftFormat(bool const bFirst)
 {
-    return (nsUseOnPage::PD_LEFT & m_eUse)
+    return (UseOnPage::Left & m_eUse)
             ? ((bFirst) ? &m_FirstLeft : &m_Left)
             : nullptr;
 }
 
 SwFrameFormat *SwPageDesc::GetRightFormat(bool const bFirst)
 {
-    return (nsUseOnPage::PD_RIGHT & m_eUse)
-            ? ((bFirst) ? &m_FirstMaster : &m_Master)
+    return (UseOnPage::Right & m_eUse)
+            ? (bFirst ? &m_FirstMaster : &m_Master)
             : nullptr;
 }
 
 bool SwPageDesc::IsFirstShared() const
 {
-    return (m_eUse & nsUseOnPage::PD_FIRSTSHARE) != 0;
+    return bool(m_eUse & UseOnPage::FirstShare);
 }
 
 void SwPageDesc::ChgFirstShare( bool bNew )
 {
     if ( bNew )
-        m_eUse = (UseOnPage) (m_eUse | nsUseOnPage::PD_FIRSTSHARE);
+        m_eUse |= UseOnPage::FirstShare;
     else
-        m_eUse = (UseOnPage) (m_eUse & nsUseOnPage::PD_NOFIRSTSHARE);
+        m_eUse &= UseOnPage::NoFirstShare;
 }
 
 SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName)
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 9ac1673..382255e 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2655,7 +2655,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault()
         if(pDesc)
         {
             pPageFormat = &pDesc->GetMaster();
-            pDesc->SetUseOn(nsUseOnPage::PD_ALL);
+            pDesc->SetUseOn(UseOnPage::All);
         }
         else
             pPageFormat = lcl_GetFormatForStyle(m_pDoc, xStyle, m_rEntry.m_eFamily);
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 8373fef..c36139c 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1312,7 +1312,7 @@ void DocxExport::WriteEmbeddings()
 bool DocxExport::isMirroredMargin()
 {
     bool bMirroredMargins = false;
-    if ( nsUseOnPage::PD_MIRROR == (nsUseOnPage::PD_MIRROR & m_pDoc->GetPageDesc(0).ReadUseOn()) )
+    if ( UseOnPage::Mirror == (UseOnPage::Mirror & m_pDoc->GetPageDesc(0).ReadUseOn()) )
     {
         bMirroredMargins = true;
     }
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index a885d8e..850b0d7 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -543,7 +543,7 @@ void RtfExport::WritePageDescTable()
 
         Strm().WriteCharPtr(SAL_NEWLINE_STRING).WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSC);
         OutULong(n).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSCUSE);
-        OutULong(rPageDesc.ReadUseOn());
+        OutULong((sal_uLong)rPageDesc.ReadUseOn());
 
         OutPageDescription(rPageDesc, false, false);
 
@@ -613,7 +613,7 @@ void RtfExport::ExportDocument_Impl()
     if (RedlineFlags::On & m_nOrigRedlineFlags)
         Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_REVISIONS);
     // Mirror margins?
-    if ((nsUseOnPage::PD_MIRROR & m_pDoc->GetPageDesc(0).ReadUseOn()) == nsUseOnPage::PD_MIRROR)
+    if ((UseOnPage::Mirror & m_pDoc->GetPageDesc(0).ReadUseOn()) == UseOnPage::Mirror)
         Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGMIRROR);
     // Init sections
     m_pSections = new MSWordSections(*this);
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 7479d3e..8386c03 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1276,10 +1276,10 @@ void MSWordSections::CheckForFacinPg( WW8Export& rWrt ) const
             else if( !( 1 & nEnde ) &&
                 pPd->GetFollow() && pPd != pPd->GetFollow() &&
                 pPd->GetFollow()->GetFollow() == pPd &&
-                (( nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) &&
-                   nsUseOnPage::PD_RIGHT == ( nsUseOnPage::PD_ALL & pPd->GetFollow()->ReadUseOn() )) ||
-                 ( nsUseOnPage::PD_RIGHT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) &&
-                   nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->GetFollow()->ReadUseOn() )) ))
+                (( UseOnPage::Left == ( UseOnPage::All & pPd->ReadUseOn() ) &&
+                   UseOnPage::Right == ( UseOnPage::All & pPd->GetFollow()->ReadUseOn() )) ||
+                 ( UseOnPage::Right == ( UseOnPage::All & pPd->ReadUseOn() ) &&
+                   UseOnPage::Left == ( UseOnPage::All & pPd->GetFollow()->ReadUseOn() )) ))
             {
                 rWrt.pDop->fFacingPages = rWrt.pDop->fMirrorMargins = true;
                 nEnde |= 1;
@@ -1292,7 +1292,7 @@ void MSWordSections::CheckForFacinPg( WW8Export& rWrt ) const
                 nEnde |= 1;
             }
             if( !( 2 & nEnde ) &&
-                nsUseOnPage::PD_MIRROR == ( nsUseOnPage::PD_MIRROR & pPd->ReadUseOn() ))
+                UseOnPage::Mirror == ( UseOnPage::Mirror & pPd->ReadUseOn() ))
             {
                 rWrt.pDop->fSwapBordersFacingPgs =
                     rWrt.pDop->fMirrorMargins = true;
@@ -1657,16 +1657,16 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
         // left-/right chain of pagedescs ?
         if ( pPd->GetFollow() && pPd != pPd->GetFollow() &&
                 pPd->GetFollow()->GetFollow() == pPd &&
-                (( nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) &&
-                   nsUseOnPage::PD_RIGHT == ( nsUseOnPage::PD_ALL & pPd->GetFollow()->ReadUseOn() )) ||
-                 ( nsUseOnPage::PD_RIGHT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) &&
-                   nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->GetFollow()->ReadUseOn() )) ))
+                (( UseOnPage::Left == ( UseOnPage::All & pPd->ReadUseOn() ) &&
+                   UseOnPage::Right == ( UseOnPage::All & pPd->GetFollow()->ReadUseOn() )) ||
+                 ( UseOnPage::Right == ( UseOnPage::All & pPd->ReadUseOn() ) &&
+                   UseOnPage::Left == ( UseOnPage::All & pPd->GetFollow()->ReadUseOn() )) ))
         {
             bLeftRightPgChain = true;
 
             // which is the reference point? (left or right?)
             // assume it is on the right side!
-            if ( nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) )
+            if ( UseOnPage::Left == ( UseOnPage::All & pPd->ReadUseOn() ) )
             {
                 nBreakCode = 3;
                 pPd = pPd->GetFollow();
@@ -1688,9 +1688,9 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
         // werden es nur linke oder nur rechte Seiten?
         if ( 2 == nBreakCode )
         {
-            if ( nsUseOnPage::PD_LEFT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) )
+            if ( UseOnPage::Left == ( UseOnPage::All & pPd->ReadUseOn() ) )
                 nBreakCode = 3;
-            else if ( nsUseOnPage::PD_RIGHT == ( nsUseOnPage::PD_ALL & pPd->ReadUseOn() ) )
+            else if ( UseOnPage::Right == ( UseOnPage::All & pPd->ReadUseOn() ) )
                 nBreakCode = 4;
         }
     }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0d67089..1bb031e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4355,12 +4355,12 @@ void wwSectionManager::SetUseOn(wwSection &rSection)
     bool bMirror = mrReader.m_pWDop->fMirrorMargins ||
         mrReader.m_pWDop->doptypography.f2on1;
 
-    UseOnPage eUseBase = bMirror ? nsUseOnPage::PD_MIRROR : nsUseOnPage::PD_ALL;
+    UseOnPage eUseBase = bMirror ? UseOnPage::Mirror : UseOnPage::All;
     UseOnPage eUse = eUseBase;
     if (!mrReader.m_pWDop->fFacingPages)
-        eUse = (UseOnPage)(eUse | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE);
+        eUse |= UseOnPage::HeaderShare | UseOnPage::FooterShare;
     if (!rSection.HasTitlePage())
-        eUse = (UseOnPage)(eUse | nsUseOnPage::PD_FIRSTSHARE);
+        eUse |= UseOnPage::FirstShare;
 
     OSL_ENSURE(rSection.mpPage, "Makes no sense to call me with no pages to set");
     if (rSection.mpPage)
@@ -4533,9 +4533,9 @@ void wwSectionManager::InsertSegments()
                 *aIter = aTmpSection;
 
                 // Handle the section break
-                UseOnPage eUseOnPage = nsUseOnPage::PD_LEFT;
+                UseOnPage eUseOnPage = UseOnPage::Left;
                 if ( aIter->maSep.bkc == 4 ) // Odd ( right ) Section break
-                    eUseOnPage = nsUseOnPage::PD_RIGHT;
+                    eUseOnPage = UseOnPage::Right;
 
                 // Keep the share flags.
                 aDesc.GetPageDesc()->SetUseOn( eUseOnPage );
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index 5eb010c..46641a9 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -107,10 +107,10 @@ IMPL_LINK_NOARG(SwBreakDlg, OkHdl, Button*, void)
         bool bOk = true;
         switch(pPageDesc->GetUseOn())
         {
-            case nsUseOnPage::PD_MIRROR:
-            case nsUseOnPage::PD_ALL: break;
-            case nsUseOnPage::PD_LEFT: bOk = 0 == nUserPage % 2; break;
-            case nsUseOnPage::PD_RIGHT: bOk = 1 == nUserPage % 2; break;
+            case UseOnPage::Mirror:
+            case UseOnPage::All: break;
+            case UseOnPage::Left: bOk = 0 == nUserPage % 2; break;
+            case UseOnPage::Right: bOk = 1 == nUserPage % 2; break;
             default:; //prevent warning
         }
         if(!bOk) {
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index eef9783..53eaa87 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -386,7 +386,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
         pDesc->ChgFooterShare(false);
 
         // Page numbering
-        pDesc->SetUseOn(nsUseOnPage::PD_ALL);
+        pDesc->SetUseOn(UseOnPage::All);
 
         // Page size
         rFormat.SetFormatAttr(SwFormatFrameSize(ATT_FIX_SIZE,
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 6cf5c41..0da2223 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -256,7 +256,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
             rFormat.SetFormatAttr(SwFormatFooter(false));
             aDesc.ChgFooterShare(false);
 
-            aDesc.SetUseOn(nsUseOnPage::PD_ALL);                // Site numbering
+            aDesc.SetUseOn(UseOnPage::All);                // Site numbering
 
             // Set page size
             long lPgWidth, lPgHeight;
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index c416a66..27985eb 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -105,7 +105,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
         const MapMode aTmpMap( MapUnit::MapTwip );
         const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
 
-        if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() )    // mirrored pages
+        if( UseOnPage::Mirror == rDesc.GetUseOn() )    // mirrored pages
         {
             const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
             aPageSize.Width() += std::abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) );
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 799a6d8..84eaceb 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -168,7 +168,7 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
     sal_uInt16 nPhyPage, nVirPage;
     GetWrtShell().GetPageNum( nPhyPage, nVirPage );
 
-    if ( rDesc.GetUseOn() == nsUseOnPage::PD_MIRROR && (nPhyPage % 2) == 0 )
+    if ( rDesc.GetUseOn() == UseOnPage::Mirror && (nPhyPage % 2) == 0 )
     {
         long nTmp = rLRSpace.GetRight();
         rLRSpace.SetRight( rLRSpace.GetLeft() );
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 173fa4f..571b0ba 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -232,32 +232,32 @@ void FillHdFt(SwFrameFormat* pFormat, const  SfxItemSet& rSet)
 }
 
 /// Convert from UseOnPage to SvxPageUsage.
-UseOnPage lcl_convertUseToSvx(UseOnPage nUse)
+SvxPageUsage lcl_convertUseToSvx(UseOnPage nUse)
 {
-    UseOnPage nRet = nsUseOnPage::PD_NONE;
-    if ((nUse & nsUseOnPage::PD_LEFT) == nsUseOnPage::PD_LEFT)
+    int nRet = 0;
+    if (nUse & UseOnPage::Left)
         nRet |= SVX_PAGE_LEFT;
-    if ((nUse & nsUseOnPage::PD_RIGHT) == nsUseOnPage::PD_RIGHT)
+    if (nUse & UseOnPage::Right)
         nRet |= SVX_PAGE_RIGHT;
-    if ((nUse & nsUseOnPage::PD_ALL) == nsUseOnPage::PD_ALL)
+    if ((nUse & UseOnPage::All) == UseOnPage::All)
         nRet |= SVX_PAGE_ALL;
-    if ((nUse & nsUseOnPage::PD_MIRROR) == nsUseOnPage::PD_MIRROR)
+    if ((nUse & UseOnPage::Mirror) == UseOnPage::Mirror)
         nRet |= SVX_PAGE_MIRROR;
-    return nRet;
+    return (SvxPageUsage)nRet;
 }
 
 /// Convert from SvxPageUsage to UseOnPage.
-UseOnPage lcl_convertUseFromSvx(UseOnPage nUse)
+UseOnPage lcl_convertUseFromSvx(SvxPageUsage nUse)
 {
-    UseOnPage nRet = nsUseOnPage::PD_NONE;
+    UseOnPage nRet = UseOnPage::NONE;
     if ((nUse & SVX_PAGE_LEFT) == SVX_PAGE_LEFT)
-        nRet |= nsUseOnPage::PD_LEFT;
+        nRet |= UseOnPage::Left;
     if ((nUse & SVX_PAGE_RIGHT) == SVX_PAGE_RIGHT)
-        nRet |= nsUseOnPage::PD_RIGHT;
+        nRet |= UseOnPage::Right;
     if ((nUse & SVX_PAGE_ALL) == SVX_PAGE_ALL)
-        nRet |= nsUseOnPage::PD_ALL;
+        nRet |= UseOnPage::All;
     if ((nUse & SVX_PAGE_MIRROR) == SVX_PAGE_MIRROR)
-        nRet |= nsUseOnPage::PD_MIRROR;
+        nRet |= UseOnPage::Mirror;
     return nRet;
 }
 
@@ -276,9 +276,9 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
     {
         const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>(rSet.Get(SID_ATTR_PAGE));
 
-        const sal_uInt16 nUse = rPageItem.GetPageUsage();
+        const SvxPageUsage nUse = (SvxPageUsage)rPageItem.GetPageUsage();
         if(nUse)
-            rPageDesc.SetUseOn( lcl_convertUseFromSvx((UseOnPage) nUse) );
+            rPageDesc.SetUseOn( lcl_convertUseFromSvx(nUse) );
         rPageDesc.SetLandscape(rPageItem.IsLandscape());
         SvxNumberType aNumType;
         aNumType.SetNumberingType( static_cast< sal_Int16 >(rPageItem.GetNumType()) );


More information about the Libreoffice-commits mailing list