Kaydet (Commit) 7d7396d0 authored tarafından Aditya's avatar Aditya Kaydeden (comit) Michael Stahl

tdf#116382 Replace old dialog in header and footer drop-down menu

Remove the Background tabpage in "Border/Background" dialog accessed
from Border and Background menu item in Header/Footer drop-down list
and replace it with the tabpages "Area" and "Transparency" of the dialog
accessed from Page Style > Header > "More.." button.
 The old dialog does not have the tabpages "Area" and "Transparency".
In simpler words, the patch is to match both the dialogs
when accessed in two different ways.

Reviewed-on: https://gerrit.libreoffice.org/67483
Tested-by: Jenkins
Reviewed-by: 's avatarJim Raykowski <raykowj@gmail.com>
(cherry picked from commit 55042cb5)

Change-Id: Ib84435854389360eba41aecb8578a9a67a92ca1e
Reviewed-on: https://gerrit.libreoffice.org/68545Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
Tested-by: Jenkins
üst b21d7620
...@@ -88,7 +88,7 @@ namespace svx { ...@@ -88,7 +88,7 @@ namespace svx {
{ {
bool bRes = false; bool bRes = false;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg(pParent, *pBBSet, false /*bEnableDrawingLayerFillStyles*/)); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg(pParent, *pBBSet, true /*bEnableDrawingLayerFillStyles*/));
if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() ) if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
{ {
SfxItemIter aIter( *pDlg->GetOutputItemSet() ); SfxItemIter aIter( *pDlg->GetOutputItemSet() );
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <strings.hrc> #include <strings.hrc>
#include <globals.hrc> #include <globals.hrc>
#include <doc.hxx>
#include <drawdoc.hxx>
#include <cmdid.h> #include <cmdid.h>
#include <DashedLine.hxx> #include <DashedLine.hxx>
#include <docsh.hxx> #include <docsh.hxx>
...@@ -414,47 +416,19 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent) ...@@ -414,47 +416,19 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent)
SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() ); SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() );
if ( m_bIsHeader ) if ( m_bIsHeader )
pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() ); pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() );
SfxItemSet aSet( pHFFormat->GetAttrSet() );
SfxItemPool* pPool = pHFFormat->GetAttrSet().GetPool(); // Items to hand over XPropertyList things like XColorList,
SfxItemSet aSet( // XHatchList, XGradientList, and XBitmapList to the Area TabPage:
*pPool, aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
svl::Items< // create needed items for XPropertyList entries from the DrawModel so that
RES_BACKGROUND, RES_SHADOW, // the Area TabPage can access them
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); rSh.GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems( aSet );
aSet.Put( pHFFormat->GetAttrSet() ); if (svx::ShowBorderBackgroundDlg( GetFrameWeld(), &aSet ) )
// Create a box info item... needed by the dialog
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
const SfxPoolItem *pBoxInfo;
if ( SfxItemState::SET == pHFFormat->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
true, &pBoxInfo) )
aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
aBoxInfo.SetTable( false );
aBoxInfo.SetDist( true);
aBoxInfo.SetMinDist( false );
aBoxInfo.SetDefDist( MIN_BORDER_DIST );
aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
aSet.Put( aBoxInfo );
if (svx::ShowBorderBackgroundDlg(GetFrameWeld(), &aSet))
{ {
const SfxPoolItem* pItem; pHFFormat->SetFormatAttr( aSet );
if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) { rView.GetDocShell()->SetModified();
pHFFormat->SetFormatAttr( *pItem );
rView.GetDocShell()->SetModified();
}
if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, &pItem ) ) {
pHFFormat->SetFormatAttr( *pItem );
rView.GetDocShell()->SetModified();
}
if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, &pItem ) ) {
pHFFormat->SetFormatAttr( *pItem );
rView.GetDocShell()->SetModified();
}
} }
} }
else if (rIdent == "delete") else if (rIdent == "delete")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment