[Libreoffice-commits] core.git: 2 commits - include/sfx2 sfx2/source sw/inc sw/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Dec 12 06:49:03 UTC 2017


 include/sfx2/linksrc.hxx             |    4 
 sfx2/source/appl/linksrc.cxx         |    8 -
 sw/inc/cellatr.hxx                   |    6 -
 sw/inc/grfatr.hxx                    |   24 ++---
 sw/inc/hintids.hxx                   |  161 +++++++++++++++--------------------
 sw/source/core/docnode/swbaslnk.cxx  |    4 
 sw/source/core/draw/dflyobj.cxx      |    2 
 sw/source/core/table/swtable.cxx     |    4 
 sw/source/core/undo/rolbck.cxx       |    3 
 sw/source/core/unocore/unoframe.cxx  |    2 
 sw/source/core/unocore/unomap.cxx    |    1 
 sw/source/filter/basflt/fltshell.cxx |    2 
 sw/source/filter/xml/xmlitemm.cxx    |    1 
 sw/source/uibase/ribbar/inputwin.cxx |    2 
 sw/source/uibase/shells/frmsh.cxx    |    2 
 sw/source/uibase/shells/grfsh.cxx    |   54 +++++------
 sw/source/uibase/shells/tabsh.cxx    |    8 -
 17 files changed, 137 insertions(+), 151 deletions(-)

New commits:
commit d905c783e7f20ea1f18600252cd92c02ea7f91f7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Dec 11 14:52:04 2017 +0200

    TypeWhichId in sw
    
    Change-Id: Ia5654aaf88f13c37f52e3c17d61dd3475641070a
    Reviewed-on: https://gerrit.libreoffice.org/46230
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx
index 30027fc64c77..795e03952aeb 100644
--- a/sw/inc/cellatr.hxx
+++ b/sw/inc/cellatr.hxx
@@ -100,11 +100,11 @@ public:
 };
 
 inline const SwTableBoxNumFormat      &SwAttrSet::GetTableBoxNumFormat(bool bInP) const
-    {   return static_cast<const SwTableBoxNumFormat&>(Get( RES_BOXATR_FORMAT,bInP)); }
+    {   return Get( RES_BOXATR_FORMAT,bInP); }
 inline const SwTableBoxFormula        &SwAttrSet::GetTableBoxFormula(bool bInP) const
-    {   return static_cast<const SwTableBoxFormula&>(Get( RES_BOXATR_FORMULA,bInP)); }
+    {   return Get( RES_BOXATR_FORMULA,bInP); }
 inline const SwTableBoxValue          &SwAttrSet::GetTableBoxValue(bool bInP) const
-    {   return static_cast<const SwTableBoxValue&>(Get( RES_BOXATR_VALUE, bInP)); }
+    {   return Get( RES_BOXATR_VALUE, bInP); }
 
 inline const SwTableBoxNumFormat      &SwFormat::GetTableBoxNumFormat(bool bInP) const
     {   return m_aSet.GetTableBoxNumFormat(bInP); }
diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx
index 306f9a9757fe..175bdcd480e3 100644
--- a/sw/inc/grfatr.hxx
+++ b/sw/inc/grfatr.hxx
@@ -288,29 +288,29 @@ public:
 
 // Implementation of graphics attributes methods of SwAttr
 inline const SwMirrorGrf &SwAttrSet::GetMirrorGrf(bool bInP) const
-    { return static_cast<const SwMirrorGrf&>(Get( RES_GRFATR_MIRRORGRF,bInP)); }
+    { return Get( RES_GRFATR_MIRRORGRF,bInP); }
 inline const SwCropGrf   &SwAttrSet::GetCropGrf(bool bInP) const
-    { return static_cast<const SwCropGrf&>(Get( RES_GRFATR_CROPGRF,bInP)); }
+    { return Get( RES_GRFATR_CROPGRF,bInP); }
 inline const SwRotationGrf &SwAttrSet::GetRotationGrf(bool bInP) const
-    { return static_cast<const SwRotationGrf&>(Get( RES_GRFATR_ROTATION,bInP)); }
+    { return Get( RES_GRFATR_ROTATION,bInP); }
 inline const SwLuminanceGrf &SwAttrSet::GetLuminanceGrf(bool bInP) const
-    { return static_cast<const SwLuminanceGrf&>(Get( RES_GRFATR_LUMINANCE,bInP)); }
+    { return Get( RES_GRFATR_LUMINANCE,bInP); }
 inline const SwContrastGrf &SwAttrSet::GetContrastGrf(bool bInP) const
