[Libreoffice-commits] core.git: cui/source idl/source include/svx sc/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Dec 21 05:09:21 UTC 2017


 cui/source/inc/postdlg.hxx          |    6 -
 idl/source/prj/database.cxx         |  161 +++++++++++++++++++-----------------
 include/svx/svxids.hrc              |   48 ++++++----
 sc/source/ui/view/cellsh1.cxx       |    4 
 sw/source/core/docnode/ndtbl1.cxx   |    4 
 sw/source/core/unocore/unostyle.cxx |    2 
 sw/source/core/unocore/unotbl.cxx   |    3 
 sw/source/ui/frmdlg/column.cxx      |    3 
 sw/source/ui/misc/pgfnote.cxx       |    3 
 sw/source/ui/misc/pggrid.cxx        |    3 
 sw/source/uibase/frmdlg/colex.cxx   |    3 
 sw/source/uibase/misc/redlndlg.cxx  |    2 
 sw/source/uibase/shells/tabsh.cxx   |    3 
 sw/source/uibase/shells/textfld.cxx |    2 
 sw/source/uibase/shells/textsh.cxx  |    2 
 sw/source/uibase/uiview/viewtab.cxx |    5 -
 sw/source/uibase/utlui/uitool.cxx   |   18 +---
 17 files changed, 144 insertions(+), 128 deletions(-)

New commits:
commit 24158311c115c2db6dd05a751f75a5c084e2c0d1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Dec 20 13:30:21 2017 +0200

    TypedWhichId in svx part 1
    
    and teach the idl compiler how to ignore the TypeWhichId<T1> part
    of the define
    
    Change-Id: I030f54080924d51e9f0ac09b19e14106648024db
    Reviewed-on: https://gerrit.libreoffice.org/46849
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/inc/postdlg.hxx b/cui/source/inc/postdlg.hxx
index 678602a85feb..9c33e4ab9dd6 100644
--- a/cui/source/inc/postdlg.hxx
+++ b/cui/source/inc/postdlg.hxx
@@ -34,9 +34,9 @@
     over this list with links.
 
     [Items]
-    <SvxPostitAuthorItem><SID_ATTR_POSTIT_AUTHOR>
-    <SvxPostitDateItem><SID_ATTR_POSTIT_DATE>
-    <SvxPostitTextItem><SID_ATTR_POSTIT_TEXT>
+    <SvxPostItAuthorItem><SID_ATTR_POSTIT_AUTHOR>
+    <SvxPostItDateItem><SID_ATTR_POSTIT_DATE>
+    <SvxPostItTextItem><SID_ATTR_POSTIT_TEXT>
 */
 
 class SvxPostItDialog : public SfxModalDialog
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 46c7b576f5bd..62340e70cb0b 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -146,105 +146,120 @@ bool SvIdlDataBase::ReadIdFile( const OString& rOFileName )
     aIdFileList.push_back( rFileName );
     AddDepFile( aFullName );
     SvTokenStream aTokStm( aFullName );
