summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/inc/backgrnd.hxx5
-rw-r--r--cui/source/tabpages/backgrnd.cxx11
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx12
4 files changed, 24 insertions, 6 deletions
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 88131fa61b80..e25b2043cbc5 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -26,6 +26,8 @@
#include <editeng/brushitem.hxx>
#include <memory>
+#include "cuitabarea.hxx"
+
class BackgroundPreviewImpl;
class SvxOpenGraphicDialog;
struct SvxBackgroundTable_Impl;
@@ -139,11 +141,10 @@ private:
DECL_LINK( TblDestinationHdl_Impl, ListBox&, void );
};
-#include "cuitabarea.hxx"
-
class SvxBkgTabPage : public SvxAreaTabPage
{
VclPtr<ListBox> m_pTblLBox;
+ bool bHighlighting : 1;
public:
using SvxAreaTabPage::DeactivatePage;
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 6ef959108360..448599bebb2f 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -53,6 +53,8 @@
#include <vcl/GraphicObject.hxx>
#include <comphelper/lok.hxx>
+#include <svx/unobrushitemhelper.hxx>
+
using namespace css;
// table background
@@ -1442,11 +1444,10 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
}
}
-#include <svx/unobrushitemhelper.hxx>
-
SvxBkgTabPage::SvxBkgTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
SvxAreaTabPage( pParent, rInAttrs ),
- m_pTblLBox(nullptr)
+ m_pTblLBox(nullptr),
+ bHighlighting(false)
{
VclPtr<vcl::Window> pBtn;
get(pBtn, "btngradient"); pBtn->Hide();
@@ -1516,6 +1517,8 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
break;
}
}
+ else if ( bHighlighting )
+ nSlot = SID_ATTR_BRUSH_CHAR;
sal_uInt16 nWhich = GetWhich(nSlot);
@@ -1568,6 +1571,8 @@ void SvxBkgTabPage::PageCreated(const SfxAllItemSet& aSet)
m_pTblLBox->SelectEntryPos(0);
m_pTblLBox->Show();
}
+ else if (nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)
+ bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING);
}
SvxAreaTabPage::PageCreated( aSet );
}
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index c0c70d3743cc..7f7007d732ab 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -76,7 +76,7 @@ SwCharDlg::SwCharDlg(vcl::Window* pParent, SwView& rVw, const SfxItemSet& rCoreS
m_nCharPosId = AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr );
m_nCharTwoId = AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), nullptr );
m_nCharUrlId = AddTabPage("hyperlink", SwCharURLPage::Create, nullptr);
- m_nCharBgdId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr );
+ m_nCharBgdId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), nullptr );
m_nCharBrdId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), nullptr );
SvtCJKOptions aCJKOptions;
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index cac6f2f6363f..65f4b25ce6d2 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -120,6 +120,9 @@
#include <numrule.hxx>
#include <memory>
+#include <svx/xattr.hxx>
+#include <svx/unobrushitemhelper.hxx>
+
using namespace ::com::sun::star;
using namespace com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -138,6 +141,7 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const
RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_BACKGROUND, RES_SHADOW,
+ XATTR_FILLSTYLE, XATTR_FILLCOLOR,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
SID_HTML_MODE, SID_HTML_MODE,
SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,
@@ -174,6 +178,10 @@ void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, const
VclPtr<SfxAbstractTabDialog> pDlg;
if ( bUseDialog && GetActiveView() )
{
+ sal_uInt16 nWhich = rWrtSh.GetView().GetPool().GetWhich( SID_ATTR_BRUSH_CHAR );
+ SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(pCoreSet->Get(nWhich)));
+ setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, *pCoreSet);
+
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
@@ -224,6 +232,10 @@ static void sw_CharDialogResult(const SfxItemSet* pSet, SwWrtShell &rWrtSh, std:
SfxItemSet aTmpSet( *pSet );
::ConvertAttrGenToChar(aTmpSet, *pCoreSet);
+ // Clear these to prevent paragraph background being set.
+ aTmpSet.ClearItem( rWrtSh.GetView().GetPool().GetWhich( XATTR_FILLSTYLE ) );
+ aTmpSet.ClearItem( rWrtSh.GetView().GetPool().GetWhich( XATTR_FILLCOLOR ) );
+
const SfxPoolItem* pSelectionItem;
bool bInsert = false;
sal_Int32 nInsert = 0;