-    { return static_cast<const SwContrastGrf&>(Get( RES_GRFATR_CONTRAST,bInP)); }
+    { return Get( RES_GRFATR_CONTRAST,bInP); }
 inline const SwChannelRGrf &SwAttrSet::GetChannelRGrf(bool bInP) const
-    { return static_cast<const SwChannelRGrf&>(Get( RES_GRFATR_CHANNELR,bInP)); }
+    { return Get( RES_GRFATR_CHANNELR,bInP); }
 inline const SwChannelGGrf &SwAttrSet::GetChannelGGrf(bool bInP) const
-    { return static_cast<const SwChannelGGrf&>(Get( RES_GRFATR_CHANNELG,bInP)); }
+    { return Get( RES_GRFATR_CHANNELG,bInP); }
 inline const SwChannelBGrf &SwAttrSet::GetChannelBGrf(bool bInP) const
-    { return static_cast<const SwChannelBGrf&>(Get( RES_GRFATR_CHANNELB,bInP)); }
+    { return Get( RES_GRFATR_CHANNELB,bInP); }
 inline const SwGammaGrf &SwAttrSet::GetGammaGrf(bool bInP) const
-    { return static_cast<const SwGammaGrf&>(Get( RES_GRFATR_GAMMA,bInP)); }
+    { return Get( RES_GRFATR_GAMMA,bInP); }
 inline const SwInvertGrf &SwAttrSet::GetInvertGrf(bool bInP) const
-    { return static_cast<const SwInvertGrf&>(Get( RES_GRFATR_INVERT,bInP)); }
+    { return Get( RES_GRFATR_INVERT,bInP); }
 inline const SwTransparencyGrf &SwAttrSet::GetTransparencyGrf(bool bInP) const
-    { return static_cast<const SwTransparencyGrf&>(Get( RES_GRFATR_TRANSPARENCY,bInP)); }
+    { return Get( RES_GRFATR_TRANSPARENCY,bInP); }
 inline const SwDrawModeGrf      &SwAttrSet::GetDrawModeGrf(bool bInP) const
-    { return static_cast<const SwDrawModeGrf&>(Get( RES_GRFATR_DRAWMODE,bInP)); }
+    { return Get( RES_GRFATR_DRAWMODE,bInP); }
 
 #endif // INCLUDED_SW_INC_GRFATR_HXX
 
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 344478a078ef..c4017211a045 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -229,46 +229,37 @@ RES_FRMATR_BEGIN = RES_PARATR_LIST_END,
 RES_FRMATR_END
 };
 
