[Libreoffice-commits] core.git: cui/source include/editeng sw/source

Mike Kaganski mike.kaganski at collabora.com
Mon Feb 26 08:50:15 UTC 2018


 cui/source/inc/border.hxx           |    1 
 cui/source/tabpages/border.cxx      |   32 +++++++++---
 cui/source/tabpages/borderconn.cxx  |   10 +--
 cui/source/tabpages/borderconn.hxx  |    2 
 include/editeng/editids.hrc         |    2 
 sw/source/core/bastyp/init.cxx      |    4 -
 sw/source/ui/envelp/envfmt.cxx      |    4 -
 sw/source/uibase/app/docst.cxx      |    6 +-
 sw/source/uibase/inc/uitool.hxx     |   10 ---
 sw/source/uibase/shells/textsh1.cxx |    4 -
 sw/source/uibase/utlui/uitool.cxx   |   92 ++++++++++--------------------------
 11 files changed, 73 insertions(+), 94 deletions(-)

New commits:
commit 074fc4a1499aac6eb67cd0b2dca00a51071cff0e
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sun Feb 25 21:00:07 2018 +0300

    tdf#116020: use actual whichIds in dialogs for character properties
    
    ... instead of converting back and forth between character-specific
    whichIds and generic. This eliminates creating duplicate properties
    in the set passed to dialog.
    A temporary GrabBag entry "DialogUseCharAttr" is used to indicate
    that dialogs should use character-specific Ids. This simplifies and
    unifies preparation of the set for different dialogs.
    
    Change-Id: I41b982ff05d54b0dfc283c07aef806f51c87209c
    Reviewed-on: https://gerrit.libreoffice.org/50339
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 6502549ac6d7..b8fb44b4021e 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -107,6 +107,7 @@ private:
 
     long                nMinValue;  ///< minimum distance
     SwBorderModes       nSWMode;    ///< table, textframe, paragraph
+    sal_uInt16          mnBoxSlot;
 
     bool                mbHorEnabled;       ///< true = Inner horizontal border enabled.
     bool                mbVerEnabled;       ///< true = Inner vertical border enabled.
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 0ba63a11e4fa..0760e52d053d 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -39,6 +39,7 @@
 #include <vcl/settings.hxx>
 #include <svx/flagsdef.hxx>
 #include <sfx2/request.hxx>
+#include <svl/grabbagitem.hxx>
 #include <svl/intitem.hxx>
 #include <svl/ilstitem.hxx>
 #include <svl/int64item.hxx>
@@ -96,6 +97,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
     : SfxTabPage(pParent, "BorderPage", "cui/ui/borderpage.ui", &rCoreAttrs)
     , nMinValue(0)
     , nSWMode(SwBorderModes::NONE)
+    , mnBoxSlot(SID_ATTR_BORDER_OUTER)
     , mbHorEnabled(false)
     , mbVerEnabled(false)
     , mbTLBREnabled(false)
@@ -316,9 +318,25 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
     FillLineListBox_Impl();
 
     // connections
-    bool bSupportsShadow = !SfxItemPool::IsSlot( GetWhich( SID_ATTR_BORDER_SHADOW ) );
+    sal_uInt16 nShadowSlot = SID_ATTR_BORDER_SHADOW;
+    if (rCoreAttrs.HasItem(GetWhich(SID_ATTR_CHAR_GRABBAG), &pItem))
+    {
+        const SfxGrabBagItem* pGrabBag = static_cast<const SfxGrabBagItem*>(pItem);
+        auto it = pGrabBag->GetGrabBag().find("DialogUseCharAttr");
+        if (it != pGrabBag->GetGrabBag().end())
+        {
+            bool bDialogUseCharAttr = false;
+            it->second >>= bDialogUseCharAttr;
+            if (bDialogUseCharAttr)
+            {
+                nShadowSlot = SID_ATTR_CHAR_SHADOW;
+                mnBoxSlot = SID_ATTR_CHAR_BOX;
+            }
+        }
+    }
+    bool bSupportsShadow = !SfxItemPool::IsSlot( GetWhich( nShadowSlot ) );
     if( bSupportsShadow )
