sw/source/filter/ww8/docxattributeoutput.cxx |   10 +-
 sw/source/filter/ww8/writerhelper.cxx        |    2 
 sw/source/filter/ww8/writerhelper.hxx        |   91 ---------------------------
 sw/source/filter/ww8/writerwordglue.cxx      |    3 
 sw/source/filter/ww8/wrtw8nds.cxx            |   20 ++---
 sw/source/filter/ww8/wrtw8sty.cxx            |    4 -
 sw/source/filter/ww8/wrtww8.cxx              |    2 
 sw/source/filter/ww8/ww8atr.cxx              |    6 -
 sw/source/filter/ww8/ww8par.cxx              |    4 -
 sw/source/filter/ww8/ww8par2.cxx             |    2 
 sw/source/filter/ww8/ww8par3.cxx             |    6 -
 sw/source/filter/ww8/ww8par5.cxx             |    6 -
 sw/source/filter/ww8/ww8par6.cxx             |   12 +--
 13 files changed, 37 insertions(+), 131 deletions(-)

New commits:
commit 2d33c22e55b7af7481cc36a1fff979a33daf8519
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Mar 1 19:20:44 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Mar 2 08:31:49 2022 +0100

    remove writerhelper::DefaultItemGet
    
    the TypedWhichId template methods on SfxItemPool supercede this
    
    Change-Id: Ice8fc953b0ec2cc3cfd4075a99f21889c23accda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130806
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index e07c6759d9c6..a9bb8ce04a66 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -248,71 +248,6 @@ namespace sw
             return dynamic_cast<const T *>(pItem);
         }
 
-        /** Extract a default SfxPoolItem derived property from a SfxItemPool
-
-            Writer's attributes are retrieved by passing a numeric identifier
-            and receiving a SfxPoolItem reference which must then typically be
-            cast back to its original type which is both tedious and verbose.
-
-            DefaultItemGet returns a reference to the default property of a
-            given SfxItemPool for a given property id, e.g. default fontsize
-
-            DefaultItemGet uses item_cast () on the retrieved reference to test
-            that the retrieved property is of the type that the developer 
thinks
-            it is.
-
-            @param rPool
-            The SfxItemPool whose default property we want
-
-            @param eType
-            The numeric identifier of the default property to be retrieved
-
-            @tplparam T
-            A SfxPoolItem derived class of the retrieved property
-
-            @exception std::bad_cast Thrown if the property was not a T
-
-            @return The T requested
-        */
-        template<class T> const T & DefaultItemGet(const SfxItemPool &rPool,
-            sal_uInt16 eType)
-        {
-            return item_cast<T>(rPool.GetDefaultItem(eType));
-        }
-
-        /** Extract a default SfxPoolItem derived property from a SwDoc
-
-            Writer's attributes are retrieved by passing a numeric identifier
-            and receiving a SfxPoolItem reference which must then typically be
-            cast back to its original type which is both tedious and verbose.
-
-            DefaultItemGet returns a reference to the default property of a
-            given SwDoc (Writer Document) for a given property id, e.g default
-            fontsize
-
-            DefaultItemGet uses item_cast () on the retrieved reference to test
-            that the retrieved property is of the type that the developer 
thinks
-            it is.
-
-            @param rPool
-            The SfxItemPool whose default property we want
-
-            @param eType
-            The numeric identifier of the default property to be retrieved
-
-            @tplparam T
-            A SfxPoolItem derived class of the retrieved property
-
-            @exception std::bad_cast Thrown if the property was not a T
-
-            @return The T requested
-        */
-        template<class T> const T & DefaultItemGet(const SwDoc &rDoc,
-            sal_uInt16 eType)
-        {
-            return DefaultItemGet<T>(rDoc.GetAttrPool(), eType);
-        }
-
         /** Get the Paragraph Styles of a SwDoc
 
             Writer's styles are in one of those dreaded macro based pre-STL
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index ff9304815f78..658cadabba08 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1706,7 +1706,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() 
const
     if (SfxItemState::SET != eState || !pRet || (!pRet->GetGraphic() &&
         pRet->GetColor() == COL_TRANSPARENT))
     {
-        pRet = &(DefaultItemGet<SvxBrushItem>(m_rDoc,RES_BACKGROUND));
+        pRet = &m_rDoc.GetAttrPool().GetDefaultItem(RES_BACKGROUND);
     }
     return pRet;
 }
@@ -3644,12 +3644,12 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const 
SwFormatRuby& rRuby, const MSWor
         pPool = pPool ? pPool : &rExport.m_rDoc.GetAttrPool();
 
 
-        const auto& rFont
-            = DefaultItemGet<SvxFontItem>(*pPool, 
GetWhichOfScript(RES_CHRATR_FONT, nRubyScript));
+        const SvxFontItem& rFont
+            = pPool->GetDefaultItem( GetWhichOfScript(RES_CHRATR_FONT, 
nRubyScript) );
         m_sFontFamily = rFont.GetFamilyName();
 
-        const auto& rHeight = DefaultItemGet<SvxFontHeightItem>(
-            *pPool, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
+        const SvxFontHeightItem& rHeight =
+            pPool->GetDefaultItem( GetWhichOfScript(RES_CHRATR_FONTSIZE, 
nRubyScript));
         m_nRubyHeight = rHeight.GetHeight();
     }
 
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c5013e4cc556..0274944d26d6 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -461,7 +461,7 @@ static void WriteDop( WW8Export& rWrt )
 
     // write default TabStop
     const SvxTabStopItem& rTabStop =
-        DefaultItemGet<SvxTabStopItem>(rWrt.m_rDoc, RES_PARATR_TABSTOP);
+        rWrt.m_rDoc.GetAttrPool().GetDefaultItem(RES_PARATR_TABSTOP);
     rDop.dxaTab = o3tl::narrowing<sal_uInt16>(rTabStop[0].GetTabPos());
 
     // Zoom factor and type
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 3b787d257fb4..178cc6cdc84f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1766,7 +1766,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const 
sal_uInt8* pData, short nLen)
         {
             SvxTabStopItem aOrig = pSty ?
                 pSty->GetFormatAttr(RES_PARATR_TABSTOP) :
-                DefaultItemGet<SvxTabStopItem>(m_rDoc, RES_PARATR_TABSTOP);
+                m_rDoc.GetAttrPool().GetDefaultItem(RES_PARATR_TABSTOP);
             NewAttr(aOrig);
         }
     }
commit 24bcd1692cd9689f2586beebb5e4215d02fe8196
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Mar 1 19:14:03 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Mar 2 08:31:22 2022 +0100

    remove writerhelper::ItemGet
    
    the TypedWhichId template methods on SwFormat supercede this
    
    Change-Id: I7444dc1eb85fccfc9d60da4f1502ea2e2ceccdc1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130805
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9bb849bce6aa..f5b270f1f580 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3324,12 +3324,12 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& 
rNode, sal_Int32 nPos, co
     {
         const SwCharFormat* pFormat = rRuby.GetTextRuby()->GetCharFormat();
         sal_uInt16 nScript = 
g_pBreakIt->GetBreakIter()->getScriptType(rRuby.GetText(), 0);
-        sal_uInt16 nWhichFont = (nScript == i18n::ScriptType::LATIN) ?  
RES_CHRATR_FONT : RES_CHRATR_CJK_FONT;
-        sal_uInt16 nWhichFontSize = (nScript == i18n::ScriptType::LATIN) ?  
RES_CHRATR_FONTSIZE : RES_CHRATR_CJK_FONTSIZE;
+        TypedWhichId<SvxFontItem> nWhichFont = (nScript == 
i18n::ScriptType::LATIN) ?  RES_CHRATR_FONT : RES_CHRATR_CJK_FONT;
+        TypedWhichId<SvxFontHeightItem> nWhichFontSize = (nScript == 
i18n::ScriptType::LATIN) ?  RES_CHRATR_FONTSIZE : RES_CHRATR_CJK_FONTSIZE;
 
-        CharFont(ItemGet<SvxFontItem>(*pFormat, nWhichFont));
-        CharFontSize(ItemGet<SvxFontHeightItem>(*pFormat, nWhichFontSize));
-        CharFontSize(ItemGet<SvxFontHeightItem>(*pFormat, 
RES_CHRATR_CTL_FONTSIZE));
+        CharFont(pFormat->GetFormatAttr(nWhichFont));
+        CharFontSize(pFormat->GetFormatAttr(nWhichFontSize));
+        CharFontSize(pFormat->GetFormatAttr(RES_CHRATR_CTL_FONTSIZE));
     }
 
     EndRunProperties( nullptr );
diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 740274453dfb..6c62af767ab0 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -589,7 +589,7 @@ namespace sw
                 const SwFrameFormat* pApply = rTable.GetFrameFormat();
                 OSL_ENSURE(pApply, "impossible");
                 if (pApply)
-                    pBreak = &(ItemGet<SvxFormatBreakItem>(*pApply, 
RES_BREAK));
+                    pBreak = &pApply->GetFormatAttr(RES_BREAK);
             }
             else if (const SwContentNode *pNd = rNd.GetContentNode())
                 pBreak = &pNd->GetAttr(RES_BREAK);
diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index 65d5c2501bc4..e07c6759d9c6 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -248,32 +248,6 @@ namespace sw
             return dynamic_cast<const T *>(pItem);
         }
 
-        /** Extract a SfxPoolItem derived property from a SwFormat
-
-            Writer's attributes are retrieved by passing a numeric identifier
-            and receiving a SfxPoolItem reference which must then typically be
-            cast back to its original type which is both tedious and verbose.
-
-            ItemGet uses item_cast () on the retrieved reference to test that 
the
-            retrieved property is of the type that the developer thinks it is.
-
-            @param rFormat
-            The SwFormat to retrieve the property from
-
-            @param eType
-            The numeric identifier of the property to be retrieved
-
-            @tplparam T
-            A SfxPoolItem derived class of the retrieved property
-
-            @exception std::bad_cast Thrown if the property was not a T
-        */
-        template<class T> const T & ItemGet(const SwFormat &rFormat,
-            sal_uInt16 eType)
-        {
-            return item_cast<T>(rFormat.GetFormatAttr(eType));
-        }
-
         /** Extract a default SfxPoolItem derived property from a SfxItemPool
 
             Writer's attributes are retrieved by passing a numeric identifier
diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 5474148b5c5d..b2eb03e4a53a 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -70,8 +70,7 @@ namespace myImplHelpers
         const SwFormatFrameSize& rSz = rFormat.GetFrameSize();
 
         const SwHeaderAndFooterEatSpacingItem &rSpacingCtrl =
-            sw::util::ItemGet<SwHeaderAndFooterEatSpacingItem>
-            (rFormat, RES_HEADER_FOOTER_EAT_SPACING);
+            rFormat.GetFormatAttr(RES_HEADER_FOOTER_EAT_SPACING);
         if (rSpacingCtrl.GetValue())
             nDist += rSz.GetHeight();
         else
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 394203367dc4..ff9304815f78 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -405,8 +405,8 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool 
bWriteCombChars)
     */
     TypedWhichId<SvxFontItem> nFontId = GetWhichOfScript( RES_CHRATR_FONT, 
GetScript() );
 