-enum RES_GRFATR
-{
-RES_GRFATR_BEGIN = RES_FRMATR_END,
-    RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN,        // 130
-    RES_GRFATR_CROPGRF,                             // 131
-
-    RES_GRFATR_ROTATION,                            // 132
-    RES_GRFATR_LUMINANCE,                           // 133
-    RES_GRFATR_CONTRAST,                            // 134
-    RES_GRFATR_CHANNELR,                            // 135
-    RES_GRFATR_CHANNELG,                            // 136
-    RES_GRFATR_CHANNELB,                            // 137
-    RES_GRFATR_GAMMA,                               // 138
-    RES_GRFATR_INVERT,                              // 139
-    RES_GRFATR_TRANSPARENCY,                        // 140
-    RES_GRFATR_DRAWMODE,                            // 141
-
-    RES_GRFATR_DUMMY1,                              // 142
-    RES_GRFATR_DUMMY2,                              // 143
-    RES_GRFATR_DUMMY3,                              // 144
-    RES_GRFATR_DUMMY4,                              // 145
-    RES_GRFATR_DUMMY5,                              // 146
-RES_GRFATR_END
-};
-
-enum RES_BOXATR
-{
-RES_BOXATR_BEGIN = RES_GRFATR_END,
-    RES_BOXATR_FORMAT = RES_BOXATR_BEGIN,           // 147
-    RES_BOXATR_FORMULA,                             // 148
-    RES_BOXATR_VALUE,                               // 149
-RES_BOXATR_END
-};
-
-enum RES_UNKNOWNATR
-{
-RES_UNKNOWNATR_BEGIN = RES_BOXATR_END,
-    RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 150
-RES_UNKNOWNATR_END
-};
+#define RES_GRFATR_BEGIN RES_FRMATR_END
+#define     RES_GRFATR_MIRRORGRF    TypedWhichId<SwMirrorGrf>(RES_GRFATR_BEGIN) // 130
+#define     RES_GRFATR_CROPGRF      TypedWhichId<SwCropGrf>(131) // 131
+
+#define     RES_GRFATR_ROTATION     TypedWhichId<SwRotationGrf>(132)  // 132
+#define     RES_GRFATR_LUMINANCE    TypedWhichId<SwLuminanceGrf>(133)  // 133
+#define     RES_GRFATR_CONTRAST     TypedWhichId<SwContrastGrf>(134)  // 134
+#define     RES_GRFATR_CHANNELR     TypedWhichId<SwChannelRGrf>(135)  // 135
+#define     RES_GRFATR_CHANNELG     TypedWhichId<SwChannelGGrf>(136)  // 136
+#define     RES_GRFATR_CHANNELB     TypedWhichId<SwChannelBGrf>(137)  // 137
+#define     RES_GRFATR_GAMMA        TypedWhichId<SwGammaGrf>(138)  // 138
+#define     RES_GRFATR_INVERT       TypedWhichId<SwInvertGrf>(139)  // 139
+#define     RES_GRFATR_TRANSPARENCY TypedWhichId<SwTransparencyGrf>(140)  // 140
+#define     RES_GRFATR_DRAWMODE     TypedWhichId<SwDrawModeGrf>(141)  // 141
+
+#define     RES_GRFATR_DUMMY1       TypedWhichId<SfxBoolItem>(142)  // 142
+#define     RES_GRFATR_DUMMY2       TypedWhichId<SfxBoolItem>(143)  // 143
+#define     RES_GRFATR_DUMMY3       TypedWhichId<SfxBoolItem>(144)  // 144
+#define     RES_GRFATR_DUMMY4       TypedWhichId<SfxBoolItem>(145)  // 145
+#define     RES_GRFATR_DUMMY5       TypedWhichId<SfxBoolItem>(146)  // 146
+#define RES_GRFATR_END (147)
+
+#define RES_BOXATR_BEGIN RES_GRFATR_END
+#define     RES_BOXATR_FORMAT       TypedWhichId<SwTableBoxNumFormat>(RES_BOXATR_BEGIN) // 147
+#define     RES_BOXATR_FORMULA      TypedWhichId<SwTableBoxFormula>(148) // 148
+#define     RES_BOXATR_VALUE        TypedWhichId<SwTableBoxValue>(149) // 149
+#define RES_BOXATR_END (150)
+
+#define RES_UNKNOWNATR_BEGIN RES_BOXATR_END
+#define     RES_UNKNOWNATR_CONTAINER TypedWhichId<SvXMLAttrContainerItem>(RES_UNKNOWNATR_BEGIN)// 150
+#define RES_UNKNOWNATR_END (151)
 
 // Format IDs
 enum RES_FMT
@@ -285,59 +276,53 @@ RES_FMT_END
 };
 
 // ID's for Messages in the Formats