-    if( aTokStm.GetStream().GetError() == ERRCODE_NONE )
-    {
-        SvToken& rTok = aTokStm.GetToken_Next();
+    if( aTokStm.GetStream().GetError() != ERRCODE_NONE )
+        return false;
+
+    SvToken& rTok = aTokStm.GetToken_Next();
 
-        while( !rTok.IsEof() )
+    while( !rTok.IsEof() )
+    {
+        if( rTok.IsChar() && rTok.GetChar() == '#' )
         {
-            if( rTok.IsChar() && rTok.GetChar() == '#' )
+            rTok = aTokStm.GetToken_Next();
+            if( rTok.Is( SvHash_define() ) )
             {
                 rTok = aTokStm.GetToken_Next();
-                if( rTok.Is( SvHash_define() ) )
+                OString aDefName;
+                if( !rTok.IsIdentifier() )
+                    throw SvParseException( "unexpected token after define", rTok );
+                aDefName = rTok.GetString();
+
+                sal_uLong nVal = 0;
+                bool bOk = true;
+                while( bOk )
                 {
                     rTok = aTokStm.GetToken_Next();
-                    OString aDefName;
-                    if( !rTok.IsIdentifier() )
-                        throw SvParseException( "unexpected token after define", rTok );
-                    aDefName = rTok.GetString();
-
-                    sal_uLong nVal = 0;
-                    bool bOk = true;
-                    while( bOk )
+                    if (rTok.GetTokenAsString().startsWith("TypedWhichId"))
                     {
                         rTok = aTokStm.GetToken_Next();
-                        if( rTok.IsIdentifier() )
-                        {
-                            sal_uLong n;
-                            if( FindId( rTok.GetString(), &n ) )
-                                nVal += n;
-                            else
-                                bOk = false;
-                        }
-                        else if( rTok.IsChar() )
-                        {
-                            if( rTok.GetChar() == '-'
-                              || rTok.GetChar() == '/'
-                              || rTok.GetChar() == '*'
-                              || rTok.GetChar() == '&'
-                              || rTok.GetChar() == '|'
-                              || rTok.GetChar() == '^'
-                              || rTok.GetChar() == '~' )
-                            {
-                                throw SvParseException( "unknown operator '" + OString(rTok.GetChar()) + "'in define", rTok );
-                            }
-                            if( rTok.GetChar() != '+'
-                              && rTok.GetChar() != '('
-                              && rTok.GetChar() != ')' )
-                                // only + is allowed, parentheses are immaterial
-                                // because + is commutative
-                                break;
-                        }
-                        else if( rTok.IsInteger() )
+                        if( !rTok.IsChar() || rTok.GetChar() != '<')
+                            throw SvParseException( "expected '<'", rTok );
+                        rTok = aTokStm.GetToken_Next();
+                        if( !rTok.IsIdentifier() )
+                            throw SvParseException( "expected identifier", rTok );
+                        rTok = aTokStm.GetToken_Next();
+                        if( !rTok.IsChar() || rTok.GetChar() != '>')
+                            throw SvParseException( "expected '<'", rTok );
+                        rTok = aTokStm.GetToken_Next();
+                    }
+                    else if( rTok.IsIdentifier() )
+                    {
+                        sal_uLong n;
+                        if( FindId( rTok.GetString(), &n ) )
+                            nVal += n;
+                        else
+                            bOk = false;
+                    }
+                    else if( rTok.IsChar() )
+                    {
+                        if( rTok.GetChar() == '-'
+                          || rTok.GetChar() == '/'
+                          || rTok.GetChar() == '*'
+                          || rTok.GetChar() == '&'
+                          || rTok.GetChar() == '|'
+                          || rTok.GetChar() == '^'
+                          || rTok.GetChar() == '~' )
                         {
-                            nVal += rTok.GetNumber();
+                            throw SvParseException( "unknown operator '" + OString(rTok.GetChar()) + "'in define", rTok );
                         }
-                        else
+                        if( rTok.GetChar() != '+'
+                          && rTok.GetChar() != '('
+                          && rTok.GetChar() != ')' )
+                            // only + is allowed, parentheses are immaterial
+                            // because + is commutative
                             break;
                     }
-                    if( bOk )
+                    else if( rTok.IsInteger() )
                     {
-                        InsertId( aDefName, nVal );
+                        nVal += rTok.GetNumber();
                     }
+                    else
+                        break;
+                }
+                if( bOk )
+                {
+                    InsertId( aDefName, nVal );
                 }
-                else if( rTok.Is( SvHash_include() ) )
+            }
+            else if( rTok.Is( SvHash_include() ) )
+            {
+                rTok = aTokStm.GetToken_Next();
+                OStringBuffer aNameBuf;
+                if( rTok.IsString() )
+                    aNameBuf.append(rTok.GetString());
+                else if( rTok.IsChar() && rTok.GetChar() == '<' )
                 {
                     rTok = aTokStm.GetToken_Next();
-                    OStringBuffer aNameBuf;
-                    if( rTok.IsString() )
-                        aNameBuf.append(rTok.GetString());
-                    else if( rTok.IsChar() && rTok.GetChar() == '<' )
+                    while( !rTok.IsEof()
+                      && !(rTok.IsChar() && rTok.GetChar() == '>') )
                     {
+                        aNameBuf.append(rTok.GetTokenAsString());
                         rTok = aTokStm.GetToken_Next();
-                        while( !rTok.IsEof()
-                          && !(rTok.IsChar() && rTok.GetChar() == '>') )
-                        {
-                            aNameBuf.append(rTok.GetTokenAsString());
-                            rTok = aTokStm.GetToken_Next();
-                        }
-                        if( rTok.IsEof() )
-                        {
-                            throw SvParseException("unexpected eof in #include", rTok);
-                        }
-                    }
-                    OString aName(aNameBuf.makeStringAndClear());
-                    if (aName == "sfx2/groupid.hxx")
-                    {
-                        // contains C++ code which we cannot parse
-                        // we special-case this by defining a macro internally in ....
                     }
-                    else if (!ReadIdFile(aName))
+                    if( rTok.IsEof() )
                     {
-                        throw SvParseException("cannot read file: " + aName, rTok);
+                        throw SvParseException("unexpected eof in #include", rTok);
                     }
                 }
+                OString aName(aNameBuf.makeStringAndClear());
+                if (aName == "sfx2/groupid.hxx")
+                {
+                    // contains C++ code which we cannot parse
+                    // we special-case this by defining a macro internally in ....
+                }
+                else if (aName == "svl/typedwhich.hxx")
+                {
+                    // contains C++ code which we cannot parse
+                }
+                else if (!ReadIdFile(aName))
+                {
+                    throw SvParseException("cannot read file: " + aName, rTok);
+                }
             }
-            else
-                rTok = aTokStm.GetToken_Next();
         }
+        else
+            rTok = aTokStm.GetToken_Next();
     }
-    else
-        return false;
     return true;
 }
 
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 8d0e22a22179..c7d0557ee293 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -24,6 +24,16 @@
 #include <sfx2/sfxsids.hrc>
 #include <editeng/editids.hrc>
 #include <svx/unomid.hxx>
