summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2022-06-20 16:05:00 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2022-06-21 07:54:07 +0200
commit2185eb10147723bbf1b7966f995dc01d64c5e6c8 (patch)
treef5131b6206758e169fc65a4378849f868a2c57f2
parent903403c1e3d5c0f882189fa87ed2b19c16a9893e (diff)
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>
-rw-r--r--chart2/source/controller/main/ShapeController.cxx2
-rw-r--r--cui/source/factory/dlgfact.cxx6
-rw-r--r--cui/source/factory/dlgfact.hxx3
-rw-r--r--cui/source/inc/cuitabarea.hxx9
-rw-r--r--cui/source/tabpages/tabarea.cxx8
-rw-r--r--cui/source/tabpages/tparea.cxx21
-rw-r--r--include/svx/svxdlg.hxx3
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx3
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx2
-rw-r--r--sd/source/ui/func/fuarea.cxx4
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx3
-rw-r--r--sw/source/uibase/shells/frmsh.cxx1
12 files changed, 49 insertions, 16 deletions
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index d261a967feea..3dae73fd8573 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 28d473479ac7..fb61dafcecbb 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 1b9c85f66841..079af32b444c 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 fa22f56e040f..1d2c5cb0a534 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 a400c0207839..d03199c7b982 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 5a94566d83c5..119d6d154076 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 ee22082c35dc..d697da78a66c 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 5593f44ef9f9..87062e35c6f6 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 a92c49b8b030..53273c77c7cc 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 e75ab54a8f9a..4fe0d10179fc 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 55de755ef81a..dd60a34b449e 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 9652af505186..15a9a0df6cf7 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){