-enum RES_MSG
-{
-RES_MSG_BEGIN = RES_FMT_END,
-    RES_OBJECTDYING = RES_MSG_BEGIN,                // 158
-    RES_FMT_CHG,
-    RES_ATTRSET_CHG,
-    RES_INS_TXT,
-    RES_DEL_CHR,
-    RES_DEL_TXT,
-    RES_UPDATE_ATTR,
-    RES_REFMARKFLD_UPDATE,
-    RES_DOCPOS_UPDATE,
-    RES_TABLEFML_UPDATE,
-    RES_UPDATEDDETBL,
-    RES_TBLHEADLINECHG,
-    RES_AUTOFMT_DOCNODE,
-    RES_SECTION_HIDDEN,
-    RES_SECTION_NOT_HIDDEN,
-    RES_GRAPHIC_ARRIVED,
-    RES_GRAPHIC_PIECE_ARRIVED,
-    RES_HIDDENPARA_PRINT,
-    RES_CONDCOLL_CONDCHG,
-    RES_VIRTPAGENUM_INFO,
-    RES_RESET_FMTWRITTEN,
-    RES_REMOVE_UNO_OBJECT,
-    RES_GRF_REREAD_AND_INCACHE,
-    RES_SECTION_RESETHIDDENFLAG,
-    RES_FINDNEARESTNODE,
-    RES_CONTENT_VISIBLE,
-    RES_GRAPHIC_SWAPIN,
-    RES_NAME_CHANGED,
-    RES_TITLE_CHANGED,
-    RES_DESCRIPTION_CHANGED,
-    RES_LINKED_GRAPHIC_STREAM_ARRIVED,
-RES_MSG_END
-};
+#define RES_MSG_BEGIN RES_FMT_END
+#define     RES_OBJECTDYING           TypedWhichId<SwPtrMsgPoolItem>(RES_MSG_BEGIN)                // 158
+#define     RES_FMT_CHG               TypedWhichId<SwFormatChg>(159)
+#define     RES_ATTRSET_CHG           TypedWhichId<SwAttrSetChg>(160)
+#define     RES_INS_TXT               TypedWhichId<SwInsText>(161)
+#define     RES_DEL_CHR               TypedWhichId<SwDelChr>(162)
+#define     RES_DEL_TXT               TypedWhichId<SwDelText>(163)
+#define     RES_UPDATE_ATTR           TypedWhichId<SwUpdateAttr>(164)
+#define     RES_REFMARKFLD_UPDATE     TypedWhichId<SwRefMarkFieldUpdate>(165)
+#define     RES_DOCPOS_UPDATE         TypedWhichId<SwDocPosUpdate>(166)
+#define     RES_TABLEFML_UPDATE       TypedWhichId<SwTableFormulaUpdate>(167)
+#define     RES_UPDATEDDETBL          TypedWhichId<SwMsgPoolItem>(168)
+#define     RES_TBLHEADLINECHG        TypedWhichId<SwMsgPoolItem>(169)
+#define     RES_AUTOFMT_DOCNODE       TypedWhichId<SwAutoFormatGetDocNode>(170)
+#define     RES_SECTION_HIDDEN        TypedWhichId<SwMsgPoolItem>(171)
+#define     RES_SECTION_NOT_HIDDEN    TypedWhichId<SwMsgPoolItem>(172)
+#define     RES_GRAPHIC_ARRIVED       TypedWhichId<SwMsgPoolItem>(173)
+#define     RES_GRAPHIC_PIECE_ARRIVED TypedWhichId<SwMsgPoolItem>(174)
+#define     RES_HIDDENPARA_PRINT      TypedWhichId<SwMsgPoolItem>(175)
+#define     RES_CONDCOLL_CONDCHG      TypedWhichId<SwCondCollCondChg>(176)
+#define     RES_VIRTPAGENUM_INFO      TypedWhichId<SwVirtPageNumInfo>(177)
+#define     RES_RESET_FMTWRITTEN      TypedWhichId<SfxBoolItem>(178)
+#define     RES_REMOVE_UNO_OBJECT     TypedWhichId<SwPtrMsgPoolItem>(179)
+#define     RES_GRF_REREAD_AND_INCACHE   TypedWhichId<SwMsgPoolItem>(180)
+#define     RES_SECTION_RESETHIDDENFLAG  TypedWhichId<SfxBoolItem>(181)
+#define     RES_FINDNEARESTNODE       TypedWhichId<SwFindNearestNode>(182)
+#define     RES_CONTENT_VISIBLE       TypedWhichId<SwPtrMsgPoolItem>(183)
+#define     RES_GRAPHIC_SWAPIN        TypedWhichId<SwMsgPoolItem>(184)
+#define     RES_NAME_CHANGED          TypedWhichId<SwStringMsgPoolItem>(185)
+#define     RES_TITLE_CHANGED         TypedWhichId<SwStringMsgPoolItem>(186)
+#define     RES_DESCRIPTION_CHANGED   TypedWhichId<SwStringMsgPoolItem>(187)
+#define     RES_LINKED_GRAPHIC_STREAM_ARRIVED TypedWhichId<SwMsgPoolItem>(187)
+#define RES_MSG_END (188)
 
 // An ID for the RTF-reader. The stylesheets are treated like attributes,
 // i.e. there is a StyleSheet-attribute. To avoid collision with other
 // Which()-values, the value is listed here. (The help system too defines
 // new attributes!)