-        AddItemConnection( svx::CreateShadowConnection( rCoreAttrs, *m_pWndShadows, *m_pEdShadowSize, *m_pLbShadowColor ) );
+        AddItemConnection( svx::CreateShadowConnection( nShadowSlot, rCoreAttrs, *m_pWndShadows, *m_pEdShadowSize, *m_pLbShadowColor ) );
     else
         HideShadowControls();
 
@@ -427,10 +445,10 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
     const SvxBoxItem*       pBoxItem;
     const SvxBoxInfoItem*   pBoxInfoItem;
-    sal_uInt16              nWhichBox       = GetWhich(SID_ATTR_BORDER_OUTER);
+    sal_uInt16              nWhichBox       = GetWhich(mnBoxSlot);
     MapUnit                 eCoreUnit;
 
-    pBoxItem  = static_cast<const SvxBoxItem*>(GetItem( *rSet, SID_ATTR_BORDER_OUTER ));
+    pBoxItem  = static_cast<const SvxBoxItem*>(GetItem( *rSet, mnBoxSlot ));
 
     pBoxInfoItem = GetItem( *rSet, SID_ATTR_BORDER_INNER, false );
 
@@ -648,12 +666,12 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
     bool bAttrsChanged = SfxTabPage::FillItemSet( rCoreAttrs );
 
     bool                  bPut          = true;
-    sal_uInt16            nBoxWhich     = GetWhich( SID_ATTR_BORDER_OUTER );
+    sal_uInt16            nBoxWhich     = GetWhich( mnBoxSlot );
     sal_uInt16            nBoxInfoWhich = rCoreAttrs->GetPool()->GetWhich( SID_ATTR_BORDER_INNER, false );
     const SfxItemSet&     rOldSet       = GetItemSet();
     SvxBoxItem            aBoxItem      ( nBoxWhich );
     SvxBoxInfoItem        aBoxInfoItem  ( nBoxInfoWhich );
-    const SvxBoxItem*     pOldBoxItem = static_cast<const SvxBoxItem*>(GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_OUTER ));
+    const SvxBoxItem*     pOldBoxItem = static_cast<const SvxBoxItem*>(GetOldItem( *rCoreAttrs, mnBoxSlot ));
 
     MapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
 
@@ -1224,7 +1242,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset )
         return;
     const SfxItemSet&     rOldSet         = GetItemSet();
     const SvxBoxInfoItem* pOldBoxInfoItem = GetOldItem( rOldSet, SID_ATTR_BORDER_INNER );
