Kaydet (Commit) cac80cca authored tarafından Jim Raykowski's avatar Jim Raykowski Kaydeden (comit) Samuel Mehrbrodt

tdf#105225 A character highlighting tab page based on the area tab page

Change-Id: Icd76af14129ff742c77d7f19582c3cbc0520525e
Reviewed-on: https://gerrit.libreoffice.org/48737Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 24a57e2b
......@@ -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;
......
......@@ -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 );
}
......
......@@ -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;
......
......@@ -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;
......
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