-enum RES_FLTRATTR
-{
-    RES_FLTRATTR_BEGIN = RES_MSG_END,
-    RES_FLTR_BOOKMARK = RES_FLTRATTR_BEGIN,
-    RES_FLTR_ANCHOR,
-    RES_FLTR_NUMRULE,
-    RES_FLTR_TOX,
-    RES_FLTR_REDLINE,
-    RES_FLTR_ANNOTATIONMARK,
-    RES_FLTR_RDFMARK,
-    RES_FLTRATTR_END
-};
+#define     RES_FLTRATTR_BEGIN RES_MSG_END
+#define     RES_FLTR_BOOKMARK       TypedWhichId<SfxStringItem>(RES_FLTRATTR_BEGIN)
+#define     RES_FLTR_ANCHOR         TypedWhichId<SwFltAnchor>(189)
+#define     RES_FLTR_NUMRULE        TypedWhichId<SfxStringItem>(190)
+#define     RES_FLTR_TOX            TypedWhichId<SwFltTOX>(191)
+#define     RES_FLTR_REDLINE        TypedWhichId<SwFltRedline>(192)
+#define     RES_FLTR_ANNOTATIONMARK TypedWhichId<CntUInt16Item>(193)
+#define     RES_FLTR_RDFMARK        TypedWhichId<SwFltRDFMark>(194)
+#define     RES_FLTRATTR_END 195
 
 #define RES_TBX_DUMMY RES_FLTRATTR_END + 1
 
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index fb86b9aa3455..ca8b9183b96c 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -219,8 +219,8 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
         else if( pSh )
             pSh->StartAction();
 
-        SwMsgPoolItem aMsgHint( static_cast<sal_uInt16>(
-            bGraphicArrived ? RES_GRAPHIC_ARRIVED : RES_UPDATE_ATTR ) );
+        SwMsgPoolItem aMsgHint(
+            bGraphicArrived ? sal_uInt16(RES_GRAPHIC_ARRIVED) : sal_uInt16(RES_UPDATE_ATTR) );
 
         if ( bGraphicArrived )
         {
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index ce6670f4bd26..a0414846977d 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -868,7 +868,7 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou
     // Get old values for crop in 10th of mm
     SfxItemSet aSet( pSh->GetAttrPool(), svl::Items<RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF>{} );
     pSh->GetCurAttr( aSet );
-    SwCropGrf aCrop( static_cast<const SwCropGrf&>(aSet.Get(RES_GRFATR_CROPGRF)) );
+    SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) );
 
     tools::Rectangle aCropRectangle(
         convertTwipToMm100(aCrop.GetLeft()),
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 00702490bc31..de2d7775b811 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2184,8 +2184,8 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
                 const SfxItemSet& rSet = *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet();
                 if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT,
                                     false, reinterpret_cast<const SfxPoolItem**>(&pNewFormat) ) )
