From f387d3ae8e5c675f45d92f5d8acfc61d9fda7533 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Jul 2017 16:10:32 +0100 Subject: SID_VIEW_FLD_PIC looks like a StarOffice < 6.0 holdover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit that can't exist anymore Change-Id: If94801fe854bc8ccf4307fce2674944f63e95d4c Reviewed-on: https://gerrit.libreoffice.org/40142 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/source/inc/backgrnd.hxx | 2 - cui/source/tabpages/backgrnd.cxx | 137 --------------------------------------- 2 files changed, 139 deletions(-) (limited to 'cui') diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index d95fe6084ea3..c200d996609c 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -129,8 +129,6 @@ private: SvxGraphicPosition GetGraphicPosition_Impl(); void FillControls_Impl(const SvxBrushItem& rBgdAttr, const OUString& rUserData); - bool FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot); - void ResetFromWallpaperItem( const SfxItemSet& rSet ); DECL_LINK( LoadIdleHdl_Impl, Timer*, void ); DECL_LINK(SelectHdl_Impl, ListBox&, void ); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 13ccc5e014d2..d0363ee70994 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -62,7 +62,6 @@ using namespace css; const sal_uInt16 SvxBackgroundTabPage::pPageRanges[] = { - SID_VIEW_FLD_PIC, SID_VIEW_FLD_PIC, SID_ATTR_BRUSH, SID_ATTR_BRUSH, SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR, 0 @@ -434,12 +433,6 @@ VclPtr SvxBackgroundTabPage::Create( vcl::Window* pParent, const Sfx void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) { - if(SfxItemState::DEFAULT <= rSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false)) - { - ResetFromWallpaperItem( *rSet ); - return; - } - m_bColorSelected = false; // condition of the preview button is persistent due to UserData @@ -561,56 +554,6 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) } } -void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet ) -{ - ShowSelector(); - - // condition of the preview button is persistent due to UserData - OUString aUserData = GetUserData(); - m_pBtnPreview->Check( !aUserData.isEmpty() && '1' == aUserData[0] ); - - // get and evaluate Input-BrushItem - const SvxBrushItem* pBgdAttr = nullptr; - sal_uInt16 nWhich = GetWhich( SID_VIEW_FLD_PIC ); - std::unique_ptr pTemp; - - if ( rSet.GetItemState( nWhich, false ) >= SfxItemState::DEFAULT ) - { - const CntWallpaperItem* pItem = static_cast(&rSet.Get( nWhich )); - pTemp.reset(new SvxBrushItem( *pItem, nWhich )); - pBgdAttr = pTemp.get(); - } - - m_pBtnTile->Check(); - - if ( pBgdAttr ) - { - FillControls_Impl(*pBgdAttr, aUserData); - // brush shall be kept when showing the graphic, too - if( aBgdColor != pBgdAttr->GetColor() ) - { - aBgdColor = pBgdAttr->GetColor(); - sal_uInt16 nCol = GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor); - m_pBackgroundColorSet->SelectItem( nCol ); - m_pPreviewWin1->NotifyChange( aBgdColor ); - } - } - else - { - lcl_setFillStyle(m_pLbSelect, drawing::FillStyle_SOLID); - ShowColorUI_Impl(); - - const SfxPoolItem* pOld = GetOldItem( rSet, SID_VIEW_FLD_PIC ); - if ( pOld ) - aBgdColor = Color( static_cast(pOld)->GetColor() ); - } - - // We now have always a link to the background - bLinkOnly = true; - m_pBtnLink->Check(); - m_pBtnLink->Show( false ); -} - /** When destroying a SfxTabPage this virtual method is called, so that the TabPage can save internal information. @@ -628,8 +571,6 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) pPageImpl->pLoadIdle->Stop(); LoadIdleHdl_Impl( pPageImpl->pLoadIdle ); } - if(SfxItemState::DEFAULT <= rCoreSet->GetItemState(GetWhich(SID_VIEW_FLD_PIC), false)) - return FillItemSetWithWallpaperItem( *rCoreSet, SID_VIEW_FLD_PIC ); bool bModified = false; sal_uInt16 nSlot = SID_ATTR_BRUSH; @@ -831,84 +772,6 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) return bModified; } -bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot) -{ - sal_uInt16 nWhich = GetWhich( nSlot ); - const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot ); - DBG_ASSERT(pOld,"FillItemSetWithWallpaperItem: Item not found"); - if (!pOld) - return false; - const SfxItemSet& rOldSet = GetItemSet(); - - SvxBrushItem rOldItem( static_cast(*pOld), nWhich ); - SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos(); - const bool bIsBrush = ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) ); - bool bModified = false; - - if ( ( (GPOS_NONE == eOldPos) && bIsBrush ) - || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap changed? - { - // background art hasn't been changed - - if ( (GPOS_NONE == eOldPos) || !m_pLbSelect->IsVisible() ) - { - // Brush-treatment: - if ( rOldItem.GetColor() != aBgdColor ) - { - bModified = true; - CntWallpaperItem aItem( nWhich ); - aItem.SetColor( aBgdColor ); - rCoreSet.Put( aItem ); - } - else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) ) - rCoreSet.ClearItem( nWhich ); - } - else - { - // Bitmap-treatment: - SvxGraphicPosition eNewPos = GetGraphicPosition_Impl(); - - bool bBitmapChanged = ( ( eNewPos != eOldPos ) || - ( rOldItem.GetGraphicLink() != aBgdGraphicPath ) ); - bool bBrushChanged = ( rOldItem.GetColor() != aBgdColor ); - if( bBitmapChanged || bBrushChanged ) - { - bModified = true; - - CntWallpaperItem aItem( nWhich ); - WallpaperStyle eWallStyle = SvxBrushItem::GraphicPos2WallpaperStyle(eNewPos); - aItem.SetStyle( sal::static_int_cast< sal_uInt16 >( eWallStyle ) ); - aItem.SetColor( aBgdColor ); - aItem.SetBitmapURL( aBgdGraphicPath ); - rCoreSet.Put( aItem ); - } - else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) ) - rCoreSet.ClearItem( nWhich ); - } - } - else // Brush <-> Bitmap changed! - { - CntWallpaperItem aItem( nWhich ); - if ( bIsBrush ) - { - aItem.SetColor( aBgdColor ); - rCoreSet.Put( aItem ); - } - else - { - WallpaperStyle eWallStyle = - SvxBrushItem::GraphicPos2WallpaperStyle( GetGraphicPosition_Impl() ); - aItem.SetStyle( sal::static_int_cast< sal_uInt16 >( eWallStyle ) ); - aItem.SetColor( aBgdColor ); - aItem.SetBitmapURL( aBgdGraphicPath ); - rCoreSet.Put( aItem ); - } - - bModified = true; - } - return bModified; -} - /** virtual method; is called on deactivation */ DeactivateRC SvxBackgroundTabPage::DeactivatePage( SfxItemSet* _pSet ) { -- cgit