diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-12 08:50:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-12 12:48:32 +0100 |
commit | bf8c1e277159b82362ed8f3a83d1abd0460a25c8 (patch) | |
tree | be1d711596e92fda83214ca9631b02d4e12ff5e4 /cui/source | |
parent | 8cbe779fcbcfcd722a64f98f5cef3df63d02e037 (diff) |
loplugin:singlevalfields in accessibility..extensions
Change-Id: Id3a3241af83f769fc60f67e01c9129d6f4b5c2af
Reviewed-on: https://gerrit.libreoffice.org/63274
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/inc/border.hxx | 1 | ||||
-rw-r--r-- | cui/source/inc/paragrph.hxx | 1 | ||||
-rw-r--r-- | cui/source/inc/tabstpge.hxx | 1 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/border.cxx | 80 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 7 | ||||
-rw-r--r-- | cui/source/tabpages/tabstpge.cxx | 3 |
7 files changed, 30 insertions, 77 deletions
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index f2994a3fadb2..009048d738fb 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -115,7 +115,6 @@ private: bool mbTLBREnabled; ///< true = Top-left to bottom-right border enabled. bool mbBLTREnabled; ///< true = Bottom-left to top-right border enabled. bool mbUseMarginItem; - bool mbAllowPaddingWithoutBorders; bool mbLeftModified; bool mbRightModified; bool mbTopModified; diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index 8acc4f4ea4bd..bbcb7b3d3f68 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -53,7 +53,6 @@ class SvxStdParagraphTabPage: public SfxTabPage private: SvxStdParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); - long nAbst; long nWidth; long nMinFixDist; bool bRelativeMode; diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx index a6a7b6cb3ac5..d244064b5c67 100644 --- a/cui/source/inc/tabstpge.hxx +++ b/cui/source/inc/tabstpge.hxx @@ -88,7 +88,6 @@ private: SvxTabStop aCurrentTab; SvxTabStopItem aNewTabs; long nDefDist; - FieldUnit eDefUnit; TabWin_Impl m_aLeftWin; TabWin_Impl m_aRightWin; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index a33079c99989..62179f315de4 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -471,12 +471,11 @@ struct OptionsGroupInfo sal_uInt16 m_nDialogId; // Id of the former dialog bool m_bLoadError; // load fails? OUString m_sPageURL; - VclPtr<ExtensionsTabPage> m_pExtPage; OptionsGroupInfo( SfxShell* pSh, SfxModule* pMod, sal_uInt16 nId ) : m_pShell( pSh ), m_pModule( pMod ), m_nDialogId( nId ), m_bLoadError( false ), - m_sPageURL( OUString() ), m_pExtPage( nullptr ) {} + m_sPageURL( OUString() ) {} }; #define INI_LIST() \ @@ -597,8 +596,6 @@ void OfaTreeOptionsDialog::dispose() if(!pTreeLB->GetParent(pEntry)) { OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData()); - if ( pGroupInfo ) - pGroupInfo->m_pExtPage.disposeAndClear(); delete pGroupInfo; } pEntry = pTreeLB->Next(pEntry); @@ -993,15 +990,6 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() pOptPageInfo->m_pExtPage->Hide(); pOptPageInfo->m_pExtPage->DeactivatePage(); } - else if ( pCurrentPageEntry && !pTreeLB->GetParent( pCurrentPageEntry ) ) - { - OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pCurrentPageEntry->GetUserData()); - if ( pGroupInfo && pGroupInfo->m_pExtPage ) - { - pGroupInfo->m_pExtPage->Hide(); - pGroupInfo->m_pExtPage->DeactivatePage(); - } - } OptionsPageInfo *pPageInfo = static_cast<OptionsPageInfo *>(pEntry->GetUserData()); OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo *>(pParent->GetUserData()); diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index ed2c7b4e6991..749505c1fd0f 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -231,7 +231,6 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor , mbTLBREnabled(false) , mbBLTREnabled(false) , mbUseMarginItem(false) - , mbAllowPaddingWithoutBorders(true) , mbLeftModified(false) , mbRightModified(false) , mbTopModified(false) @@ -930,44 +929,33 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) if( !m_xLeftMF->get_text().isEmpty() || !m_xRightMF->get_text().isEmpty() || !m_xTopMF->get_text().isEmpty() || !m_xBottomMF->get_text().isEmpty() ) { - if ( mbAllowPaddingWithoutBorders - || ((mbHorEnabled || mbVerEnabled || (nSWMode & SwBorderModes::TABLE)) && - (mbLeftModified || mbRightModified || mbTopModified || mbBottomModified) ) - || m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Top ) != svx::FrameBorderState::Hide - || m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Bottom ) != svx::FrameBorderState::Hide - || m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Left ) != svx::FrameBorderState::Hide - || m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Right ) != svx::FrameBorderState::Hide ) + const SvxBoxInfoItem* pOldBoxInfoItem = GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER ); + if ( + !pOldBoxItem || + m_xLeftMF->get_value_changed_from_saved() || + m_xRightMF->get_value_changed_from_saved() || + m_xTopMF->get_value_changed_from_saved() || + m_xBottomMF->get_value_changed_from_saved() || + nMinValue == m_xLeftMF->get_value(FieldUnit::NONE) || + nMinValue == m_xRightMF->get_value(FieldUnit::NONE) || + nMinValue == m_xTopMF->get_value(FieldUnit::NONE) || + nMinValue == m_xBottomMF->get_value(FieldUnit::NONE) || + (pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::DISTANCE)) + ) { - const SvxBoxInfoItem* pOldBoxInfoItem = GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER ); - if ( - !pOldBoxItem || - m_xLeftMF->get_value_changed_from_saved() || - m_xRightMF->get_value_changed_from_saved() || - m_xTopMF->get_value_changed_from_saved() || - m_xBottomMF->get_value_changed_from_saved() || - nMinValue == m_xLeftMF->get_value(FieldUnit::NONE) || - nMinValue == m_xRightMF->get_value(FieldUnit::NONE) || - nMinValue == m_xTopMF->get_value(FieldUnit::NONE) || - nMinValue == m_xBottomMF->get_value(FieldUnit::NONE) || - (pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::DISTANCE)) - ) - { - aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xLeftMF, eCoreUnit )), SvxBoxItemLine::LEFT ); - aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xRightMF, eCoreUnit )), SvxBoxItemLine::RIGHT ); - aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xTopMF, eCoreUnit )), SvxBoxItemLine::TOP ); - aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xBottomMF, eCoreUnit )), SvxBoxItemLine::BOTTOM); - } - else - { - aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::LEFT ), SvxBoxItemLine::LEFT); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::RIGHT), SvxBoxItemLine::RIGHT); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::TOP ), SvxBoxItemLine::TOP); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::BOTTOM), SvxBoxItemLine::BOTTOM); - } - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE ); + aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xLeftMF, eCoreUnit )), SvxBoxItemLine::LEFT ); + aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xRightMF, eCoreUnit )), SvxBoxItemLine::RIGHT ); + aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xTopMF, eCoreUnit )), SvxBoxItemLine::TOP ); + aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_xBottomMF, eCoreUnit )), SvxBoxItemLine::BOTTOM); } else - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE, false ); + { + aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::LEFT ), SvxBoxItemLine::LEFT); + aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::RIGHT), SvxBoxItemLine::RIGHT); + aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::TOP ), SvxBoxItemLine::TOP); + aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::BOTTOM), SvxBoxItemLine::BOTTOM); + } + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE ); } } } @@ -1366,30 +1354,10 @@ IMPL_LINK_NOARG(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void) m_xRightMF->set_min(0, FieldUnit::NONE); m_xTopMF->set_min(0, FieldUnit::NONE); m_xBottomMF->set_min(0, FieldUnit::NONE); - if(!bSpaceModified && !mbAllowPaddingWithoutBorders) - { - m_xLeftMF->set_value(0, FieldUnit::NONE); - m_xRightMF->set_value(0, FieldUnit::NONE); - m_xTopMF->set_value(0, FieldUnit::NONE); - m_xBottomMF->set_value(0, FieldUnit::NONE); - } } // for tables everything is allowed SvxBoxInfoItemValidFlags nValid = SvxBoxInfoItemValidFlags::TOP|SvxBoxInfoItemValidFlags::BOTTOM|SvxBoxInfoItemValidFlags::LEFT|SvxBoxInfoItemValidFlags::RIGHT; - // for other objects (paragraph, page, frame, character) the edit is disabled, if there's no border set - if(!(nSWMode & SwBorderModes::TABLE) && !mbAllowPaddingWithoutBorders) - { - if(bLineSet) - { - nValid = (m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Top) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::TOP : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Bottom) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::BOTTOM : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Left) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::LEFT : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_aFrameSel.GetFrameBorderState( svx::FrameBorderType::Right ) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::RIGHT : SvxBoxInfoItemValidFlags::NONE; - } - else - nValid = SvxBoxInfoItemValidFlags::NONE; - } m_xLeftFT->set_sensitive( bool(nValid & SvxBoxInfoItemValidFlags::LEFT) ); m_xRightFT->set_sensitive( bool(nValid & SvxBoxInfoItemValidFlags::RIGHT) ); m_xTopFT->set_sensitive( bool(nValid & SvxBoxInfoItemValidFlags::TOP) ); diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index a038007c49fb..c6f989d9f211 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -670,7 +670,6 @@ DeactivateRC SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet ) SvxStdParagraphTabPage::SvxStdParagraphTabPage(TabPageParent pParent, const SfxItemSet& rAttr) : SfxTabPage(pParent, "cui/ui/paraindentspacing.ui", "ParaIndentSpacing", &rAttr) - , nAbst(MAX_DURCH) , nWidth(11905 /*567 * 50*/) , nMinFixDist(0) , bRelativeMode(false) @@ -883,9 +882,9 @@ void SvxStdParagraphTabPage::Init_Impl() DBG_ASSERT( pPool, "Where is the pool?" ); FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) ); - m_xTopDist->set_max( m_xTopDist->normalize( nAbst ), eUnit ); - m_xBottomDist->set_max( m_xBottomDist->normalize( nAbst ), eUnit ); - m_xLineDistAtMetricBox->set_max( m_xLineDistAtMetricBox->normalize( nAbst ), eUnit ); + m_xTopDist->set_max( m_xTopDist->normalize( MAX_DURCH ), eUnit ); + m_xBottomDist->set_max( m_xBottomDist->normalize( MAX_DURCH ), eUnit ); + m_xLineDistAtMetricBox->set_max( m_xLineDistAtMetricBox->normalize( MAX_DURCH ), eUnit ); } void SvxStdParagraphTabPage::UpdateExample_Impl() diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 51f864fd6cd7..8220e0b19d04 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -32,6 +32,8 @@ #include <sfx2/request.hxx> #include <svl/intitem.hxx> +constexpr FieldUnit eDefUnit = FieldUnit::MM_100TH; + const sal_uInt16 SvxTabulatorTabPage::pRanges[] = { SID_ATTR_TABSTOP, @@ -69,7 +71,6 @@ SvxTabulatorTabPage::SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet , aCurrentTab(0) , aNewTabs(0, 0, SvxTabAdjust::Left, GetWhich(SID_ATTR_TABSTOP)) , nDefDist(0) - , eDefUnit(FieldUnit::MM_100TH) , m_xTabSpin(m_xBuilder->weld_metric_spin_button("SP_TABPOS", FieldUnit::CM)) , m_xTabBox(m_xBuilder->weld_entry_tree_view("tabgrid", "ED_TABPOS", "LB_TABPOS")) , m_xCenterTab(m_xBuilder->weld_radio_button("radiobuttonBTN_TABTYPE_CENTER")) |