diff options
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 25 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 25 | ||||
-rw-r--r-- | sw/source/uibase/utlui/uitool.cxx | 11 |
3 files changed, 17 insertions, 44 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 5fa4446755b4..2a42029afd2c 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1329,18 +1329,9 @@ void SwView::StateTabWin(SfxItemSet& rSet) aLongLR.SetRight(rPageRect.Right() - aRect.Right()); } } - if( nWhich == SID_ATTR_LONG_LRSPACE ) - rSet.Put( aLongLR ); - else - { - SvxLRSpaceItem aLR( aLongLR.GetLeft(), - aLongLR.GetRight(), - 0, 0, - nWhich); - rSet.Put(aLR); - } - break; + rSet.Put( aLongLR ); } + break; // provide left and right margins of current page style case SID_ATTR_PAGE_LRSPACE: @@ -1387,17 +1378,9 @@ void SwView::StateTabWin(SfxItemSet& rSet) aLongUL.SetUpper(rPagePrtRect.Top()); aLongUL.SetLower(nPageHeight - rPagePrtRect.Bottom()); } - if( nWhich == SID_ATTR_LONG_ULSPACE ) - rSet.Put( aLongUL ); - else - { - SvxULSpaceItem aULTmp(static_cast<sal_uInt16>(aLongUL.GetUpper()), - static_cast<sal_uInt16>(aLongUL.GetLower()), - nWhich); - rSet.Put(aULTmp); - } - break; + rSet.Put( aLongUL ); } + break; // provide top and bottom margins of current page style case SID_ATTR_PAGE_ULSPACE: diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 9324c70999af..4cb1bd3ec1e3 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3007,18 +3007,13 @@ void SAL_CALL SwXTextDocument::render( { // the view shell should be SwView for documents PDF export // or SwPagePreview for PDF export of the page preview - //!! (check for SwView first as in GuessViewShell) !! - OSL_ENSURE( pView, "!! view missing !!" ); SwViewShell* pVwSh = nullptr; - if (pView) - { - // TODO/mba: we really need a generic way to get the SwViewShell! - SwView* pSwView = dynamic_cast<SwView*>( pView ); - if ( pSwView ) - pVwSh = pSwView->GetWrtShellPtr(); - else - pVwSh = static_cast<SwPagePreview*>(pView)->GetViewShell(); - } + // TODO/mba: we really need a generic way to get the SwViewShell! + const SwView* pSwView = dynamic_cast<const SwView*>(pView); + if (pSwView) + pVwSh = pSwView->GetWrtShellPtr(); + else + pVwSh = static_cast<SwPagePreview*>(pView)->GetViewShell(); // get output device to use VclPtr< OutputDevice > pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); @@ -3029,8 +3024,8 @@ void SAL_CALL SwXTextDocument::render( const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage" ); bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); - OSL_ENSURE(( dynamic_cast< const SwView *>( pView ) != nullptr && m_pRenderData->IsViewOptionAdjust()) - || (dynamic_cast< const SwView *>( pView ) == nullptr && !m_pRenderData->IsViewOptionAdjust()), + OSL_ENSURE((pSwView && m_pRenderData->IsViewOptionAdjust()) + || (!pSwView && !m_pRenderData->IsViewOptionAdjust()), "SwView / SwViewOptionAdjust_Impl availability mismatch" ); // since printing now also use the API for PDF export this option @@ -3043,9 +3038,7 @@ void SAL_CALL SwXTextDocument::render( // During this process, additional information required for tagging // the pdf file are collected, which are evaulated during painting. - SwWrtShell* pWrtShell = dynamic_cast< const SwView *>( pView ) != nullptr ? - static_cast<SwView*>(pView)->GetWrtShellPtr() : - nullptr; + SwWrtShell* pWrtShell = pSwView ? pSwView->GetWrtShellPtr() : nullptr; SwPrintData const& rSwPrtOptions = *m_pRenderData->GetSwPrtOptions(); diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 154d9d7f9553..aa679eb392e9 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -230,7 +230,7 @@ static UseOnPage lcl_convertUseFromSvx(SvxPageUsage nUse) void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) { SwFrameFormat& rMaster = rPageDesc.GetMaster(); - int nFirstShare = -1; + bool bFirstShare = false; // Transfer all general frame attributes rMaster.SetFormatAttr(rSet); @@ -278,12 +278,9 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) ::FillHdFt(pHeaderFormat, rHeaderSet); rPageDesc.ChgHeaderShare(rHeaderSet.Get(SID_ATTR_PAGE_SHARED).GetValue()); - if (nFirstShare < 0) - { - rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>( + rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>( rHeaderSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue()); - nFirstShare = rPageDesc.IsFirstShared() ? 1 : 0; - } + bFirstShare = true; } else { @@ -317,7 +314,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) ::FillHdFt(pFooterFormat, rFooterSet); rPageDesc.ChgFooterShare(rFooterSet.Get(SID_ATTR_PAGE_SHARED).GetValue()); - if (nFirstShare < 0) + if (!bFirstShare) { rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>( rFooterSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue()); |