-    const SvxBoxItem*     pOldBoxItem     = static_cast<const SvxBoxItem*>(GetOldItem( rOldSet, SID_ATTR_BORDER_OUTER ));
+    const SvxBoxItem*     pOldBoxItem     = static_cast<const SvxBoxItem*>(GetOldItem( rOldSet, mnBoxSlot ));
     if( !pOldBoxInfoItem || !pOldBoxItem )
         return;
     std::pair<svx::FrameBorderType, SvxBoxInfoItemValidFlags> eTypes1[] = {
diff --git a/cui/source/tabpages/borderconn.cxx b/cui/source/tabpages/borderconn.cxx
index 7b49f35022f1..78d2c3ba637e 100644
--- a/cui/source/tabpages/borderconn.cxx
+++ b/cui/source/tabpages/borderconn.cxx
@@ -254,13 +254,13 @@ void ShadowControlsWrapper::SetControlValue( SvxShadowItem aItem )
 class ShadowConnection : public sfx::ItemControlConnection< ShadowItemWrapper, ShadowControlsWrapper >
 {
 public:
-    explicit            ShadowConnection( const SfxItemSet& rItemSet,
+    explicit ShadowConnection( sal_uInt16 nSlot, const SfxItemSet& rItemSet,
                                 ValueSet& rVsPos, MetricField& rMfSize, SvxColorListBox& rLbColor );
 };
 
-ShadowConnection::ShadowConnection( const SfxItemSet& rItemSet,
+ShadowConnection::ShadowConnection( sal_uInt16 nSlot, const SfxItemSet& rItemSet,
         ValueSet& rVsPos, MetricField& rMfSize, SvxColorListBox& rLbColor ) :
-    ItemControlConnectionType( SID_ATTR_BORDER_SHADOW, new ShadowControlsWrapper( rVsPos, rMfSize, rLbColor ), ItemConnFlags::NONE )
+    ItemControlConnectionType( nSlot, new ShadowControlsWrapper( rVsPos, rMfSize, rLbColor ), ItemConnFlags::NONE )
 {
     mxCtrlWrp->SetDefaultValue( maItemWrp.GetDefaultItem( rItemSet ) );
 }
@@ -279,10 +279,10 @@ sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet,
     return new MarginConnection( rItemSet, rMfLeft, rMfRight, rMfTop, rMfBottom );
 }
 
-sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet,
+sfx::ItemConnectionBase* CreateShadowConnection( sal_uInt16 nSlot, const SfxItemSet& rItemSet,
         ValueSet& rVsPos, MetricField& rMfSize, SvxColorListBox& rLbColor )
 {
-    return new ShadowConnection( rItemSet, rVsPos, rMfSize, rLbColor );
+    return new ShadowConnection( nSlot, rItemSet, rVsPos, rMfSize, rLbColor );
 }
 
 
diff --git a/cui/source/tabpages/borderconn.hxx b/cui/source/tabpages/borderconn.hxx
index b04d4a8b0c1f..01b404667f49 100644
--- a/cui/source/tabpages/borderconn.hxx
+++ b/cui/source/tabpages/borderconn.hxx
@@ -46,7 +46,7 @@ sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet,
 
 /** Creates an item connection object that connects an SvxShadowItem with the
     controls of the SvxBorderTabPage. */
-sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet,
+sfx::ItemConnectionBase* CreateShadowConnection( sal_uInt16 nSlot, const SfxItemSet& rItemSet,
         ValueSet& rVsPos, MetricField& rMfSize, SvxColorListBox& rLbColor );
 
 
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
index e72976e88144..4274173503fc 100644
--- a/include/editeng/editids.hrc
+++ b/include/editeng/editids.hrc
@@ -132,6 +132,8 @@
 #define SID_ATTR_PARA_OUTLINE_LEVEL                     ( SID_EDIT_START + 73 )
 #define SID_ATTR_CHAR_PREVIEW_FONT                      ( SID_EDIT_START + 74 )
 #define SID_ATTR_CHAR_ENDPREVIEW_FONT                   ( SID_EDIT_START + 75 )
+#define SID_ATTR_CHAR_BOX                               ( SID_EDIT_START + 76 )
+#define SID_ATTR_CHAR_SHADOW                            ( SID_EDIT_START + 77 )
 
 
 #if 95 > (SID_EDIT_END-SID_EDIT_START)
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 409b36f05984..aece5124d461 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -302,8 +302,8 @@ SfxItemInfo aSlotTab[] =
     { SID_ATTR_CHAR_HIDDEN, true },        // RES_CHRATR_HIDDEN
     { SID_ATTR_CHAR_OVERLINE, true },      // RES_CHRATR_OVERLINE
     { 0, true },                           // RES_CHRATR_RSID
-    { 0, true },                           // RES_CHRATR_BOX
-    { 0, true },                           // RES_CHRATR_SHADOW
+    { SID_ATTR_CHAR_BOX, true },           // RES_CHRATR_BOX
+    { SID_ATTR_CHAR_SHADOW, true },        // RES_CHRATR_SHADOW
     { 0, true },                           // RES_CHRATR_HIGHLIGHT
     { SID_ATTR_CHAR_GRABBAG, true },       // RES_CHRATR_GRABBAG
     { 0, true },                           // RES_CHRATR_BIDIRTL
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index f4a90609cb3a..2b5cb4583d6c 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -276,7 +276,7 @@ IMPL_LINK( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void )
 
         // In order for the background color not to get ironed over:
         SfxAllItemSet aTmpSet(*pCollSet);
-        ::ConvertAttrCharToGen(aTmpSet, CONV_ATTR_ENV);
+        ::ConvertAttrCharToGen(aTmpSet);
 
         SwAbstractDialogFactory* pFact = swui::GetFactory();
         OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
@@ -287,7 +287,7 @@ IMPL_LINK( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void )
         if (pDlg->Execute() == RET_OK)
         {
             SfxItemSet aOutputSet( *pDlg->GetOutputItemSet() );
-            ::ConvertAttrGenToChar(aOutputSet, aTmpSet, CONV_ATTR_ENV);
+            ::ConvertAttrGenToChar(aOutputSet, aTmpSet);
             pCollSet->Put(aOutputSet);
         }
     }
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ab91f5e13f26..9b785bf31c9a 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -601,7 +601,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
         SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
         if( SfxStyleFamily::Char == m_nFamily )
         {
-            ::ConvertAttrGenToChar(aTmpSet, m_xTmp->GetItemSet(), CONV_ATTR_STD);
+            ::ConvertAttrGenToChar(aTmpSet, m_xTmp->GetItemSet());
         }
 
         m_xTmp->SetItemSet( aTmpSet );
@@ -784,7 +784,7 @@ void SwDocShell::Edit(
     }
     else if( SfxStyleFamily::Char == nFamily )
     {
-        ::ConvertAttrCharToGen(xTmp->GetItemSet(), CONV_ATTR_STD);
+        ::ConvertAttrCharToGen(xTmp->GetItemSet());
     }
 
     if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily)
