diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-06-17 09:55:33 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-06-17 09:55:33 +0200 |
commit | 2b13db0125dabdfa77f8b5d0e8ef934b65a4f17d (patch) | |
tree | 62c7c59ff919d2c90debbddaa8f205aa00a9f0af /cui/source | |
parent | efc5602dd3a2c2c138e0290e58ed1527523e4dcf (diff) |
Handle highlighting case inside SvxBackgroundPage class
... instead of converting attributes.
(cherry picked from commit 62fb96e075e79676b45912a3a8ec2702b1e3aaf2)
Change-Id: I3e45c0641389a7b6bdecb5141646aa13ee5c0aa5
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/srchxtra.cxx | 1 | ||||
-rw-r--r-- | cui/source/inc/backgrnd.hxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 36 |
3 files changed, 39 insertions, 2 deletions
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index db419525e4e4..088ba45fa7cf 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -113,7 +113,6 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage ) } else if (nId == m_nBackPageId) { - static_cast<SvxBackgroundTabPage&>(rPage).ShowParaControl(true); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING))); rPage.PageCreated(aSet); diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index c08b8a1308b8..6845c41730a6 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -25,6 +25,7 @@ #include <svx/SvxColorValueSet.hxx> #include <svx/dlgctrl.hxx> #include <editeng/brushitem.hxx> +#include <memory> class BackgroundPreviewImpl; class SvxOpenGraphicDialog; @@ -118,6 +119,8 @@ private: bool bLinkOnly : 1; bool bColTransparency : 1; bool bGraphTransparency : 1; + bool bHighlighting : 1; + Graphic aBgdGraphic; OUString aBgdGraphicPath; OUString aBgdGraphicFilter; @@ -127,6 +130,7 @@ private: SvxBackgroundTable_Impl* pTableBck_Impl;///< Items for Sw-Table must be corrected SvxBackgroundPara_Impl* pParaBck_Impl;///< also for the paragraph style + std::unique_ptr<SvxBrushItem> pHighlighting; void FillColorValueSets_Impl(); void ShowColorUI_Impl(); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 14c90e94ccb4..a396f49b048e 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -358,10 +358,12 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe , bLinkOnly(false) , bColTransparency(false) , bGraphTransparency(false) + , bHighlighting(false) , pPageImpl(new SvxBackgroundPage_Impl) , pImportDlg(NULL) , pTableBck_Impl(NULL) , pParaBck_Impl(NULL) + , pHighlighting(nullptr) { get(m_pAsGrid, "asgrid"); get(m_pSelectTxt, "asft"); @@ -554,6 +556,10 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) break; } } + else if( bHighlighting ) + { + nSlot = SID_ATTR_BRUSH_CHAR; + } //#111173# the destination item is missing when the parent style has been changed if(USHRT_MAX == nDestValue && (m_pParaLBox->IsVisible()||m_pTblLBox->IsVisible())) nDestValue = 0; @@ -624,7 +630,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) TblDestinationHdl_Impl(m_pTblLBox); m_pTblLBox->SaveValue(); } - else + else if (m_pParaLBox->GetData() == m_pParaLBox) { sal_Int32 nValue = m_pParaLBox->GetSelectEntryPos(); @@ -659,6 +665,15 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) ParaDestinationHdl_Impl(m_pParaLBox); m_pParaLBox->SaveValue(); } + else if( bHighlighting ) + { + nWhich = GetWhich( SID_ATTR_BRUSH_CHAR ); + if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT ) + { + pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) )); + pHighlighting.reset(new SvxBrushItem(*pBgdAttr)); + } + } } } @@ -770,6 +785,10 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) break; } } + else if( bHighlighting ) + { + nSlot = SID_ATTR_BRUSH_CHAR; + } sal_uInt16 nWhich = GetWhich( nSlot ); const SfxPoolItem* pOld = GetOldItem( *rCoreSet, nSlot ); @@ -974,6 +993,20 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) bModified |= true; } } + else if( bHighlighting ) + { + if( nSlot != SID_ATTR_BRUSH_CHAR ) + { + const SfxPoolItem* pOldChar = + GetOldItem( *rCoreSet, SID_ATTR_BRUSH_CHAR ); + if ( pOldChar && pHighlighting && + (*pHighlighting != *pOldChar || *pHighlighting != SvxBrushItem(SID_ATTR_BRUSH_CHAR))) + { + rCoreSet->Put( *pHighlighting ); + bModified |= true; + } + } + } return bModified; } @@ -1789,6 +1822,7 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet) if ( nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING ) { m_pBackGroundColorLabelFT->SetText(CUI_RES(RID_SVXSTR_CHARNAME_HIGHLIGHTING)); + bHighlighting = true; } } } |