-    const SvxFontItem &rParentFont = ItemGet<SvxFontItem>(
-        static_cast<const SwTextFormatColl&>(rNd.GetAnyFormatColl()), nFontId);
+    const SvxFontItem &rParentFont =
+        static_cast<const 
SwTextFormatColl&>(rNd.GetAnyFormatColl()).GetFormatAttr(nFontId);
     const SvxFontItem *pFont = &rParentFont;
     const SfxPoolItem *pGrabBag = nullptr;
 
@@ -3629,11 +3629,11 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const 
SwFormatRuby& rRuby, const MSWor
     if (pFormat)
     {
         const auto& rFont
-            = ItemGet<SvxFontItem>(*pFormat, GetWhichOfScript(RES_CHRATR_FONT, 
nRubyScript));
+            = pFormat->GetFormatAttr( GetWhichOfScript(RES_CHRATR_FONT, 
nRubyScript) );
         m_sFontFamily = rFont.GetFamilyName();
 
-        const auto& rHeight = ItemGet<SvxFontHeightItem>(
-            *pFormat, GetWhichOfScript(RES_CHRATR_FONTSIZE, nRubyScript));
+        const auto& rHeight =
+            pFormat->GetFormatAttr( GetWhichOfScript(RES_CHRATR_FONTSIZE, 
nRubyScript) );
         m_nRubyHeight = rHeight.GetHeight();
     }
     else
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index f91375da04bb..d613c00af5a2 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1679,9 +1679,9 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
             // at the child ONLY change column structure according to 
Sect-Attr.
 
             const SvxLRSpaceItem &rSectionLR =