@@ -880,7 +880,7 @@ void SwDocShell::Edit(
             ::SfxToSwPageDescAttr( *GetWrtShell(), xTmp->GetItemSet() );
         else
         {
-            ::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet(), CONV_ATTR_STD);
+            ::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet());
         }
         if(SfxStyleFamily::Page == nFamily)
             m_pView->InvalidateRulerPos();
diff --git a/sw/source/uibase/inc/uitool.hxx b/sw/source/uibase/inc/uitool.hxx
index 932c57ec0638..ec42b067593f 100644
--- a/sw/source/uibase/inc/uitool.hxx
+++ b/sw/source/uibase/inc/uitool.hxx
@@ -43,17 +43,12 @@ SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
 // fill BoxInfo attribute
 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
 
-// Modes for attribute conversion
-#define CONV_ATTR_STD    1  // Standard character dialog
-#define CONV_ATTR_ENV    2  // Character dialog opened from envelope dialog
-
 /**
  * Convert character specific attributes to general ones used by tab pages.
  *
  * @param[in,out]   rSet    the set in which character attributes are stored
- * @param[in]       nMode   specify the dialog which will be called after conversion
 **/
-SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode);
+SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet);
 
 /**
  * Convert general attributes to the corresponding character attributes.
@@ -61,9 +56,8 @@ SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode);
  *
  * @param[in,out]   rSet    the set in which character attributes are stored
  * @param[in]       rOrigSet    original itemset used as input for the dialog
- * @param[in]       nMode   specify the dialog which was called before
 **/
-SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, const sal_uInt8 nMode);
+SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet);
 
 // SfxItemSets <-> PageDesc
 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 839326e70c34..4bf74057082c 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -164,7 +164,7 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const
     }
     pCoreSet->Put(SfxUInt16Item(SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, rWrtSh.GetScalingOfSelectedText()));
 
-    ::ConvertAttrCharToGen(*pCoreSet, CONV_ATTR_STD);
+    ::ConvertAttrCharToGen(*pCoreSet);
 
     // Setting the BoxInfo
     ::PrepareBoxInfo(*pCoreSet, rWrtSh);
@@ -221,7 +221,7 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const
 static void sw_CharDialogResult(const SfxItemSet* pSet, SwWrtShell &rWrtSh, std::shared_ptr<SfxItemSet> pCoreSet, bool bSel, bool bSelectionPut, SfxRequest *pReq)
 {
     SfxItemSet aTmpSet( *pSet );
-    ::ConvertAttrGenToChar(aTmpSet, *pCoreSet, CONV_ATTR_STD);
+    ::ConvertAttrGenToChar(aTmpSet, *pCoreSet);
 
     const SfxPoolItem* pSelectionItem;
     bool bInsert = false;
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index c8a8bfd49eca..04a175077474 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -122,7 +122,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
     rSet.Put(aBoxInfo);
 }
 
-void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
+void ConvertAttrCharToGen(SfxItemSet& rSet)
 {
     // Background / highlight
     {
@@ -139,79 +139,43 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
         }
     }
 
