diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-06-13 08:53:22 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-06-16 15:44:53 +0200 |
commit | c4cf2e82e8d0aaef9b1daedc033d6edf647e5284 (patch) | |
tree | 86baca7fce89d0527d8177a7c4bb9a0e804cfc64 /cui | |
parent | 3d2e26d8b7a99d0a622741ef4327e8cbc93bbe02 (diff) |
tdf#128150 Add OOXML import/export for "use background fill"
and allow editing this fill property in area dlg
Change-Id: Ic63ba11e9d499d4a0fb22f6739587e3e25140b8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134406
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/cuitabarea.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 36 | ||||
-rw-r--r-- | cui/uiconfig/ui/areatabpage.ui | 18 |
3 files changed, 52 insertions, 3 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index aa4e07343bd2..fa22f56e040f 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -241,6 +241,7 @@ protected: std::unique_ptr<weld::Toggleable> m_xBtnHatch; std::unique_ptr<weld::Toggleable> m_xBtnBitmap; std::unique_ptr<weld::Toggleable> m_xBtnPattern; + std::unique_ptr<weld::Toggleable> m_xBtnUseBackground; void SetOptimalSize(weld::DialogController* pController); diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index f7bbf34ef676..5a94566d83c5 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -19,6 +19,7 @@ #include <svx/svxids.hrc> #include <svx/xfillit0.hxx> +#include <svx/xfilluseslidebackgrounditem.hxx> #include <svx/xflbckit.hxx> #include <svx/drawitem.hxx> #include <svx/xflclit.hxx> @@ -41,7 +42,8 @@ enum FillType GRADIENT, HATCH, BITMAP, - PATTERN + PATTERN, + USE_BACKGROUND_FILL }; } @@ -89,6 +91,7 @@ SvxAreaTabPage::SvxAreaTabPage(weld::Container* pPage, weld::DialogController* p , m_xBtnHatch(m_xBuilder->weld_toggle_button("btnhatch")) , m_xBtnBitmap(m_xBuilder->weld_toggle_button("btnbitmap")) , m_xBtnPattern(m_xBuilder->weld_toggle_button("btnpattern")) + , m_xBtnUseBackground(m_xBuilder->weld_toggle_button("btnusebackground")) { maBox.AddButton(m_xBtnNone.get()); maBox.AddButton(m_xBtnColor.get()); @@ -96,6 +99,7 @@ SvxAreaTabPage::SvxAreaTabPage(weld::Container* pPage, weld::DialogController* p maBox.AddButton(m_xBtnHatch.get()); maBox.AddButton(m_xBtnBitmap.get()); maBox.AddButton(m_xBtnPattern.get()); + maBox.AddButton(m_xBtnUseBackground.get()); Link<weld::Toggleable&, void> aLink = LINK(this, SvxAreaTabPage, SelectFillTypeHdl_Impl); m_xBtnNone->connect_toggled(aLink); m_xBtnColor->connect_toggled(aLink); @@ -103,6 +107,7 @@ SvxAreaTabPage::SvxAreaTabPage(weld::Container* pPage, weld::DialogController* p m_xBtnHatch->connect_toggled(aLink); m_xBtnBitmap->connect_toggled(aLink); m_xBtnPattern->connect_toggled(aLink); + m_xBtnUseBackground->connect_toggled(aLink); SetExchangeSupport(); } @@ -166,7 +171,11 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) default: case drawing::FillStyle_NONE: { - SelectFillType(*m_xBtnNone); + XFillUseSlideBackgroundItem aBckItem( rSet.Get(XATTR_FILLUSESLIDEBACKGROUND)); + if (aBckItem.GetValue()) + SelectFillType(*m_xBtnUseBackground); + else + SelectFillType(*m_xBtnNone); break; } case drawing::FillStyle_SOLID: @@ -184,7 +193,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) case drawing::FillStyle_HATCH: { m_rXFSet.Put( rSet.Get(XATTR_FILLHATCH) ); - m_rXFSet.Put( rSet.Get(XATTR_FILLBACKGROUND) ); + m_rXFSet.Put( rSet.Get(XATTR_FILLUSESLIDEBACKGROUND) ); m_rXFSet.Put( rSet.Get(XATTR_FILLCOLOR) ); SelectFillType(*m_xBtnHatch); break; @@ -222,6 +231,8 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet ) { XFillStyleItem aStyleItem( drawing::FillStyle_NONE ); _pSet->Put( aStyleItem ); + XFillUseSlideBackgroundItem aFillBgItem( false ); + _pSet->Put( aFillBgItem ); } break; } @@ -235,6 +246,17 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivatePage_Impl<SvxBitmapTabPage&>(_pSet); case PATTERN: return DeactivatePage_Impl<SvxPatternTabPage>(_pSet); + case USE_BACKGROUND_FILL: + { + if ( m_bBtnClicked ) + { + XFillStyleItem aStyleItem( drawing::FillStyle_NONE ); + _pSet->Put( aStyleItem ); + XFillUseSlideBackgroundItem aFillBgItem( true ); + _pSet->Put( aFillBgItem ); + } + break; + } default: break; } @@ -255,6 +277,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) case TRANSPARENT: { rAttrs->Put( XFillStyleItem( drawing::FillStyle_NONE ) ); + rAttrs->Put( XFillUseSlideBackgroundItem( false ) ); return true; } case SOLID: @@ -277,6 +300,12 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) { return FillItemSet_Impl<SvxPatternTabPage>( rAttrs ); } + case USE_BACKGROUND_FILL: + { + rAttrs->Put( XFillStyleItem( drawing::FillStyle_NONE ) ); + rAttrs->Put( XFillUseSlideBackgroundItem( true ) ); + return true; + } default: return false; } @@ -344,6 +373,7 @@ std::unique_ptr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, weld::Con case HATCH: fnCreate = &SvxHatchTabPage::Create; break; case BITMAP: fnCreate = &SvxBitmapTabPage::Create; break; case PATTERN: fnCreate = &SvxPatternTabPage::Create; break; + case USE_BACKGROUND_FILL: fnCreate = nullptr; break; } return fnCreate ? (*fnCreate)( pPage, pController, &rSet ) : nullptr; } diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui index f1c671b804bc..4555c0df0207 100644 --- a/cui/uiconfig/ui/areatabpage.ui +++ b/cui/uiconfig/ui/areatabpage.ui @@ -155,6 +155,24 @@ <property name="position">6</property> </packing> </child> + <child> + <object class="GtkToggleButton" id="btnusebackground"> + <property name="label" translatable="yes" context="areatabpage|btnusebackground">Use Background</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="btnusebackground-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btnusebackground">Displays the underlying slide background.</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |