summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/app/docst.cxx6
-rw-r--r--sw/source/uibase/inc/uitool.hxx6
-rw-r--r--sw/source/uibase/utlui/uitool.cxx11
3 files changed, 19 insertions, 4 deletions
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index b19c7df81ddd..f61a05d4dc10 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -576,6 +576,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
if( SfxStyleFamily::Para == m_nFamily )
{
SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
+ ::ConvertAttrGenToChar(aSet, m_xTmp->GetItemSet(), /*bIsPara=*/true);
::SfxToSwPageDescAttr( *pWrtShell, aSet );
// reset indent attributes at paragraph style, if a list style
// will be applied and no indent attributes will be applied.
@@ -849,6 +850,8 @@ void SwDocShell::Edit(
::SwToSfxPageDescAttr( rSet );
// merge list level indent attributes into the item set if needed
xTmp->MergeIndentAttrsOfListStyle( rSet );
+
+ ::ConvertAttrCharToGen(xTmp->GetItemSet(), /*bIsPara=*/true);
}
else if( SfxStyleFamily::Char == nFamily )
{
@@ -1006,7 +1009,10 @@ void SwDocShell::Edit(
GetWrtShell()->StartAllAction();
if( SfxStyleFamily::Para == nFamily )
+ {
::SfxToSwPageDescAttr( *GetWrtShell(), xTmp->GetItemSet() );
+ ::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet(), /*bIsPara=*/true);
+ }
else
{
::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet());
diff --git a/sw/source/uibase/inc/uitool.hxx b/sw/source/uibase/inc/uitool.hxx
index ac782d806d28..ba8bf7093d54 100644
--- a/sw/source/uibase/inc/uitool.hxx
+++ b/sw/source/uibase/inc/uitool.hxx
@@ -44,8 +44,9 @@ SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
* 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] bIsPara is called by a paragraph style
**/
-SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet);
+SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet, bool bPara = false);
/**
* Convert general attributes to the corresponding character attributes.
@@ -53,8 +54,9 @@ SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet& rSet);
*
* @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] bIsPara is called by a paragraph style
**/
-SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet);
+SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, bool bPara = false);
/**
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index f8871b8f3c28..c55acb7241f0 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -101,7 +101,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
rSet.Put(*aBoxInfo);
}
-void ConvertAttrCharToGen(SfxItemSet& rSet)
+void ConvertAttrCharToGen(SfxItemSet& rSet, bool bIsPara)
{
// Background / highlight
{
@@ -118,6 +118,9 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
}
}
+ if ( bIsPara )
+ return;
+
// Tell dialogs to use character-specific slots/whichIds
// tdf#126684: We use RES_PARATR_GRABBAG, because RES_CHRATR_GRABBAG may be overwritten later in
// SwDocStyleSheet::GetItemSet when applying attributes from char format
@@ -135,7 +138,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet)
rSet.Put(aGrabBag);
}
-void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet)
+void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, bool bIsPara)
{
// Background / highlighting
const SfxPoolItem *pTmpItem;
@@ -158,6 +161,10 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet)
rSet.Put( aGrabBag );
}
}
+
+ if ( bIsPara )
+ return;
+
rSet.ClearItem( RES_BACKGROUND );
if (SfxItemState::SET == rOrigSet.GetItemState(RES_PARATR_GRABBAG, false, &pTmpItem))