tdf#128150 Only show "Use background" btn in Impress & Draw
Change-Id: I5d14f651af55b51a8a02a8a4ddbb1c0921b15d81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136182
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index d261a96..3dae73f 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -289,7 +289,7 @@ void ShapeController::executeDispatch_FormatArea()
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr< AbstractSvxAreaTabDialog > pDlg(
pFact->CreateSvxAreaTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(), true));
pFact->CreateSvxAreaTabDialog(pChartWindow, &aAttr, &pDrawModelWrapper->getSdrModel(), true, false));
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 28d4734..fb61daf 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1156,9 +1156,11 @@ VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFil
VclPtr<AbstractSvxAreaTabDialog> AbstractDialogFactory_Impl::CreateSvxAreaTabDialog(weld::Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
bool bShadow)
bool bShadow,
bool bSlideBackground)
{
return VclPtr<AbstractSvxAreaTabDialog_Impl>::Create(std::make_shared<SvxAreaTabDialog>(pParent, pAttr, pModel, bShadow));
return VclPtr<AbstractSvxAreaTabDialog_Impl>::Create(
std::make_shared<SvxAreaTabDialog>(pParent, pAttr, pModel, bShadow, bSlideBackground));
}
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 1b9c85f..079af32 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -541,7 +541,8 @@ public:
virtual VclPtr<AbstractSvxAreaTabDialog> CreateSvxAreaTabDialog(weld::Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
bool bShadow) override;
bool bShadow,
bool bSlideBackground) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
SdrModel* pModel,
const SdrObject* pObj,
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index fa22f56..1d2c5cb 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -115,7 +115,8 @@ class SvxAreaTabDialog final : public SfxTabDialogController
void SavePalettes();
public:
SvxAreaTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow);
SvxAreaTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow,
bool bSlideBackground);
void SetNewColorList( XColorListRef const & pColorList )
{ mpNewColorList = pColorList; }
@@ -261,10 +262,14 @@ private:
DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet );
public:
SvxAreaTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
SvxAreaTabPage(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet& rInAttrs, bool bSlideBackground = false);
virtual ~SvxAreaTabPage() override;
static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
static std::unique_ptr<SfxTabPage>
CreateWithSlideBackground(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet*);
static WhichRangesContainer GetRanges() { return pAreaRanges; }
virtual bool FillItemSet( SfxItemSet* ) override;
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index a400c02..d03199c 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -31,7 +31,8 @@ SvxAreaTabDialog::SvxAreaTabDialog
weld::Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
bool bShadow
bool bShadow,
bool bSlideBackground
)
: SfxTabDialogController(pParent, "cui/ui/areadialog.ui", "AreaDialog", pAttr)
, mpDrawModel ( pModel ),
@@ -52,7 +53,10 @@ SvxAreaTabDialog::SvxAreaTabDialog
mnGradientListState ( ChangeType::NONE ),
mnHatchingListState ( ChangeType::NONE )
{
AddTabPage("RID_SVXPAGE_AREA", SvxAreaTabPage::Create, nullptr);
if (bSlideBackground)
AddTabPage("RID_SVXPAGE_AREA", SvxAreaTabPage::CreateWithSlideBackground, nullptr);
else
AddTabPage("RID_SVXPAGE_AREA", SvxAreaTabPage::Create, nullptr);
if (bShadow)
{
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 5a94566..119d6d1 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -72,7 +72,8 @@ void lclExtendSize(Size& rSize, const Size& rInputSize)
|*
\************************************************************************/
SvxAreaTabPage::SvxAreaTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
SvxAreaTabPage::SvxAreaTabPage(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet& rInAttrs, bool bSlideBackground)
: SfxTabPage(pPage, pController, "cui/ui/areatabpage.ui", "AreaTabPage", &rInAttrs)
// local fixed not o be changed values for local pointers
, maFixed_ChangeType(ChangeType::NONE)
@@ -99,7 +100,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);
@@ -107,7 +108,13 @@ 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);
if (bSlideBackground)
{
maBox.AddButton(m_xBtnUseBackground.get());
m_xBtnUseBackground->connect_toggled(aLink);
}
else
m_xBtnUseBackground->hide();
SetExchangeSupport();
}
@@ -360,6 +367,14 @@ std::unique_ptr<SfxTabPage> SvxAreaTabPage::Create(weld::Container* pPage, weld:
return xRet;
}
std::unique_ptr<SfxTabPage> SvxAreaTabPage::CreateWithSlideBackground(
weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrs)
{
auto xRet = std::make_unique<SvxAreaTabPage>(pPage, pController, *rAttrs, true);
xRet->SetOptimalSize(pController);
return xRet;
}
namespace {
std::unique_ptr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index ee22082..d697da7 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -405,7 +405,8 @@ public:
virtual VclPtr<AbstractSvxAreaTabDialog> CreateSvxAreaTabDialog(weld::Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
bool bShadow) = 0 ;
bool bShadow,
bool bSlideBackground) = 0 ;
virtual VclPtr<SfxAbstractTabDialog> CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog
SdrModel* pModel,
const SdrObject* pObj,
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 5593f44..87062e3 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -749,7 +749,8 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
{ // want the dialog to be destroyed before our set
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog(pParent, &aDescriptor, pModel.get(), true));
ScopedVclPtr<AbstractSvxAreaTabDialog> pDialog(
pFact->CreateSvxAreaTabDialog(pParent, &aDescriptor, pModel.get(), true, false));
if ( RET_OK == pDialog->Execute() )
{
bSuccess = true;
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index a92c49b..53273c7 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -552,7 +552,7 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq )
weld::Window* pWin = rViewData.GetDialogParent();
VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
pWin, &aNewAttr,
rViewData.GetDocument().GetDrawLayer(), true));
rViewData.GetDocument().GetDrawLayer(), true, false));
pDlg->StartExecuteAsync([=](sal_Int32 nResult){
if ( nResult == RET_OK )
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index e75ab54..4fe0d10 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -55,7 +55,9 @@ void FuArea::DoExecute( SfxRequest& rReq )
mpView->GetAttributes( aNewAttr );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc, true));
bool bHasSlideBackground = mpViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
VclPtr<AbstractSvxAreaTabDialog> pDlg(
pFact->CreateSvxAreaTabDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc, true, bHasSlideBackground));
pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){
if (nResult == RET_OK)
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 55de755..dd60a34 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -111,7 +111,8 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(rReq.GetFrameWeld(),
&aNewAttr,
pDoc,
true));
true,
false));
pDlg->StartExecuteAsync([bChanged, bHasMarked, pDoc, pDlg, pSh, pView, this](
sal_Int32 nResult){
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 9652af5..15a9a0d 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1385,6 +1385,7 @@ void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest const & rReq)
GetView().GetFrameWeld(),
&aNewAttr,
pDoc,
false,
false));
pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){