-                ItemGet<SvxLRSpaceItem>( *(rSepInfo.pSectionFormat), 
RES_LR_SPACE );
+                rSepInfo.pSectionFormat->GetFormatAttr( RES_LR_SPACE );
             const SvxLRSpaceItem &rPageLR =
-                ItemGet<SvxLRSpaceItem>( *pPdFormat, RES_LR_SPACE );
+                pPdFormat->GetFormatAttr( RES_LR_SPACE );
 
             SvxLRSpaceItem aResultLR( rPageLR.GetLeft() +
                     rSectionLR.GetLeft(), rPageLR.GetRight() +
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 531194cdf981..fcadda82f7c8 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4037,8 +4037,7 @@ sal_uInt32 AttributeOutputBase::GridCharacterPitch( const 
SwTextGridItem& rGrid
 
     if (pSwFormat != nullptr)
     {
-        nPageCharSize = ItemGet<SvxFontHeightItem>
-            (*pSwFormat, RES_CHRATR_FONTSIZE).GetHeight();
+        nPageCharSize = 
pSwFormat->GetFormatAttr(RES_CHRATR_FONTSIZE).GetHeight();
     }
     sal_uInt16 nPitch = rGrid.IsSquaredMode() ? rGrid.GetBaseHeight() :
         rGrid.GetBaseWidth( );
@@ -4953,8 +4952,7 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& 
rAdjust )
         }
         else if (auto pC = dynamic_cast<const 
SwTextFormatColl*>(m_rWW8Export.m_pOutFormatNode))
         {
-            const SvxFrameDirectionItem &rItem =
-                ItemGet<SvxFrameDirectionItem>(*pC, RES_FRAMEDIR);
+            const SvxFrameDirectionItem &rItem = 
pC->GetFormatAttr(RES_FRAMEDIR);
             nDirection = rItem.GetValue();
         }
         if ( ( nDirection == SvxFrameDirection::Horizontal_RL_TB ) ||
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 350275a340c2..3b787d257fb4 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1765,8 +1765,8 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const 
sal_uInt8* pData, short nLen)
         if (!m_pCurrentColl) // not importing into a style
         {
             SvxTabStopItem aOrig = pSty ?
-            ItemGet<SvxTabStopItem>(*pSty, RES_PARATR_TABSTOP) :
-            DefaultItemGet<SvxTabStopItem>(m_rDoc, RES_PARATR_TABSTOP);
+                pSty->GetFormatAttr(RES_PARATR_TABSTOP) :
+                DefaultItemGet<SvxTabStopItem>(m_rDoc, RES_PARATR_TABSTOP);
             NewAttr(aOrig);
         }
     }
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b7ce97387f59..e47f11913548 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3316,7 +3316,7 @@ void WW8TabDesc::AdjustNewBand()
 
         SetTabBorders(pBox, j);
 
-        SvxBoxItem 
aCurrentBox(sw::util::ItemGet<SvxBoxItem>(*(pBox->GetFrameFormat()), RES_BOX));
+        SvxBoxItem aCurrentBox(pBox->GetFrameFormat()->GetFormatAttr(RES_BOX));
         pBox->GetFrameFormat()->SetFormatAttr(aCurrentBox);
 
         SetTabVertAlign(pBox, j);
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index f59962580e2b..0d1c634d9839 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1699,7 +1699,7 @@ void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat 
&rFormat)
     {
         const auto nAbsLSpace = rFormat.GetAbsLSpace();
         const tools::Long nListFirstLineIndent = 
GetListFirstLineIndent(rFormat);
-        SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.m_pFormat, 
RES_LR_SPACE));
+        SvxLRSpaceItem aLR(rStyle.m_pFormat->GetFormatAttr(RES_LR_SPACE));
         aLR.SetTextLeft(nAbsLSpace);
         aLR.SetTextFirstLineOffset(writer_cast<short>(nListFirstLineIndent));
         rStyle.m_pFormat->SetFormatAttr(aLR);
@@ -1712,7 +1712,7 @@ void SetStyleIndent(SwWW8StyInf &rStyle, const 
SwNumFormat &rFormat)
     if ( rFormat.GetPositionAndSpaceMode() != 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) // #i86652#
         return;
 