-                    nOldFormat = static_cast<const SwTableBoxNumFormat&>(static_cast<const SwAttrSetChg*>(pOld)->
-                            GetChgSet()->Get( RES_BOXATR_FORMAT )).GetValue();
+                    nOldFormat = static_cast<const SwAttrSetChg*>(pOld)->
+                            GetChgSet()->Get( RES_BOXATR_FORMAT ).GetValue();
                 rSet.GetItemState( RES_BOXATR_FORMULA, false,
                                     reinterpret_cast<const SfxPoolItem**>(&pNewFormula) );
                 rSet.GetItemState( RES_BOXATR_VALUE, false,
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 6459a46f692e..f10e66c17fbb 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -718,8 +718,7 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
                         if ( rNew.IsIntrnlName() )
                         {
                             const SwTableBoxFormula& rOld =
-                                static_cast<const SwTableBoxFormula&>(
-                                        rSet.Get( RES_BOXATR_FORMULA ));
+                                        rSet.Get( RES_BOXATR_FORMULA );
                             const SwNode* pNd = rOld.GetNodeOfFormula();
                             if ( pNd )
                             {
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 7ff0c80d95c0..64e06adf9138 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1035,7 +1035,7 @@ static inline void lcl_FillMirror ( SfxItemSet &rToSet, const ::SfxItemSet &rFro
 {
     if(pHEvenMirror || pHOddMirror || pVMirror )
     {
-        SwMirrorGrf aMirror ( static_cast < const ::SwMirrorGrf& > ( rFromSet.Get ( RES_GRFATR_MIRRORGRF ) ) );
+        SwMirrorGrf aMirror ( rFromSet.Get ( RES_GRFATR_MIRRORGRF ) );
         if(pHEvenMirror)
             rRet &= static_cast<SfxPoolItem&>(aMirror).PutValue(*pHEvenMirror, MID_MIRROR_HORZ_EVEN_PAGES);
         if(pHOddMirror)
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 94c11d3d8b63..c6c187c6591f 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -79,6 +79,7 @@
 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
 #include <osl/diagnose.h>
 #include <swtypes.hxx>
+#include <cellatr.hxx>
 #include <unomap.hxx>
 #include <unoprnms.hxx>
 #include <unomid.h>
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index db304f060305..970d613ba541 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -373,7 +373,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
 
     OSL_ENSURE(!nAttrId ||
         (POOLATTR_BEGIN <= nAttrId && POOLATTR_END > nAttrId) ||
-        (RES_FLTRATTR_BEGIN <= nAttrId && RES_FLTRATTR_END > nAttrId),
+        (RES_FLTRATTR_BEGIN <= nAttrId && sal_uInt16(RES_FLTRATTR_END) > nAttrId),
         "Wrong id for attribute");
 
     myEIter aI = m_Entries.begin();
diff --git a/sw/source/filter/xml/xmlitemm.cxx b/sw/source/filter/xml/xmlitemm.cxx
index dbe624019ccb..998e430f108d 100644
--- a/sw/source/filter/xml/xmlitemm.cxx
+++ b/sw/source/filter/xml/xmlitemm.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <editeng/memberids.h>
+#include <editeng/xmlcnitm.hxx>
 #include <hintids.hxx>
 #include <svx/unomid.hxx>
 #include <xmloff/xmlnmspe.hxx>
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 9e41761cfeac..7001bec02ee1 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -257,7 +257,7 @@ void SwInputWindow::ShowWin()
 
                 SfxItemSet aSet( pWrtShell->GetAttrPool(), svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA>{} );
                 if( pWrtShell->GetTableBoxFormulaAttrs( aSet ))
-                    sEdit += static_cast<const SwTableBoxFormula&>(aSet.Get( RES_BOXATR_FORMULA )).GetFormula();
+                    sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula();
             }
         }
 
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 9e4761cd9da4..cfb535a0dfa9 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -373,7 +373,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 const sal_uInt32 nNewRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
                 SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
                 rSh.GetCurAttr(aSet);
-                const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aSet.Get(RES_GRFATR_ROTATION));
+                const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
                 const sal_uInt32 nOldRot(rRotation.GetValue());
 
                 // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 23857b2b4745..2b3a7a8d13d3 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -206,8 +206,8 @@ void SwGrfShell::Execute(SfxRequest &rReq)
 
                 SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF>{} );
                 rSh.GetCurAttr( aSet );
-                SwMirrorGrf aMirror( static_cast<const SwMirrorGrf&>( aSet.Get(RES_GRFATR_MIRRORGRF)) );
-                SwCropGrf aCrop( static_cast<const SwCropGrf&>( aSet.Get(RES_GRFATR_CROPGRF)) );
+                SwMirrorGrf aMirror( aSet.Get(RES_GRFATR_MIRRORGRF) );
+                SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) );
 
                 tools::Rectangle aCropRectangle(
                     convertTwipToMm100(aCrop.GetLeft()),
@@ -405,7 +405,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
                 // convert from 10th degrees to 100th degrees
                 SfxItemSet aTmpSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
                 rSh.GetCurAttr( aTmpSet );
-                const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aTmpSet.Get(RES_GRFATR_ROTATION));
+                const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION);
                 nCurrentRotation = rRotation.GetValue();
                 aUnrotatedSize = rRotation.GetUnrotatedSize();
                 aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE, nCurrentRotation * 10));
@@ -550,7 +550,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
         {
             SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_MIRRORGRF>{});
             rSh.GetCurAttr( aSet );
-            SwMirrorGrf aGrf(static_cast<const SwMirrorGrf &>(aSet.Get(RES_GRFATR_MIRRORGRF)));
+            SwMirrorGrf aGrf(aSet.Get(RES_GRFATR_MIRRORGRF));
             aGrf.SetGrfToggle(!aGrf.IsGrfToggle());
             rSh.SetAttrItem(aGrf);
         }
@@ -593,7 +593,7 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq )
             case SID_FLIP_HORIZONTAL:
             {
                 GetShell().GetCurAttr( aGrfSet );
-                SwMirrorGrf aMirror( static_cast<const SwMirrorGrf&>(aGrfSet.Get( RES_GRFATR_MIRRORGRF )) );
+                SwMirrorGrf aMirror( aGrfSet.Get( RES_GRFATR_MIRRORGRF ) );
                 MirrorGraph nMirror = aMirror.GetValue();
                 if ( nSlot==SID_FLIP_HORIZONTAL )
                     switch( nMirror )
@@ -792,8 +792,8 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
         case SID_FLIP_HORIZONTAL:
             if( !bParentCntProt )
             {
-                MirrorGraph nState = static_cast<const SwMirrorGrf &>( aCoreSet.Get(
-                                        RES_GRFATR_MIRRORGRF )).GetValue();
+                MirrorGraph nState = aCoreSet.Get(
+                                        RES_GRFATR_MIRRORGRF ).GetValue();
 
                 rSet.Put(SfxBoolItem( nWhich, nState == MirrorGraph::Vertical ||
                                               nState == MirrorGraph::Both));
@@ -811,38 +811,38 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
 
         case SID_ATTR_GRAF_LUMINANCE:
             if( !bParentCntProt )
-                rSet.Put( SfxInt16Item( nWhich, static_cast<const SwLuminanceGrf&>(
-                        aCoreSet.Get(RES_GRFATR_LUMINANCE)).GetValue() ));
+                rSet.Put( SfxInt16Item( nWhich,
+                        aCoreSet.Get(RES_GRFATR_LUMINANCE).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_CONTRAST:
             if( !bParentCntProt )
-                rSet.Put( SfxInt16Item( nWhich, static_cast<const SwContrastGrf&>(
-                        aCoreSet.Get(RES_GRFATR_CONTRAST)).GetValue() ));
+                rSet.Put( SfxInt16Item( nWhich,
+                        aCoreSet.Get(RES_GRFATR_CONTRAST).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_RED:
             if( !bParentCntProt )
-                rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelRGrf&>(
-                        aCoreSet.Get(RES_GRFATR_CHANNELR)).GetValue() ));
+                rSet.Put( SfxInt16Item( nWhich,
+                        aCoreSet.Get(RES_GRFATR_CHANNELR).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_GREEN:
             if( !bParentCntProt )
-                rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelGGrf&>(
-                        aCoreSet.Get(RES_GRFATR_CHANNELG)).GetValue() ));
+                rSet.Put( SfxInt16Item( nWhich,
+                        aCoreSet.Get(RES_GRFATR_CHANNELG).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_BLUE:
             if( !bParentCntProt )
-                rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelBGrf&>(
-                        aCoreSet.Get(RES_GRFATR_CHANNELB)).GetValue() ));
+                rSet.Put( SfxInt16Item( nWhich,
+                        aCoreSet.Get(RES_GRFATR_CHANNELB).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_GAMMA:
             if( !bParentCntProt )
                 rSet.Put( SfxUInt32Item( nWhich, static_cast< sal_uInt32 >(
-                    static_cast<const SwGammaGrf&>(aCoreSet.Get( RES_GRFATR_GAMMA ) ).GetValue() * 100 ) ) );
+                    aCoreSet.Get( RES_GRFATR_GAMMA ).GetValue() * 100 ) ) );
             break;
 
         case SID_ATTR_GRAF_TRANSPARENCE:
@@ -856,22 +856,22 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
                         GraphicType::GdiMetafile == pGrafObj->GetType() )
                         bDisable = true;
                     else
-                        rSet.Put( SfxUInt16Item( nWhich, static_cast<const SwTransparencyGrf&>(
-                            aCoreSet.Get(RES_GRFATR_TRANSPARENCY)).GetValue() ));
+                        rSet.Put( SfxUInt16Item( nWhich,
+                            aCoreSet.Get(RES_GRFATR_TRANSPARENCY).GetValue() ));
                 }
             }
             break;
 
         case SID_ATTR_GRAF_INVERT:
             if( !bParentCntProt )
-                rSet.Put( SfxBoolItem( nWhich, static_cast<const SwInvertGrf&>(
-                        aCoreSet.Get(RES_GRFATR_INVERT)).GetValue() ));
+                rSet.Put( SfxBoolItem( nWhich,
+                        aCoreSet.Get(RES_GRFATR_INVERT).GetValue() ));
             break;
 
         case SID_ATTR_GRAF_MODE:
             if( !bParentCntProt )
-                rSet.Put( SfxUInt16Item( nWhich, (sal_uInt16)static_cast<const SwDrawModeGrf&>(
-                              aCoreSet.Get(RES_GRFATR_DRAWMODE)).GetValue() ));
+                rSet.Put( SfxUInt16Item( nWhich, (sal_uInt16)
+                              aCoreSet.Get(RES_GRFATR_DRAWMODE).GetValue() ));
             break;
 
         case SID_GRFFILTER:
@@ -951,7 +951,7 @@ void SwGrfShell::ExecuteRotation(SfxRequest const &rReq)
         SwWrtShell& rShell = GetShell();
         SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
         rShell.GetCurAttr( aSet );
-        const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aSet.Get(RES_GRFATR_ROTATION));
+        const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
         SwFlyFrameAttrMgr aMgr(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF);
 
         // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
@@ -997,7 +997,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet)
                 // RotGrfFlyFrame: disable when already no rotation
                 SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
                 rShell.GetCurAttr( aSet );
-                const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aSet.Get(RES_GRFATR_ROTATION));
+                const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
                 bDisable = (0 == rRotation.GetValue());
                 break;
             }
@@ -1007,7 +1007,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet)
                 // SID_ATTR_TRANSFORM_ANGLE, convert from 10th degrees to 100th degrees
                 SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
                 rShell.GetCurAttr( aSet );
-                const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aSet.Get(RES_GRFATR_ROTATION));
+                const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
                 rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE, rRotation.GetValue() * 10));
                 break;
             }
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 61814a10b53a..c6e73aa8b2ce 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -656,13 +656,13 @@ void SwTableShell::Execute(SfxRequest &rReq)
                 }
                 else
                     aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE,
-                                    static_cast<const SwTableBoxNumFormat&>(aBoxSet.Get(
-                                    RES_BOXATR_FORMAT )).GetValue() ));
+                                    aBoxSet.Get(
+                                    RES_BOXATR_FORMAT ).GetValue() ));
 
                 OUString sCurText( rSh.GetTableBoxText() );
                 aCoreSet.Put( SvxNumberInfoItem( pFormatter,
-                                    static_cast<const SwTableBoxValue&>(aBoxSet.Get(
-                                        RES_BOXATR_VALUE)).GetValue(),
+                                    aBoxSet.Get(
+                                        RES_BOXATR_VALUE).GetValue(),
                                     sCurText, SID_ATTR_NUMBERFORMAT_INFO ));
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
commit bb76df91431e2043a0683ea4140fe69178e10c8d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Dec 11 13:57:00 2017 +0200

    sal_uIntPtr->sal_uInt64 in Get/SetUpdateTimeout
    
    to match the call on the underlying Timer
    
    Change-Id: Ia9044afa18decde69330962f74f7be477e9962fc
    Reviewed-on: https://gerrit.libreoffice.org/46226
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/linksrc.hxx b/include/sfx2/linksrc.hxx
index bcc6e88b8ba7..8eff0afd0376 100644
--- a/include/sfx2/linksrc.hxx
+++ b/include/sfx2/linksrc.hxx
@@ -64,8 +64,8 @@ public:
 
     void                Closed();
 
-    sal_uIntPtr                 GetUpdateTimeout() const;
-    void                SetUpdateTimeout( sal_uIntPtr nTime );
+    sal_uInt64          GetUpdateTimeout() const;
+    void                SetUpdateTimeout( sal_uInt64 nTimeMs );
                         // notify the sink, the mime type is not
                         // a selection criterion
     void                DataChanged( const rtl::OUString & rMimeType,
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index 2ecffc5b02c4..05e1f92fa12d 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -55,7 +55,7 @@ void SvLinkSourceTimer::Invoke()
 }
 
 static void StartTimer( std::unique_ptr<SvLinkSourceTimer>& pTimer, SvLinkSource * pOwner,
-                        sal_uIntPtr nTimeout )
+                        sal_uInt64 nTimeout )
 {
     if( !pTimer )
     {
@@ -179,7 +179,7 @@ struct SvLinkSource_Impl
     OUString                aDataMimeType;
     std::unique_ptr<SvLinkSourceTimer>
                             pTimer;
-    sal_uIntPtr             nTimeout;
+    sal_uInt64              nTimeout;
     css::uno::Reference<css::io::XInputStream>
                             m_xInputStreamToLoadFrom;
     bool                    m_bIsReadOnly;
@@ -229,12 +229,12 @@ void  SvLinkSource::Closed()
             p->xSink->Closed();
 }
 
-sal_uIntPtr SvLinkSource::GetUpdateTimeout() const
+sal_uInt64 SvLinkSource::GetUpdateTimeout() const
 {
     return pImpl->nTimeout;
 }
 
-void SvLinkSource::SetUpdateTimeout( sal_uIntPtr nTimeout )
+void SvLinkSource::SetUpdateTimeout( sal_uInt64 nTimeout )
 {
     pImpl->nTimeout = nTimeout;
     if( pImpl->pTimer )


More information about the Libreoffice-commits mailing list