+#include <svl/typedwhich.hxx>
+
+class SvxPageItem;
+class SvxSizeItem;
+class SvxLongULSpaceItem;
+class SvxLongLRSpaceItem;
+class SvxPostItAuthorItem;
+class SvxPostItDateItem;
+class SvxPostItTextItem;
+class SvxPostItIdItem;
 
 // member IDs
 
@@ -205,32 +215,32 @@
 
 // CAUTION! Range <1 .. 22> used by EditEngine (!)
 
-#define SID_ATTR_BORDER_INNER                           ( SID_SVX_START + 23 )
+#define SID_ATTR_BORDER_INNER                           TypedWhichId<SvxBoxInfoItem>( SID_SVX_START + 23 )
 
 // CAUTION! Range <24 .. 43> used by EditEngine (!)
 
-#define SID_ATTR_POSTIT_AUTHOR                          ( SID_SVX_START + 44 )
-#define SID_ATTR_POSTIT_DATE                            ( SID_SVX_START + 45 )
-#define SID_ATTR_POSTIT_TEXT                            ( SID_SVX_START + 46 )
-#define SID_ATTR_POSTIT_ID                              ( SID_SVX_START + 47 )
+#define SID_ATTR_POSTIT_AUTHOR                          TypedWhichId<SvxPostItAuthorItem>( SID_SVX_START + 44 )
+#define SID_ATTR_POSTIT_DATE                            TypedWhichId<SvxPostItDateItem>( SID_SVX_START + 45 )
+#define SID_ATTR_POSTIT_TEXT                            TypedWhichId<SvxPostItTextItem>( SID_SVX_START + 46 )
+#define SID_ATTR_POSTIT_ID                              TypedWhichId<SvxPostItIdItem>( SID_SVX_START + 47 )
 // free
 
 // CAUTION! Range <48 .. 49> used by EditEngine (!)
 
