[Libreoffice-commits] core.git: svx/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Feb 28 21:04:55 UTC 2019


 svx/source/dialog/hdft.cxx                 |    2 -
 sw/source/uibase/docvw/HeaderFooterWin.cxx |   55 ++++++-----------------------
 2 files changed, 14 insertions(+), 43 deletions(-)

New commits:
commit 55042cb54fea5f7ad777c03af9bf8197127b6736
Author:     Aditya <adityasahu1511 at gmail.com>
AuthorDate: Sun Feb 24 21:17:14 2019 +0530
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Thu Feb 28 22:04:28 2019 +0100

    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.
    
    Change-Id: Ib84435854389360eba41aecb8578a9a67a92ca1e
    Reviewed-on: https://gerrit.libreoffice.org/67483
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 2a32ca807f44..9fe7f811d9eb 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -88,7 +88,7 @@ namespace svx {
     {
         bool bRes = false;
         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() )
         {
             SfxItemIter aIter( *pDlg->GetOutputItemSet() );
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 2d1fca27f4f3..307704b99362 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -11,6 +11,8 @@
 #include <strings.hrc>
 #include <globals.hrc>
 
+#include <doc.hxx>
+#include <drawdoc.hxx>
 #include <cmdid.h>
 #include <DashedLine.hxx>
 #include <docsh.hxx>
@@ -423,50 +425,19 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent)
         SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() );
         if ( m_bIsHeader )
             pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() );
+        SfxItemSet aSet( pHFFormat->GetAttrSet() );
 
-        SfxItemPool* pPool = pHFFormat->GetAttrSet().GetPool();
-        SfxItemSet aSet(
-            *pPool,
-            svl::Items<
-                RES_BACKGROUND, RES_SHADOW,
-                XATTR_FILL_FIRST, XATTR_FILL_LAST,
-                SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{});
-
-        aSet.Put( pHFFormat->GetAttrSet() );
-
-        aSet.Put( pHFFormat->makeBackgroundBrushItem() );
-
-        // 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))
+        // Items to hand over XPropertyList things like XColorList,
+        // XHatchList, XGradientList, and XBitmapList to the Area TabPage:
+        aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
+        // create needed items for XPropertyList entries from the DrawModel so that
+        // the Area TabPage can access them
+        rSh.GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems( aSet );
+
+        if (svx::ShowBorderBackgroundDlg( GetFrameWeld(), &aSet ) )
         {
-            const SfxPoolItem* pItem;
-            if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) {
-                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();
-            }
+            pHFFormat->SetFormatAttr( aSet );
+            rView.GetDocShell()->SetModified();
         }
     }
     else if (rIdent == "delete")


More information about the Libreoffice-commits mailing list