summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-07-24 21:16:50 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-25 06:00:47 +0000
commit54cc2f587d2ee2deb9fb334b1b9464213b8823c8 (patch)
tree567fc14249c79b1ffc7be1ad0f849fc7e4730a11
parentfacf48d58f7438031a3a5fabd0f59134f6d43851 (diff)
sc: replace GET_SCALEVALUE macro with a lambda
Change-Id: Id41cf9fec355f84fdc52565e089a8bb04c0e9bdb Reviewed-on: https://gerrit.libreoffice.org/27492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sc/source/core/data/table5.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 2ae8872488ed..eb35dd087326 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -51,8 +51,6 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::sheet::TablePageBreakData;
using ::std::set;
-#define GET_SCALEVALUE(set,id) static_cast<const SfxUInt16Item&>(set.Get( id )).GetValue()
-
void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
{
if ( pDocument->IsImportingXML() )
@@ -1132,15 +1130,17 @@ void ScTable::SetPageStyle( const OUString& rName )
if ( aPageStyle != aStrNew )
{
SfxStyleSheetBase* pOldStyle = pStylePool->Find( aPageStyle, SfxStyleFamily::Page );
-
if ( pOldStyle && pNewStyle )
{
SfxItemSet& rOldSet = pOldStyle->GetItemSet();
SfxItemSet& rNewSet = pNewStyle->GetItemSet();
- const sal_uInt16 nOldScale = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALE);
- const sal_uInt16 nOldScaleToPages = GET_SCALEVALUE(rOldSet,ATTR_PAGE_SCALETOPAGES);
- const sal_uInt16 nNewScale = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALE);
- const sal_uInt16 nNewScaleToPages = GET_SCALEVALUE(rNewSet,ATTR_PAGE_SCALETOPAGES);
+ auto getScaleValue = [](const SfxItemSet& rSet, sal_uInt16 nId)
+ { return static_cast<const SfxUInt16Item&>(rSet.Get(nId)).GetValue(); };
+
+ const sal_uInt16 nOldScale = getScaleValue(rOldSet,ATTR_PAGE_SCALE);
+ const sal_uInt16 nOldScaleToPages = getScaleValue(rOldSet,ATTR_PAGE_SCALETOPAGES);
+ const sal_uInt16 nNewScale = getScaleValue(rNewSet,ATTR_PAGE_SCALE);
+ const sal_uInt16 nNewScaleToPages = getScaleValue(rNewSet,ATTR_PAGE_SCALETOPAGES);
if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) )
InvalidateTextWidth(nullptr, nullptr, false, false);