-#define SID_ATTR_PAGE                                   ( SID_SVX_START + 50 )
-#define SID_ATTR_PAGE_SIZE                              ( SID_SVX_START + 51 )
-#define SID_ATTR_PAGE_MAXSIZE                           ( SID_SVX_START + 52 )
-#define SID_ATTR_PAGE_ORIENTATION                       ( SID_SVX_START + 53 )
-#define SID_ATTR_PAGE_PAPERBIN                          ( SID_SVX_START + 54 )
-#define SID_ATTR_PAGE_EXT1                              ( SID_SVX_START + 55 )
-#define SID_ATTR_PAGE_EXT2                              ( SID_SVX_START + 56 )
-#define SID_ATTR_PAGE_HEADERSET                         ( SID_SVX_START + 57 )
-#define SID_ATTR_PAGE_FOOTERSET                         ( SID_SVX_START + 58 )
-#define SID_ATTR_PAGE_ON                                ( SID_SVX_START + 59 )
-#define SID_ATTR_PAGE_DYNAMIC                           ( SID_SVX_START + 60 )
-#define SID_ATTR_PAGE_SHARED                            ( SID_SVX_START + 61 )
-#define SID_ATTR_PAGE_LRSPACE                           ( SID_SVX_START + 62 )
-#define SID_ATTR_PAGE_ULSPACE                           ( SID_SVX_START + 63 )
+#define SID_ATTR_PAGE                                   TypedWhichId<SvxPageItem>( SID_SVX_START + 50 )
+#define SID_ATTR_PAGE_SIZE                              TypedWhichId<SvxSizeItem>( SID_SVX_START + 51 )
+#define SID_ATTR_PAGE_MAXSIZE                           TypedWhichId<SvxSizeItem>( SID_SVX_START + 52 )
+#define SID_ATTR_PAGE_ORIENTATION                       TypedWhichId<SvxPageItem>( SID_SVX_START + 53 )
+#define SID_ATTR_PAGE_PAPERBIN                          TypedWhichId<SvxPaperBinItem>( SID_SVX_START + 54 )
+#define SID_ATTR_PAGE_EXT1                              TypedWhichId<SfxBoolItem>( SID_SVX_START + 55 )
+#define SID_ATTR_PAGE_EXT2                              TypedWhichId<SfxBoolItem>( SID_SVX_START + 56 )
+#define SID_ATTR_PAGE_HEADERSET                         TypedWhichId<SvxSetItem>( SID_SVX_START + 57 )
+#define SID_ATTR_PAGE_FOOTERSET                         TypedWhichId<SvxSetItem>( SID_SVX_START + 58 )
+#define SID_ATTR_PAGE_ON                                TypedWhichId<SfxBoolItem>( SID_SVX_START + 59 )
+#define SID_ATTR_PAGE_DYNAMIC                           TypedWhichId<SfxBoolItem>( SID_SVX_START + 60 )
+#define SID_ATTR_PAGE_SHARED                            TypedWhichId<SfxBoolItem>( SID_SVX_START + 61 )
+#define SID_ATTR_PAGE_LRSPACE                           TypedWhichId<SvxLongLRSpaceItem>( SID_SVX_START + 62 )
+#define SID_ATTR_PAGE_ULSPACE                           TypedWhichId<SvxLongULSpaceItem>( SID_SVX_START + 63 )
 
 // CAUTION! Range <64 .. 67> used by EditEngine (!)
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 8769766b2539..06e61d3ec47f 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2234,8 +2234,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                         aCellId = static_cast<const SvxPostItIdItem*>(pCellId)->GetValue();
 
                     const SvxPostItTextItem*    pTextItem   = static_cast<const SvxPostItTextItem*>( pText );