-    if( nMode == CONV_ATTR_STD )
-    {
-        // Border
-        const SfxPoolItem *pTmpItem;
-        if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BOX, true, &pTmpItem ) )
-        {
-            SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) );
-            aTmpBox.SetWhich( RES_BOX );
-            rSet.Put( aTmpBox );
-        }
-        else
-            rSet.ClearItem(RES_BOX);
-
-        // Border shadow
-        if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_SHADOW, false, &pTmpItem ) )
-        {
-            SvxShadowItem aTmpShadow( *static_cast<const SvxShadowItem*>(pTmpItem) );
-            aTmpShadow.SetWhich( RES_SHADOW );
-            rSet.Put( aTmpShadow );
-        }
-        else
-            rSet.ClearItem( RES_SHADOW );
-    }
+    // Tell dialogs to use character-specific slots/whichIds
+    std::unique_ptr<SfxGrabBagItem> pGrabBag;
+    const SfxPoolItem *pTmpItem;
+    if (SfxItemState::SET == rSet.GetItemState(RES_CHRATR_GRABBAG, false, &pTmpItem))
+        pGrabBag.reset(static_cast<SfxGrabBagItem*>(pTmpItem->Clone()));
+    else
+        pGrabBag.reset(new SfxGrabBagItem(RES_CHRATR_GRABBAG));
+    pGrabBag->GetGrabBag()["DialogUseCharAttr"] <<= true;
+    rSet.Put(*pGrabBag);
 }
 
-void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, const sal_uInt8 nMode)
+void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet)
 {
     // Background / highlighting
+    const SfxPoolItem *pTmpItem;
+    if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) )
     {
-        const SfxPoolItem *pTmpItem;
-        if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) )
-        {
-            // Highlight is an MS specific thing, so remove it at the first time when LO modifies
-            // this part of the imported document.
-            rSet.Put( SvxBrushItem(RES_CHRATR_HIGHLIGHT) );
+        // Highlight is an MS specific thing, so remove it at the first time when LO modifies
+        // this part of the imported document.
+        rSet.Put( SvxBrushItem(RES_CHRATR_HIGHLIGHT) );
 
-            // Remove shading marker
-            if( SfxItemState::SET == rOrigSet.GetItemState( RES_CHRATR_GRABBAG, false, &pTmpItem ) )
+        // Remove shading marker
+        if( SfxItemState::SET == rOrigSet.GetItemState( RES_CHRATR_GRABBAG, false, &pTmpItem ) )
+        {
+            SfxGrabBagItem aGrabBag(*static_cast<const SfxGrabBagItem*>(pTmpItem));
+            std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
+            auto aIterator = rMap.find("CharShadingMarker");
+            if( aIterator != rMap.end() )
             {
-                SfxGrabBagItem aGrabBag(*static_cast<const SfxGrabBagItem*>(pTmpItem));
-                std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
-                auto aIterator = rMap.find("CharShadingMarker");
-                if( aIterator != rMap.end() )
-                {
-                    aIterator->second <<= false;
-                }
-                rSet.Put( aGrabBag );
+                aIterator->second <<= false;
             }
+            // Remove temporary GrabBag entry before writing to destination set
+            rMap.erase("DialogUseCharAttr");
+            rSet.Put( aGrabBag );
         }
-        rSet.ClearItem( RES_BACKGROUND );
-    }
-
-    if( nMode == CONV_ATTR_STD )
-    {
-        // Border
-        const SfxPoolItem *pTmpItem;
-        if( SfxItemState::SET == rSet.GetItemState( RES_BOX, false, &pTmpItem ) )
-        {
-            SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) );
-            aTmpBox.SetWhich( RES_CHRATR_BOX );
-            rSet.Put( aTmpBox );
-        }
-        rSet.ClearItem( RES_BOX );
-
-        // Border shadow
-        if( SfxItemState::SET == rSet.GetItemState( RES_SHADOW, false, &pTmpItem ) )
-        {
-            SvxShadowItem aTmpShadow( *static_cast<const SvxShadowItem*>(pTmpItem) );
-            aTmpShadow.SetWhich( RES_CHRATR_SHADOW );
-            rSet.Put( aTmpShadow );
-        }
-        rSet.ClearItem( RES_SHADOW );
     }
+    rSet.ClearItem( RES_BACKGROUND );
 }
 
 // Fill header footer


More information about the Libreoffice-commits mailing list