-    SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.m_pFormat, 
RES_LR_SPACE));
+    SvxLRSpaceItem aLR(rStyle.m_pFormat->GetFormatAttr(RES_LR_SPACE));
     if (rStyle.m_bListRelevantIndentSet)
     {
 
@@ -1769,7 +1769,7 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 
nStyle)
         return;
 
     //Save old pre-list modified indent, which are the word indent values
-    rStyleInf.maWordLR.reset(ItemGet<SvxLRSpaceItem>(*rStyleInf.m_pFormat, 
RES_LR_SPACE).Clone());
+    
rStyleInf.maWordLR.reset(rStyleInf.m_pFormat->GetFormatAttr(RES_LR_SPACE).Clone());
 
     // Phase 2: refresh StyleDef after reading all Lists
     if (rStyleInf.m_nLFOIndex >= USHRT_MAX || rStyleInf.m_nListLevel >= 
WW8ListManager::nMaxLevel)
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 8bc9dbb75dbf..a7075b66e949 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2768,11 +2768,11 @@ void SwWW8ImplReader::Read_SubF_Ruby( 
WW8ReadFieldParams& rReadParam)
     for(const auto& rpCharFormat : m_aRubyCharFormats)
     {
         const SvxFontHeightItem &rFH =
-            ItemGet<SvxFontHeightItem>(*rpCharFormat,
-            GetWhichOfScript(RES_CHRATR_FONTSIZE,nScript));
+            rpCharFormat->GetFormatAttr(
+                GetWhichOfScript(RES_CHRATR_FONTSIZE,nScript));
         if (rFH.GetHeight() == nFontSize*10)
         {
-            const SvxFontItem &rF = ItemGet<SvxFontItem>(*rpCharFormat,
+            const SvxFontItem &rF = rpCharFormat->GetFormatAttr(
                 GetWhichOfScript(RES_CHRATR_FONT,nScript));
             if (rF.GetFamilyName() == sFontName)
             {
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 32028c0eebb3..7f47d529656d 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -219,12 +219,12 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat 
&rFormat, const wwSection &r
     rFormat.SetFormatAttr(SvxFrameDirectionItem(rSection.meDir, RES_FRAMEDIR));
 
     SwTwips nTextareaHeight = rFormat.GetFrameSize().GetHeight();
-    const SvxULSpaceItem &rUL = ItemGet<SvxULSpaceItem>(rFormat, RES_UL_SPACE);
+    const SvxULSpaceItem &rUL = rFormat.GetFormatAttr(RES_UL_SPACE);
     nTextareaHeight -= rUL.GetUpper();
     nTextareaHeight -= rUL.GetLower();
 
     SwTwips nTextareaWidth = rFormat.GetFrameSize().GetWidth();
-    const SvxLRSpaceItem &rLR = ItemGet<SvxLRSpaceItem>(rFormat, RES_LR_SPACE);
+    const SvxLRSpaceItem &rLR = rFormat.GetFormatAttr(RES_LR_SPACE);
     nTextareaWidth -= rLR.GetLeft();
     nTextareaWidth -= rLR.GetRight();
 
@@ -276,8 +276,9 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat 
&rFormat, const wwSection &r
         if (m_vColl[nI].m_bValid && m_vColl[nI].m_pFormat &&
             m_vColl[nI].IsWW8BuiltInDefaultStyle())
         {
-            nCharWidth = ItemGet<SvxFontHeightItem>(*(m_vColl[nI].m_pFormat),
-                RES_CHRATR_CJK_FONTSIZE).GetHeight();
+            const SvxFontHeightItem& rFontHeightItem =
+                m_vColl[nI].m_pFormat->GetFormatAttr(RES_CHRATR_CJK_FONTSIZE);
+            nCharWidth = rFontHeightItem.GetHeight();
             break;
         }
     }
@@ -4311,8 +4312,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
                 if (aIsZeroed.pSprm && aIsZeroed.nRemainingData >= 1 && 
*aIsZeroed.pSprm == 0)
                 {
                     const SvxLRSpaceItem &rLR =
-                        
ItemGet<SvxLRSpaceItem>(*(m_vColl[m_nCurrentColl].m_pFormat),
-                        RES_LR_SPACE);
+                        
m_vColl[m_nCurrentColl].m_pFormat->GetFormatAttr(RES_LR_SPACE);
                     nPara = nPara - rLR.GetTextFirstLineOffset();
                 }
             }

Reply via email to