-                    const SvxPostItAuthorItem*  pAuthorItem = static_cast<const SvxPostItAuthorItem*>( pReqArgs->GetItem( SID_ATTR_POSTIT_AUTHOR ) );
-                    const SvxPostItDateItem*    pDateItem   = static_cast<const SvxPostItDateItem*>( pReqArgs->GetItem( SID_ATTR_POSTIT_DATE ) );
+                    const SvxPostItAuthorItem*  pAuthorItem = pReqArgs->GetItem( SID_ATTR_POSTIT_AUTHOR );
+                    const SvxPostItDateItem*    pDateItem   = pReqArgs->GetItem( SID_ATTR_POSTIT_DATE );
 
                     if (!aCellId.isEmpty())
                     {
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index fbe12fd69018..36208de5ca26 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -923,7 +923,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet )
     if( !aUnions.empty() )
     {
         SvxBoxItem     aSetBox    (static_cast<const SvxBoxItem    &>( rSet.Get(RES_BOX    )));
-        SvxBoxInfoItem aSetBoxInfo(static_cast<const SvxBoxInfoItem&>( rSet.Get(SID_ATTR_BORDER_INNER)));
+        SvxBoxInfoItem aSetBoxInfo( rSet.Get(SID_ATTR_BORDER_INNER) );
 
         bool bTopSet      = false,
              bBottomSet   = false,
@@ -1112,7 +1112,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet )
         if ( bRTLTab )
         {
             SvxBoxItem     aTempBox    (static_cast<const SvxBoxItem    &>( rSet.Get(RES_BOX    )));
-            SvxBoxInfoItem aTempBoxInfo(static_cast<const SvxBoxInfoItem&>( rSet.Get(SID_ATTR_BORDER_INNER)));
+            SvxBoxInfoItem aTempBoxInfo( rSet.Get(SID_ATTR_BORDER_INNER) );
 
             aTempBox.SetLine( aSetBox.GetRight(), SvxBoxItemLine::RIGHT);
             aSetBox.SetLine( aSetBox.GetLeft(), SvxBoxItemLine::RIGHT);
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 10160dd3d8a8..f5989402cdab 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2547,7 +2547,7 @@ uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(const uno::Seque
 
                 if(SfxStyleFamily::Page == m_rEntry.m_eFamily && SID_ATTR_PAGE_SIZE == pEntry->nWID && beans::PropertyState_DIRECT_VALUE == pStates[i])
                 {
-                    const SvxSizeItem& rSize = static_cast <const SvxSizeItem&>( rSet.Get(SID_ATTR_PAGE_SIZE));
+                    const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
                     sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f;
 
                     if((LONG_MAX == rSize.GetSize().Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId)) ||
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index cd722ea0f880..350656ff5365 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2821,8 +2821,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName)
                                     SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{});
                     aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER ));
                     SwDoc::GetTabBorders(rCursor, aSet);
-                    const SvxBoxInfoItem& rBoxInfoItem =
-                        static_cast<const SvxBoxInfoItem&>(aSet.Get(SID_ATTR_BORDER_INNER));
+                    const SvxBoxInfoItem& rBoxInfoItem = aSet.Get(SID_ATTR_BORDER_INNER);
                     const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX));
 
                     if (FN_UNO_TABLE_BORDER == pEntry->nWID)
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index af6561a7a594..6242abbb954f 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -1218,8 +1218,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
     {
         if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
         {
-            const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get(
-                                                SID_ATTR_PAGE_SIZE));
+            const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
 
             sal_uInt16 nActWidth;
 
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index a05ee2b06086..1de19dfc3340 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -303,8 +303,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
             false, &pItem ) )
     {
         const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-        const SfxBoolItem& rFooterOn =
-            static_cast<const SfxBoolItem&>(rFooterSet.Get( SID_ATTR_PAGE_ON ));
+        const SfxBoolItem& rFooterOn = rFooterSet.Get( SID_ATTR_PAGE_ON );
 
         if ( rFooterOn.GetValue() )
         {
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 245ad05657c7..3c39eb3ed1ab 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -307,8 +307,7 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet)
     if( SfxItemState::SET != rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
         return;
 
-    const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get(
-                                        SID_ATTR_PAGE_SIZE));
+    const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
     const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(rSet.Get(
                                                         RES_LR_SPACE ));
     const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(rSet.Get(
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 7e4c3cdf5629..c7c481f35c3d 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -145,8 +145,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
             false, &pItem ) )
     {
         const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-        const SfxBoolItem& rFooterOn =
-            static_cast<const SfxBoolItem&>(rFooterSet.Get( SID_ATTR_PAGE_ON ));
+        const SfxBoolItem& rFooterOn = rFooterSet.Get( SID_ATTR_PAGE_ON );
 
         if ( rFooterOn.GetValue() )
         {
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index b19c90da46bb..33b039b790b0 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1119,7 +1119,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl, SvSimpleTable*, void)
             if ( pDlg->Execute() == RET_OK )
             {
                 const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
-                OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
+                OUString sMsg(pOutSet->Get(SID_ATTR_POSTIT_TEXT).GetValue());
 
                 // insert / change comment
                 pSh->SetRedlineComment(sMsg);
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 17b3fba4a22b..abe8de4389af 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -914,8 +914,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                 // -->after inserting,reset the inner table borders
                 if ( bSetInnerBorders )
                 {
-                    const SvxBoxInfoItem aBoxInfo(static_cast<const SvxBoxInfoItem&>(
-                        aCoreSet.Get(SID_ATTR_BORDER_INNER)));
+                    const SvxBoxInfoItem aBoxInfo(aCoreSet.Get(SID_ATTR_BORDER_INNER));
                     SfxItemSet aSet( GetPool(), svl::Items<SID_ATTR_BORDER_INNER,
                                                 SID_ATTR_BORDER_INNER>{});
                     aSet.Put( aBoxInfo );
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 5e4dfeaef768..cfa8661a620d 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -611,7 +611,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     if ( pDlg->Execute() == RET_OK )
                     {
                         const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
-                        OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
+                        OUString sMsg(pOutSet->Get(SID_ATTR_POSTIT_TEXT).GetValue());
 
                         // Insert or change a comment
                         rSh.SetRedlineComment(sMsg);
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index f321650318e2..98f453e299ab 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -866,7 +866,7 @@ SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
     aSet.SetParent( rMgr.GetAttrSet().GetParent() );
 
     // Delete minimum size in columns.
-    SvxBoxInfoItem aBoxInfo(static_cast<const SvxBoxInfoItem &>(aSet.Get(SID_ATTR_BORDER_INNER)));
+    SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
     const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX));
     aBoxInfo.SetMinDist(false);
     aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index dd2ac2be7bd5..ad5611a1e628 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -402,7 +402,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
     case SID_ATTR_PAGE_LRSPACE:
         if ( pReqArgs )
         {
-            const SvxLongLRSpaceItem aLongLR( static_cast<const SvxLongLRSpaceItem&>(pReqArgs->Get( SID_ATTR_PAGE_LRSPACE )) );
+            const SvxLongLRSpaceItem aLongLR( pReqArgs->Get( SID_ATTR_PAGE_LRSPACE ) );
 
             SwPageDesc aDesc( rDesc );
             {
@@ -543,8 +543,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
     case SID_ATTR_PAGE_ULSPACE:
         if ( pReqArgs )
         {
-            SvxLongULSpaceItem aLongULSpace(
-                static_cast<const SvxLongULSpaceItem&>(pReqArgs->Get( SID_ATTR_PAGE_ULSPACE ) ) );
+            SvxLongULSpaceItem aLongULSpace( pReqArgs->Get( SID_ATTR_PAGE_ULSPACE ) );
 
             SwPageDesc aDesc( rDesc );
             {
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 5d31d1d20909..5ff91b633337 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -220,8 +220,8 @@ void FillHdFt(SwFrameFormat* pFormat, const  SfxItemSet& rSet)
     SwAttrSet aSet(pFormat->GetAttrSet());
     aSet.Put(rSet);
 
-    const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get(SID_ATTR_PAGE_SIZE));
-    const SfxBoolItem& rDynamic = static_cast<const SfxBoolItem&>(rSet.Get(SID_ATTR_PAGE_DYNAMIC));
+    const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
+    const SfxBoolItem& rDynamic = rSet.Get(SID_ATTR_PAGE_DYNAMIC);
 
     // Convert size
     SwFormatFrameSize aFrameSize(rDynamic.GetValue() ? ATT_MIN_SIZE : ATT_FIX_SIZE,
@@ -274,7 +274,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
     // PageData
     if(rSet.GetItemState(SID_ATTR_PAGE) == SfxItemState::SET)
     {
-        const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>(rSet.Get(SID_ATTR_PAGE));
+        const SvxPageItem& rPageItem = rSet.Get(SID_ATTR_PAGE);
 
         const SvxPageUsage nUse = rPageItem.GetPageUsage();
         if(nUse != SvxPageUsage::NONE)
@@ -287,7 +287,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
     // Size
     if(rSet.GetItemState(SID_ATTR_PAGE_SIZE) == SfxItemState::SET)
     {
-        const SvxSizeItem& rSizeItem = static_cast<const SvxSizeItem&>(rSet.Get(SID_ATTR_PAGE_SIZE));
+        const SvxSizeItem& rSizeItem = rSet.Get(SID_ATTR_PAGE_SIZE);
         SwFormatFrameSize aSize(ATT_FIX_SIZE);
         aSize.SetSize(rSizeItem.GetSize());
         rMaster.SetFormatAttr(aSize);
@@ -298,7 +298,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
             false, &pItem ) )
     {
         const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-        const SfxBoolItem& rHeaderOn = static_cast<const SfxBoolItem&>(rHeaderSet.Get(SID_ATTR_PAGE_ON));
+        const SfxBoolItem& rHeaderOn = rHeaderSet.Get(SID_ATTR_PAGE_ON);
 
         if(rHeaderOn.GetValue())
         {
@@ -313,8 +313,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
 
             ::FillHdFt(pHeaderFormat, rHeaderSet);
 
-            rPageDesc.ChgHeaderShare(static_cast<const SfxBoolItem&>(
-                        rHeaderSet.Get(SID_ATTR_PAGE_SHARED)).GetValue());
+            rPageDesc.ChgHeaderShare(rHeaderSet.Get(SID_ATTR_PAGE_SHARED).GetValue());
             if (nFirstShare < 0)
             {
                 rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(
@@ -338,7 +337,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
             false, &pItem ) )
     {
         const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-        const SfxBoolItem& rFooterOn = static_cast<const SfxBoolItem&>(rFooterSet.Get(SID_ATTR_PAGE_ON));
+        const SfxBoolItem& rFooterOn = rFooterSet.Get(SID_ATTR_PAGE_ON);
 
         if(rFooterOn.GetValue())
         {
@@ -353,8 +352,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
 
             ::FillHdFt(pFooterFormat, rFooterSet);
 
-            rPageDesc.ChgFooterShare(static_cast<const SfxBoolItem&>(
-                        rFooterSet.Get(SID_ATTR_PAGE_SHARED)).GetValue());
+            rPageDesc.ChgFooterShare(rFooterSet.Get(SID_ATTR_PAGE_SHARED).GetValue());
             if (nFirstShare < 0)
             {
                 rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(


More information about the Libreoffice-commits mailing list