summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-01 14:57:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-02 17:20:38 +0200
commit0895c26b7761215e92eef7b3fbf384982ac01eeb (patch)
tree92b1d9bf23a942cfa4a7abd000b98bbbc9f301d3
parentd58fef4623908a436e7d1af42e4ba71f695be4ee (diff)
weld SvxNumOptionsTabPage
Change-Id: Ie2ae18b1722e91996887162b4a8ff02d2d812341 Reviewed-on: https://gerrit.libreoffice.org/61228 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/inc/cuitabline.hxx1
-rw-r--r--cui/source/inc/numpages.hxx131
-rw-r--r--cui/source/tabpages/numpages.cxx703
-rw-r--r--cui/source/tabpages/tpline.cxx6
-rw-r--r--cui/uiconfig/ui/numberingoptionspage.ui158
-rw-r--r--include/svx/colorbox.hxx8
-rw-r--r--vcl/source/app/salvtables.cxx10
7 files changed, 448 insertions, 569 deletions
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 53430d0967ad..9a88e89038f2 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -172,6 +172,7 @@ private:
DECL_LINK(GraphicHdl_Impl, const OString&, void);
void MenuCreate();
DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void);
+ DECL_LINK(MenuCreateHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(RatioHdl_Impl, weld::ToggleButton&, void);
DECL_LINK(ClickInvisibleHdl_Impl, weld::ComboBox&, void);
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 05cfb40a8e77..67f6a37ef782 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -37,31 +37,13 @@
#define MN_GALLERY_ENTRY 100
+class ColorListBox;
class NumValueSet;
-class SvxColorListBox;
class SvxNumRule;
class SvxBmpNumValueSet;
class SvxBrushItem;
class ValueSet;
-class SvxNumberingPreview : public vcl::Window
-{
- const SvxNumRule* pActNum;
- vcl::Font aStdFont;
- sal_uInt16 nActLevel;
-
- protected:
- virtual void Paint( vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect ) override;
-
- public:
- SvxNumberingPreview(vcl::Window* pParent, WinBits nWinBits);
-
- void SetNumRule(const SvxNumRule* pNum)
- {pActNum = pNum; Invalidate();};
- void SetLevel(sal_uInt16 nSet) {nActLevel = nSet;}
-
-};
-
namespace cui {
class NumberingPreview : public weld::CustomWidgetController
@@ -261,43 +243,6 @@ class SvxNumOptionsTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- VclPtr<ListBox> m_pLevelLB;
-
- VclPtr<ListBox> m_pFmtLB;
-
- VclPtr<FixedText> m_pSeparatorFT;
- VclPtr<FixedText> m_pPrefixFT;
- VclPtr<Edit> m_pPrefixED;
- VclPtr<FixedText> m_pSuffixFT;
- VclPtr<Edit> m_pSuffixED;
- VclPtr<FixedText> m_pCharFmtFT;
- VclPtr<ListBox> m_pCharFmtLB;
- VclPtr<FixedText> m_pBulColorFT;
- VclPtr<SvxColorListBox> m_pBulColLB;
- VclPtr<FixedText> m_pBulRelSizeFT;
- VclPtr<MetricField> m_pBulRelSizeMF;
- VclPtr<FixedText> m_pAllLevelFT;
- VclPtr<NumericField> m_pAllLevelNF;
- VclPtr<FixedText> m_pStartFT;
- VclPtr<NumericField> m_pStartED;
- VclPtr<FixedText> m_pBulletFT;
- VclPtr<PushButton> m_pBulletPB;
- VclPtr<FixedText> m_pBitmapFT;
- VclPtr<MenuButton> m_pBitmapMB;
- sal_uInt16 m_nGalleryId;
- VclPtr<FixedText> m_pWidthFT;
- VclPtr<MetricField> m_pWidthMF;
- VclPtr<FixedText> m_pHeightFT;
- VclPtr<MetricField> m_pHeightMF;
- VclPtr<CheckBox> m_pRatioCB;
- VclPtr<FixedText> m_pOrientFT;
- VclPtr<ListBox> m_pOrientLB;
-
- VclPtr<VclContainer> m_pAllLevelsFrame;
- VclPtr<CheckBox> m_pSameLevelCB;
-
- VclPtr<SvxNumberingPreview> m_pPreviewWIN;
-
OUString m_sNumCharFmtName;
OUString m_sBulletCharFormatName;
@@ -313,7 +258,6 @@ class SvxNumOptionsTabPage : public SfxTabPage
bool bPreset : 1;
bool bAutomaticCharStyles: 1;
bool bHTMLMode : 1;
- bool bMenuButtonInitialized : 1;
std::vector<OUString> aGrfNames;
vcl::Font aActBulletFont;
@@ -323,6 +267,40 @@ class SvxNumOptionsTabPage : public SfxTabPage
sal_uInt16 nNumItemId;
MapUnit eCoreUnit;
+ cui::NumberingPreview m_aPreviewWIN;
+ std::unique_ptr<weld::TreeView> m_xLevelLB;
+ std::unique_ptr<weld::ComboBox> m_xFmtLB;
+ std::unique_ptr<weld::Label> m_xSeparatorFT;
+ std::unique_ptr<weld::Label> m_xPrefixFT;
+ std::unique_ptr<weld::Entry> m_xPrefixED;
+ std::unique_ptr<weld::Label> m_xSuffixFT;
+ std::unique_ptr<weld::Entry> m_xSuffixED;
+ std::unique_ptr<weld::Label> m_xCharFmtFT;
+ std::unique_ptr<weld::ComboBox> m_xCharFmtLB;
+ std::unique_ptr<weld::Label> m_xBulColorFT;
+ std::unique_ptr<ColorListBox> m_xBulColLB;
+ std::unique_ptr<weld::Label> m_xBulRelSizeFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xBulRelSizeMF;
+ std::unique_ptr<weld::Label> m_xAllLevelFT;
+ std::unique_ptr<weld::SpinButton> m_xAllLevelNF;
+ std::unique_ptr<weld::Label> m_xStartFT;
+ std::unique_ptr<weld::SpinButton> m_xStartED;
+ std::unique_ptr<weld::Label> m_xBulletFT;
+ std::unique_ptr<weld::Button> m_xBulletPB;
+ std::unique_ptr<weld::Label> m_xBitmapFT;
+ std::unique_ptr<weld::MenuButton> m_xBitmapMB;
+ std::unique_ptr<weld::Label> m_xWidthFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xWidthMF;
+ std::unique_ptr<weld::Label> m_xHeightFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xHeightMF;
+ std::unique_ptr<weld::CheckButton> m_xRatioCB;
+ std::unique_ptr<weld::Label> m_xOrientFT;
+ std::unique_ptr<weld::ComboBox> m_xOrientLB;
+ std::unique_ptr<weld::Widget> m_xAllLevelsFrame;
+ std::unique_ptr<weld::Menu> m_xGalleryMenu;
+ std::unique_ptr<weld::CheckButton> m_xSameLevelCB;
+ std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
+
void InitControls();
/** To switch between the numbering type
0 - Number;
@@ -331,28 +309,27 @@ class SvxNumOptionsTabPage : public SfxTabPage
void SwitchNumberType( sal_uInt8 nType );
void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
- DECL_LINK( NumberTypeSelectHdl_Impl, ListBox&, void );
- DECL_LINK( LevelHdl_Impl, ListBox&, void );
- DECL_LINK( PopupActivateHdl_Impl, MenuButton *, void );
- DECL_LINK( GraphicHdl_Impl, MenuButton *, void );
- DECL_LINK( BulletHdl_Impl, Button*, void);
- DECL_LINK( SizeHdl_Impl, Edit&, void );
- DECL_LINK( RatioHdl_Impl, Button*, void );
- DECL_LINK( CharFmtHdl_Impl, ListBox&, void );
- DECL_LINK( EditModifyHdl_Impl, Edit&, void );
- DECL_LINK( EditListBoxHdl_Impl, ListBox&, void );
- DECL_LINK( AllLevelHdl_Impl, Edit&, void );
- DECL_LINK( OrientHdl_Impl, ListBox&, void );
- DECL_LINK( SameLevelHdl_Impl, Button*, void );
- DECL_LINK( BulColorHdl_Impl, SvxColorListBox&, void );
- DECL_LINK( BulRelSizeHdl_Impl, Edit&, void);
- DECL_LINK( PreviewInvalidateHdl_Impl, Timer *, void);
- void EditModifyHdl_Impl(Edit*);
+ DECL_LINK(NumberTypeSelectHdl_Impl, weld::ComboBox&, void);
+ DECL_LINK(LevelHdl_Impl, weld::TreeView&, void);
+ DECL_LINK(PopupActivateHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(GraphicHdl_Impl, const OString&, void);
+ DECL_LINK(BulletHdl_Impl, weld::Button&, void);
+ DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void);
+ DECL_LINK(RatioHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(CharFmtHdl_Impl, weld::ComboBox&, void);
+ DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void);
+ DECL_LINK(EditListBoxHdl_Impl, weld::ComboBox&, void);
+ DECL_LINK(AllLevelHdl_Impl, weld::SpinButton&, void);
+ DECL_LINK(OrientHdl_Impl, weld::ComboBox&, void);
+ DECL_LINK(SameLevelHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(BulColorHdl_Impl, ColorListBox&, void);
+ DECL_LINK(BulRelSizeHdl_Impl, weld::MetricSpinButton&, void);
+ DECL_LINK(PreviewInvalidateHdl_Impl, Timer*, void);
+ void EditModifyHdl_Impl(weld::Entry*);
public:
- SvxNumOptionsTabPage(vcl::Window* pParent,
- const SfxItemSet& rSet);
- virtual ~SvxNumOptionsTabPage() override;
+ SvxNumOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
+ virtual ~SvxNumOptionsTabPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent,
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index b65e195f863d..4c3b5433ff2b 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -950,7 +950,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl, SvtValueSet*, void)
IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, void)
{
- sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, GetFrameWeld());
+ sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, GetDialogFrameWeld());
aFileDialog.SetTitle(CuiResId(RID_SVXSTR_ADD_IMAGE));
if ( aFileDialog.Execute() != ERRCODE_NONE )
return;
@@ -1046,112 +1046,90 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, voi
}
// tabpage numbering options
-SvxNumOptionsTabPage::SvxNumOptionsTabPage(vcl::Window* pParent,
+SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
const SfxItemSet& rSet)
- : SfxTabPage(pParent, "NumberingOptionsPage", "cui/ui/numberingoptionspage.ui", &rSet)
+ : SfxTabPage(pParent, "cui/ui/numberingoptionspage.ui", "NumberingOptionsPage", &rSet)
, bLastWidthModified(false)
, bModified(false)
, bPreset(false)
, bAutomaticCharStyles(true)
, bHTMLMode(false)
- , bMenuButtonInitialized(false)
, nBullet(0xff)
, nActNumLvl(1)
, nNumItemId(SID_ATTR_NUMBERING_RULE)
+ , m_xLevelLB(m_xBuilder->weld_tree_view("levellb"))
+ , m_xFmtLB(m_xBuilder->weld_combo_box("numfmtlb"))
+ , m_xSeparatorFT(m_xBuilder->weld_label("separator"))
+ , m_xPrefixFT(m_xBuilder->weld_label("prefixft"))
+ , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
+ , m_xSuffixFT(m_xBuilder->weld_label("suffixft"))
+ , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
+ , m_xCharFmtFT(m_xBuilder->weld_label("charstyleft"))
+ , m_xCharFmtLB(m_xBuilder->weld_combo_box("charstyle"))
+ , m_xBulColorFT(m_xBuilder->weld_label("colorft"))
+ , m_xBulColLB(new ColorListBox(m_xBuilder->weld_menu_button("color"), pParent.GetFrameWeld()))
+ , m_xBulRelSizeFT(m_xBuilder->weld_label("relsizeft"))
+ , m_xBulRelSizeMF(m_xBuilder->weld_metric_spin_button("relsize", FUNIT_PERCENT))
+ , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
+ , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevels"))
+ , m_xStartFT(m_xBuilder->weld_label("startatft"))
+ , m_xStartED(m_xBuilder->weld_spin_button("startat"))
+ , m_xBulletFT(m_xBuilder->weld_label("bulletft"))
+ , m_xBulletPB(m_xBuilder->weld_button("bullet"))
+ , m_xBitmapFT(m_xBuilder->weld_label("bitmapft"))
+ , m_xBitmapMB(m_xBuilder->weld_menu_button("bitmap"))
+ , m_xWidthFT(m_xBuilder->weld_label("widthft"))
+ , m_xWidthMF(m_xBuilder->weld_metric_spin_button("widthmf", FUNIT_CM))
+ , m_xHeightFT(m_xBuilder->weld_label("heightft"))
+ , m_xHeightMF(m_xBuilder->weld_metric_spin_button("heightmf", FUNIT_CM))
+ , m_xRatioCB(m_xBuilder->weld_check_button("keepratio"))
+ , m_xOrientFT(m_xBuilder->weld_label("orientft"))
+ , m_xOrientLB(m_xBuilder->weld_combo_box("orientlb"))
+ , m_xAllLevelsFrame(m_xBuilder->weld_widget("levelsframe"))
+ , m_xSameLevelCB(m_xBuilder->weld_check_button("allsame"))
+ , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
{
- get(m_pLevelLB, "levellb");
- get(m_pFmtLB, "numfmtlb");
-
- get(m_pSeparatorFT, "separator");
- get(m_pPrefixFT, "prefixft");
- get(m_pPrefixED, "prefix");
- get(m_pSuffixFT, "suffixft");
- get(m_pSuffixED, "suffix");
-
- get(m_pCharFmtFT, "charstyleft");
- get(m_pCharFmtLB, "charstyle");
-
- get(m_pBulColorFT, "colorft");
- get(m_pBulColLB, "color");
- m_pBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
-
- get(m_pBulRelSizeFT, "relsizeft");
- get(m_pBulRelSizeMF, "relsize");
- m_pBulRelSizeMF->SetMin(SVX_NUM_REL_SIZE_MIN);
- m_pBulRelSizeMF->SetSpinSize(5);
-
- get(m_pAllLevelFT, "sublevelsft");
- get(m_pAllLevelNF, "sublevels");
-
- get(m_pStartFT, "startatft");
- get(m_pStartED, "startat");
-
- get(m_pBulletFT, "bulletft");
- get(m_pBulletPB, "bullet");
- get(m_pBitmapFT, "bitmapft");
- get(m_pBitmapMB, "bitmap");
-
- get(m_pWidthFT, "widthft");
- get(m_pWidthMF, "widthmf");
- get(m_pHeightFT, "heightft");
- get(m_pHeightMF, "heightmf");
-
- get(m_pRatioCB, "keepratio");
-
- get(m_pOrientFT, "orientft");
- get(m_pOrientLB, "orientlb");
-
- get(m_pAllLevelsFrame, "levelsframe");
- get(m_pSameLevelCB, "allsame");
-
- get(m_pPreviewWIN, "preview");
-
- m_pPreviewWIN->SetBackground(Wallpaper(COL_TRANSPARENT));
+ m_xBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
+ m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FUNIT_PERCENT);
+ m_xBulRelSizeMF->set_increments(5, 50, FUNIT_PERCENT);
SetExchangeSupport();
aActBulletFont = lcl_GetDefaultBulletFont();
- m_pBulletPB->SetClickHdl(LINK(this, SvxNumOptionsTabPage, BulletHdl_Impl));
- m_pFmtLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
- m_pBitmapMB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
- m_pBitmapMB->SetActivateHdl(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
- m_pLevelLB->EnableMultiSelection(true);
- m_pLevelLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
- m_pCharFmtLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
- m_pWidthMF->SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
- m_pHeightMF->SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
- m_pRatioCB->SetClickHdl(LINK(this, SvxNumOptionsTabPage, RatioHdl_Impl));
- m_pStartED->SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- m_pPrefixED->SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- m_pSuffixED->SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- m_pAllLevelNF->SetModifyHdl(LINK(this,SvxNumOptionsTabPage, AllLevelHdl_Impl));
- m_pOrientLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, OrientHdl_Impl));
- m_pSameLevelCB->SetClickHdl(LINK(this, SvxNumOptionsTabPage, SameLevelHdl_Impl));
- m_pBulRelSizeMF->SetModifyHdl(LINK(this,SvxNumOptionsTabPage, BulRelSizeHdl_Impl));
- m_pBulColLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, BulColorHdl_Impl));
+ m_xBulletPB->connect_clicked(LINK(this, SvxNumOptionsTabPage, BulletHdl_Impl));
+ m_xFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
+ m_xBitmapMB->connect_selected(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
+ m_xBitmapMB->connect_toggled(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
+ m_xLevelLB->set_selection_mode(true);
+ m_xLevelLB->connect_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
+ m_xCharFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
+ m_xWidthMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
+ m_xHeightMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
+ m_xRatioCB->connect_toggled(LINK(this, SvxNumOptionsTabPage, RatioHdl_Impl));
+ m_xStartED->connect_changed(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
+ m_xPrefixED->connect_changed(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
+ m_xSuffixED->connect_changed(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
+ m_xAllLevelNF->connect_value_changed(LINK(this,SvxNumOptionsTabPage, AllLevelHdl_Impl));
+ m_xOrientLB->connect_changed(LINK(this, SvxNumOptionsTabPage, OrientHdl_Impl));
+ m_xSameLevelCB->connect_toggled(LINK(this, SvxNumOptionsTabPage, SameLevelHdl_Impl));
+ m_xBulRelSizeMF->connect_value_changed(LINK(this,SvxNumOptionsTabPage, BulRelSizeHdl_Impl));
+ m_xBulColLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, BulColorHdl_Impl));
aInvalidateTimer.SetInvokeHandler(LINK(this, SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl));
aInvalidateTimer.SetTimeout(50);
- Menu *pBitmapMenu = m_pBitmapMB->GetPopupMenu();
- m_nGalleryId = pBitmapMenu->GetItemId("gallery");
- assert(m_nGalleryId != MENU_ITEM_NOTFOUND);
- VclPtrInstance<PopupMenu> pPopup;
- pBitmapMenu->SetPopupMenu(m_nGalleryId, pPopup);
-
eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
// Fill ListBox with predefined / translated numbering types.
sal_uInt32 nCount = SvxNumberingTypeTable::Count();
for (sal_uInt32 i = 0; i < nCount; ++i)
{
- sal_Int32 nPos = m_pFmtLB->InsertEntry(SvxNumberingTypeTable::GetString(i));
- m_pFmtLB->SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_uIntPtr>(SvxNumberingTypeTable::GetValue(i))));
+ m_xFmtLB->append(OUString::number(SvxNumberingTypeTable::GetValue(i)), SvxNumberingTypeTable::GetString(i));
}
// Get advanced numbering types from the component.
// Watch out for the ugly
// 136 == 0x88 == SVX_NUM_BITMAP|0x80 == SVX_NUM_BITMAP|LINK_TOKEN
// to not remove that.
- SvxNumOptionsTabPageHelper::GetI18nNumbering( *m_pFmtLB, (SVX_NUM_BITMAP | LINK_TOKEN));
+ SvxNumOptionsTabPageHelper::GetI18nNumbering( *m_xFmtLB, (SVX_NUM_BITMAP | LINK_TOKEN));
}
SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
@@ -1161,39 +1139,10 @@ SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
void SvxNumOptionsTabPage::dispose()
{
+ m_xPreviewWIN.reset();
+ m_xBulColLB.reset();
pActNum.reset();
pSaveNum.reset();
- m_pLevelLB.clear();
- m_pFmtLB.clear();
- m_pSeparatorFT.clear();
- m_pPrefixFT.clear();
- m_pPrefixED.clear();
- m_pSuffixFT.clear();
- m_pSuffixED.clear();
- m_pCharFmtFT.clear();
- m_pCharFmtLB.clear();
- m_pBulColorFT.clear();
- m_pBulColLB.clear();
- m_pBulRelSizeFT.clear();
- m_pBulRelSizeMF.clear();
- m_pAllLevelFT.clear();
- m_pAllLevelNF.clear();
- m_pStartFT.clear();
- m_pStartED.clear();
- m_pBulletFT.clear();
- m_pBulletPB.clear();
- m_pBitmapFT.clear();
- m_pBitmapMB.clear();
- m_pWidthFT.clear();
- m_pWidthMF.clear();
- m_pHeightFT.clear();
- m_pHeightMF.clear();
- m_pRatioCB.clear();
- m_pOrientFT.clear();
- m_pOrientLB.clear();
- m_pAllLevelsFrame.clear();
- m_pSameLevelCB.clear();
- m_pPreviewWIN.clear();
SfxTabPage::dispose();
}
@@ -1201,17 +1150,17 @@ void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
{
if(eMetric == FUNIT_MM)
{
- m_pWidthMF->SetDecimalDigits(1);
- m_pHeightMF->SetDecimalDigits(1);
+ m_xWidthMF->set_digits(1);
+ m_xHeightMF->set_digits(1);
}
- m_pWidthMF->SetUnit( eMetric );
- m_pHeightMF->SetUnit( eMetric );
+ m_xWidthMF->set_unit(eMetric);
+ m_xHeightMF->set_unit(eMetric);
}
-VclPtr<SfxTabPage> SvxNumOptionsTabPage::Create( TabPageParent pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumOptionsTabPage::Create(TabPageParent pParent,
+ const SfxItemSet* rAttrSet)
{
- return VclPtr<SvxNumOptionsTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SvxNumOptionsTabPage>::Create(pParent, *rAttrSet);
};
void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -1237,22 +1186,21 @@ void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
{
nActNumLvl = nTmpNumLvl;
sal_uInt16 nMask = 1;
- m_pLevelLB->SetUpdateMode(false);
- m_pLevelLB->SetNoSelection();
- m_pLevelLB->SelectEntryPos( pActNum->GetLevelCount(), nActNumLvl == SAL_MAX_UINT16);
+ if (nActNumLvl == SAL_MAX_UINT16)
+ m_xLevelLB->select(pActNum->GetLevelCount());
if(nActNumLvl != SAL_MAX_UINT16)
+ {
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
if(nActNumLvl & nMask)
- m_pLevelLB->SelectEntryPos( i );
+ m_xLevelLB->select(i);
nMask <<= 1 ;
}
- m_pLevelLB->SetUpdateMode(true);
+ }
*pActNum = *pSaveNum;
InitControls();
}
-
}
DeactivateRC SvxNumOptionsTabPage::DeactivatePage(SfxItemSet * _pSet)
@@ -1295,44 +1243,44 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
// insert levels
- if(!m_pLevelLB->GetEntryCount())
+ if (!m_xLevelLB->n_children())
{
for(sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++)
- m_pLevelLB->InsertEntry( OUString::number(i));
+ m_xLevelLB->append_text(OUString::number(i));
if(pSaveNum->GetLevelCount() > 1)
{
OUString sEntry = "1 - " + OUString::number( pSaveNum->GetLevelCount() );
- m_pLevelLB->InsertEntry(sEntry);
- m_pLevelLB->SelectEntry(sEntry);
+ m_xLevelLB->append_text(sEntry);
+ m_xLevelLB->select_text(sEntry);
}
else
- m_pLevelLB->SelectEntryPos(0);
+ m_xLevelLB->select(0);
}
else
- m_pLevelLB->SelectEntryPos(m_pLevelLB->GetEntryCount() - 1);
+ m_xLevelLB->select(m_xLevelLB->n_children() - 1);
sal_uInt16 nMask = 1;
- m_pLevelLB->SetUpdateMode(false);
- m_pLevelLB->SetNoSelection();
+ m_xLevelLB->unselect_all();
if (nActNumLvl == SAL_MAX_UINT16)
{
- m_pLevelLB->SelectEntryPos( pSaveNum->GetLevelCount() );
+ m_xLevelLB->select( pSaveNum->GetLevelCount() );
}
else
+ {
for(sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++)
{
if(nActNumLvl & nMask)
- m_pLevelLB->SelectEntryPos( i );
+ m_xLevelLB->select( i );
nMask <<= 1 ;
}
- m_pLevelLB->SetUpdateMode(true);
+ }
if(!pActNum)
pActNum.reset( new SvxNumRule(*pSaveNum) );
else if(*pSaveNum != *pActNum)
*pActNum = *pSaveNum;
- m_pPreviewWIN->SetNumRule(pActNum.get());
- m_pSameLevelCB->Check(pActNum->IsContinuousNumbering());
+ m_aPreviewWIN.SetNumRule(pActNum.get());
+ m_xSameLevelCB->set_active(pActNum->IsContinuousNumbering());
SfxObjectShell* pShell;
if ( SfxItemState::SET == rSet->GetItemState( SID_HTML_MODE, false, &pItem )
@@ -1344,61 +1292,60 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
}
bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
- m_pCharFmtFT->Show(bCharFmt);
- m_pCharFmtLB->Show(bCharFmt);
+ m_xCharFmtFT->show(bCharFmt);
+ m_xCharFmtLB->show(bCharFmt);
bool bContinuous = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
bool bAllLevel = bContinuous && !bHTMLMode;
- m_pAllLevelFT->Show(bAllLevel);
- m_pAllLevelNF->Show(bAllLevel);
+ m_xAllLevelFT->show(bAllLevel);
+ m_xAllLevelNF->show(bAllLevel);
- m_pAllLevelsFrame->Show(bContinuous);
+ m_xAllLevelsFrame->show(bContinuous);
// again misusage: in Draw there is numeration only until the bitmap
// without SVX_NUM_NUMBER_NONE
//remove types that are unsupported by Draw/Impress
if(!bContinuous)
{
- sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
+ sal_Int32 nFmtCount = m_xFmtLB->get_count();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1)));
+ sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
(SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData)
- m_pFmtLB->RemoveEntry(i - 1);
+ m_xFmtLB->remove(i - 1);
}
}
//one must be enabled
if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_LINKED_BMP))
{
- sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(SVX_NUM_BITMAP|LINK_TOKEN));
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- m_pFmtLB->RemoveEntry(nPos);
+ auto nPos = m_xFmtLB->find_id(OUString::number(SVX_NUM_BITMAP|LINK_TOKEN));
+ if (nPos != -1)
+ m_xFmtLB->remove(nPos);
}
else if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP))
{
- sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(SVX_NUM_BITMAP));
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- m_pFmtLB->RemoveEntry(nPos);
+ auto nPos = m_xFmtLB->find_id(OUString::number(SVX_NUM_BITMAP));
+ if (nPos != -1)
+ m_xFmtLB->remove(nPos);
}
// MegaHack: because of a not-fixable 'design mistake/error' in Impress
// delete all kinds of numeric enumerations
if(pActNum->IsFeatureSupported(SvxNumRuleFlags::NO_NUMBERS))
{
- sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
+ sal_Int32 nFmtCount = m_xFmtLB->get_count();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1)));
+ sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
- m_pFmtLB->RemoveEntry(i - 1);
+ m_xFmtLB->remove(i - 1);
}
}
InitControls();
bModified = false;
-
}
void SvxNumOptionsTabPage::InitControls()
@@ -1484,66 +1431,66 @@ void SvxNumOptionsTabPage::InitControls()
if(bShowBitmap)
{
if(!bSameVOrient || eFirstOrient == text::VertOrientation::NONE)
- m_pOrientLB->SetNoSelection();
+ m_xOrientLB->set_active(-1);
else
- m_pOrientLB->SelectEntryPos(
+ m_xOrientLB->set_active(
sal::static_int_cast< sal_Int32 >(eFirstOrient - 1));
// no text::VertOrientation::NONE
if(bSameSize)
{
- SetMetricValue(*m_pHeightMF, aFirstSize.Height(), eCoreUnit);
- SetMetricValue(*m_pWidthMF, aFirstSize.Width(), eCoreUnit);
+ SetMetricValue(*m_xHeightMF, aFirstSize.Height(), eCoreUnit);
+ SetMetricValue(*m_xWidthMF, aFirstSize.Width(), eCoreUnit);
}
else
{
- m_pHeightMF->SetText("");
- m_pWidthMF->SetText("");
+ m_xHeightMF->set_text("");
+ m_xWidthMF->set_text("");
}
}
if(bSameType)
{
sal_uInt16 nLBData = nNumberingType;
- m_pFmtLB->SelectEntryPos(m_pFmtLB->GetEntryPos( reinterpret_cast<void*>(sal::static_int_cast<sal_uIntPtr>( nLBData ) )));
+ m_xFmtLB->set_active_id(OUString::number(nLBData));
}
else
- m_pFmtLB->SetNoSelection();
+ m_xFmtLB->set_active(-1);
- m_pAllLevelNF->Enable(nHighestLevel > 0 && !m_pSameLevelCB->IsChecked());
- m_pAllLevelNF->SetMax(nHighestLevel + 1);
+ m_xAllLevelNF->set_sensitive(nHighestLevel > 0 && !m_xSameLevelCB->get_active());
+ m_xAllLevelNF->set_max(nHighestLevel + 1);
if(bAllLevel)
{
- m_pAllLevelNF->SetValue(aNumFmtArr[nLvl]->GetIncludeUpperLevels());
+ m_xAllLevelNF->set_value(aNumFmtArr[nLvl]->GetIncludeUpperLevels());
}
else
{
- m_pAllLevelNF->SetText("");
+ m_xAllLevelNF->set_text("");
}
if(bBullRelSize)
{
if(bSameBulRelSize)
- m_pBulRelSizeMF->SetValue(aNumFmtArr[nLvl]->GetBulletRelSize());
+ m_xBulRelSizeMF->set_value(aNumFmtArr[nLvl]->GetBulletRelSize(), FUNIT_PERCENT);
else
- m_pBulRelSizeMF->SetText("");
+ m_xBulRelSizeMF->set_text("");
}
if(bBullColor)
{
if(bSameBulColor)
- m_pBulColLB->SelectEntry(aNumFmtArr[nLvl]->GetBulletColor());
+ m_xBulColLB->SelectEntry(aNumFmtArr[nLvl]->GetBulletColor());
else
- m_pBulColLB->SetNoSelection();
+ m_xBulColLB->SetNoSelection();
}
switch(nBullet)
{
case SHOW_NUMBERING:
if(bSameStart)
{
- m_pStartED->SetValue(aNumFmtArr[nLvl]->GetStart());
+ m_xStartED->set_value(aNumFmtArr[nLvl]->GetStart());
}
else
- m_pStartED->SetText("");
+ m_xStartED->set_text("");
break;
case SHOW_BULLET:
break;
@@ -1552,26 +1499,26 @@ void SvxNumOptionsTabPage::InitControls()
}
if(bSamePrefix)
- m_pPrefixED->SetText(aNumFmtArr[nLvl]->GetPrefix());
+ m_xPrefixED->set_text(aNumFmtArr[nLvl]->GetPrefix());
else
- m_pPrefixED->SetText("");
+ m_xPrefixED->set_text("");
if(bSameSuffix)
- m_pSuffixED->SetText(aNumFmtArr[nLvl]->GetSuffix());
+ m_xSuffixED->set_text(aNumFmtArr[nLvl]->GetSuffix());
else
- m_pSuffixED->SetText("");
+ m_xSuffixED->set_text("");
if(bSameCharFmt)
{
- if(!sFirstCharFmt.isEmpty())
- m_pCharFmtLB->SelectEntry(sFirstCharFmt);
+ if (!sFirstCharFmt.isEmpty())
+ m_xCharFmtLB->set_active_text(sFirstCharFmt);
else
- m_pCharFmtLB->SelectEntryPos( 0 );
+ m_xCharFmtLB->set_active(0);
}
else
- m_pCharFmtLB->SetNoSelection();
+ m_xCharFmtLB->set_active(-1);
- m_pPreviewWIN->SetLevel(nActNumLvl);
- m_pPreviewWIN->Invalidate();
+ m_aPreviewWIN.SetLevel(nActNumLvl);
+ m_aPreviewWIN.Invalidate();
}
// 0 - Number; 1 - Bullet; 2 - Bitmap
@@ -1584,79 +1531,78 @@ void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType )
bool bBitmap = (nType == SHOW_BITMAP);
bool bEnableBitmap = (nType == SHOW_BITMAP);
bool bNumeric = !(bBitmap||bBullet);
- m_pSeparatorFT->Show(bNumeric);
- m_pPrefixFT->Show(bNumeric);
- m_pPrefixED->Show(bNumeric);
- m_pSuffixFT->Show(bNumeric);
- m_pSuffixED->Show(bNumeric);
+ m_xSeparatorFT->show(bNumeric);
+ m_xPrefixFT->show(bNumeric);
+ m_xPrefixED->show(bNumeric);
+ m_xSuffixFT->show(bNumeric);
+ m_xSuffixED->show(bNumeric);
bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
- m_pCharFmtFT->Show(!bBitmap && bCharFmt);
- m_pCharFmtLB->Show(!bBitmap && bCharFmt);
+ m_xCharFmtFT->show(!bBitmap && bCharFmt);
+ m_xCharFmtLB->show(!bBitmap && bCharFmt);
// this is rather misusage, as there is no own flag
// for complete numeration
bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
bool bAllLevel = bNumeric && bAllLevelFeature && !bHTMLMode;
- m_pAllLevelFT->Show(bAllLevel);
- m_pAllLevelNF->Show(bAllLevel);
+ m_xAllLevelFT->show(bAllLevel);
+ m_xAllLevelNF->show(bAllLevel);
- m_pStartFT->Show(!(bBullet||bBitmap));
- m_pStartED->Show(!(bBullet||bBitmap));
+ m_xStartFT->show(!(bBullet||bBitmap));
+ m_xStartED->show(!(bBullet||bBitmap));
- m_pBulletFT->Show(bBullet);
- m_pBulletPB->Show(bBullet);
+ m_xBulletFT->show(bBullet);
+ m_xBulletPB->show(bBullet);
bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
- m_pBulColorFT->Show(!bBitmap && bBullColor);
- m_pBulColLB->Show(!bBitmap && bBullColor);
+ m_xBulColorFT->show(!bBitmap && bBullColor);
+ m_xBulColLB->show(!bBitmap && bBullColor);
bool bBullResSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
- m_pBulRelSizeFT->Show(!bBitmap && bBullResSize);
- m_pBulRelSizeMF->Show(!bBitmap && bBullResSize);
+ m_xBulRelSizeFT->show(!bBitmap && bBullResSize);
+ m_xBulRelSizeMF->show(!bBitmap && bBullResSize);
- m_pBitmapFT->Show(bBitmap);
- m_pBitmapMB->Show(bBitmap);
+ m_xBitmapFT->show(bBitmap);
+ m_xBitmapMB->show(bBitmap);
- m_pWidthFT->Show(bBitmap);
- m_pWidthMF->Show(bBitmap);
- m_pHeightFT->Show(bBitmap);
- m_pHeightMF->Show(bBitmap);
- m_pRatioCB->Show(bBitmap);
+ m_xWidthFT->show(bBitmap);
+ m_xWidthMF->show(bBitmap);
+ m_xHeightFT->show(bBitmap);
+ m_xHeightMF->show(bBitmap);
+ m_xRatioCB->show(bBitmap);
- m_pOrientFT->Show(bBitmap && bAllLevelFeature);
- m_pOrientLB->Show(bBitmap && bAllLevelFeature);
+ m_xOrientFT->show(bBitmap && bAllLevelFeature);
+ m_xOrientLB->show(bBitmap && bAllLevelFeature);
- m_pWidthFT->Enable(bEnableBitmap);
- m_pWidthMF->Enable(bEnableBitmap);
- m_pHeightFT->Enable(bEnableBitmap);
- m_pHeightMF->Enable(bEnableBitmap);
- m_pRatioCB->Enable(bEnableBitmap);
- m_pOrientFT->Enable(bEnableBitmap);
- m_pOrientLB->Enable(bEnableBitmap);
+ m_xWidthFT->set_sensitive(bEnableBitmap);
+ m_xWidthMF->set_sensitive(bEnableBitmap);
+ m_xHeightFT->set_sensitive(bEnableBitmap);
+ m_xHeightMF->set_sensitive(bEnableBitmap);
+ m_xRatioCB->set_sensitive(bEnableBitmap);
+ m_xOrientFT->set_sensitive(bEnableBitmap);
+ m_xOrientLB->set_sensitive(bEnableBitmap);
}
-IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox&, rBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, LevelHdl_Impl, weld::TreeView&, rBox, void)
{
sal_uInt16 nSaveNumLvl = nActNumLvl;
nActNumLvl = 0;
- if(rBox.IsEntryPosSelected( pActNum->GetLevelCount() ) &&
- (rBox.GetSelectedEntryCount() == 1 || nSaveNumLvl != 0xffff))
+ auto aSelectedRows = rBox.get_selected_rows();
+ if (std::find(aSelectedRows.begin(), aSelectedRows.end(), pActNum->GetLevelCount()) != aSelectedRows.end() &&
+ (aSelectedRows.size() == 1 || nSaveNumLvl != 0xffff))
{
nActNumLvl = 0xFFFF;
- rBox.SetUpdateMode(false);
for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
- rBox.SelectEntryPos( i, false );
- rBox.SetUpdateMode(true);
+ rBox.unselect(i);
}
- else if(rBox.GetSelectedEntryCount())
+ else if (!aSelectedRows.empty())
{
sal_uInt16 nMask = 1;
for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
{
- if(rBox.IsEntryPosSelected( i ))
+ if (std::find(aSelectedRows.begin(), aSelectedRows.end(), i) != aSelectedRows.end())
nActNumLvl |= nMask;
nMask <<= 1;
}
- rBox.SelectEntryPos( pActNum->GetLevelCount(), false );
+ rBox.unselect(pActNum->GetLevelCount());
}
else
{
@@ -1666,7 +1612,7 @@ IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox&, rBox, void )
{
if(nActNumLvl & nMask)
{
- rBox.SelectEntryPos(i);
+ rBox.select(i);
break;
}
nMask <<=1;
@@ -1677,10 +1623,10 @@ IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox&, rBox, void )
IMPL_LINK_NOARG(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, void)
{
- m_pPreviewWIN->Invalidate();
+ m_aPreviewWIN.Invalidate();
}
-IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, AllLevelHdl_Impl, weld::SpinButton&, rBox, void)
{
sal_uInt16 nMask = 1;
for(sal_uInt16 e = 0; e < pActNum->GetLevelCount(); e++)
@@ -1688,7 +1634,7 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void )
if(nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
- aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1))) );
+ aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(rBox.get_value(), int(e + 1))) );
pActNum->SetLevel(e, aNumFmt);
}
nMask <<= 1;
@@ -1696,7 +1642,7 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void )
SetModified();
}
-IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, weld::ComboBox&, rBox, void)
{
OUString sSelectStyle;
bool bShowOrient = false;
@@ -1708,7 +1654,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
// PAGEDESC does not exist
- SvxNumType nNumType = static_cast<SvxNumType>(reinterpret_cast<sal_uLong>(rBox.GetSelectedEntryData()));
+ SvxNumType nNumType = static_cast<SvxNumType>(rBox.get_active_id().toUInt32());
aNumFmt.SetNumberingType(nNumType);
sal_uInt16 nNumberingType = aNumFmt.GetNumberingType();
if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN)))
@@ -1742,8 +1688,8 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void
}
else
{
- aNumFmt.SetPrefix( m_pPrefixED->GetText() );
- aNumFmt.SetSuffix( m_pSuffixED->GetText() );
+ aNumFmt.SetPrefix( m_xPrefixED->get_text() );
+ aNumFmt.SetSuffix( m_xSuffixED->get_text() );
SwitchNumberType(SHOW_NUMBERING);
pActNum->SetLevel(i, aNumFmt);
CheckForStartValue_Impl(nNumberingType);
@@ -1760,37 +1706,37 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void
bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
if(bShowOrient && bAllLevelFeature)
{
- m_pOrientFT->Show();
- m_pOrientLB->Show();
+ m_xOrientFT->show();
+ m_xOrientLB->show();
}
else
{
- m_pOrientFT->Hide();
- m_pOrientLB->Hide();
+ m_xOrientFT->hide();
+ m_xOrientLB->hide();
}
SetModified();
if(!sSelectStyle.isEmpty())
{
- m_pCharFmtLB->SelectEntry(sSelectStyle);
- CharFmtHdl_Impl(*m_pCharFmtLB);
+ m_xCharFmtLB->set_active_text(sSelectStyle);
+ CharFmtHdl_Impl(*m_xCharFmtLB);
bAutomaticCharStyles = true;
}
}
void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
{
- bool bIsNull = m_pStartED->GetValue() == 0;
+ bool bIsNull = m_xStartED->get_value() == 0;
bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
- m_pStartED->SetMin(bNoZeroAllowed ? 1 : 0);
- if(bIsNull && bNoZeroAllowed)
- m_pStartED->GetModifyHdl().Call(*m_pStartED);
+ m_xStartED->set_min(bNoZeroAllowed ? 1 : 0);
+ if (bIsNull && bNoZeroAllowed)
+ EditModifyHdl_Impl(*m_xStartED);
}
-IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, OrientHdl_Impl, weld::ComboBox&, rBox, void)
{
- sal_Int32 nPos = rBox.GetSelectedEntryPos();
+ sal_Int32 nPos = rBox.get_active();
nPos ++; // no VERT_NONE
sal_uInt16 nMask = 1;
@@ -1813,9 +1759,9 @@ IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void )
SetModified(false);
}
-IMPL_LINK( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, SameLevelHdl_Impl, weld::ToggleButton&, rBox, void)
{
- bool bSet = static_cast<CheckBox*>(pBox)->IsChecked();
+ bool bSet = rBox.get_active();
pActNum->SetContinuousNumbering(bSet);
bool bRepaint = false;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -1831,7 +1777,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void )
InitControls();
}
-IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, SvxColorListBox&, rColorBox, void)
+IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox&, rColorBox, void)
{
Color nSetColor = rColorBox.GetSelectEntryColor();
@@ -1849,9 +1795,9 @@ IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, SvxColorListBox&, rColorBox, v
SetModified();
}
-IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, Edit&, rField, void)
+IMPL_LINK(SvxNumOptionsTabPage, BulRelSizeHdl_Impl, weld::MetricSpinButton&, rField, void)
{
- sal_uInt16 nRelSize = static_cast<sal_uInt16>(static_cast<MetricField&>(rField).GetValue());
+ sal_uInt16 nRelSize = rField.get_value(FUNIT_PERCENT);
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -1867,17 +1813,17 @@ IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, Edit&, rField, void)
SetModified();
}
-IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void )
+IMPL_LINK(SvxNumOptionsTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
{
- sal_uInt16 nItemId = pButton->GetCurItemId();
OUString aGrfName;
Size aSize;
bool bSucc(false);
- SvxOpenGraphicDialog aGrfDlg(CuiResId(RID_SVXSTR_EDIT_GRAPHIC), GetFrameWeld());
+ SvxOpenGraphicDialog aGrfDlg(CuiResId(RID_SVXSTR_EDIT_GRAPHIC), GetDialogFrameWeld());
- if(MN_GALLERY_ENTRY <= nItemId )
+ OString sNumber;
+ if (rIdent.startsWith("gallery", &sNumber))
{
- sal_uInt16 idx = nItemId - MN_GALLERY_ENTRY;
+ auto idx = sNumber.toUInt32();
if (idx < aGrfNames.size())
{
aGrfName = aGrfNames[idx];
@@ -1889,7 +1835,7 @@ IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void )
}
}
}
- else
+ else if (rIdent == "fromfile")
{
aGrfDlg.EnableLink( false );
aGrfDlg.AsLink( false );
@@ -1930,39 +1876,38 @@ IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void )
}
nMask <<= 1;
}
- m_pRatioCB->Enable();
- m_pWidthFT->Enable();
- m_pHeightFT->Enable();
- m_pWidthMF->Enable();
- m_pHeightMF->Enable();
- SetMetricValue(*m_pWidthMF, aSize.Width(), eCoreUnit);
- SetMetricValue(*m_pHeightMF, aSize.Height(), eCoreUnit);
- m_pOrientFT->Enable();
- m_pOrientLB->Enable();
+ m_xRatioCB->set_sensitive(true);
+ m_xWidthFT->set_sensitive(true);
+ m_xHeightFT->set_sensitive(true);
+ m_xWidthMF->set_sensitive(true);
+ m_xHeightMF->set_sensitive(true);
+ SetMetricValue(*m_xWidthMF, aSize.Width(), eCoreUnit);
+ SetMetricValue(*m_xHeightMF, aSize.Height(), eCoreUnit);
+ m_xOrientFT->set_sensitive(true);
+ m_xOrientLB->set_sensitive(true);
SetModified();
//needed due to asynchronous loading of graphics in the SvxBrushItem
aInvalidateTimer.Start();
}
}
-IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, MenuButton *, void)
+IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, weld::ToggleButton&, void)
{
- if(!bMenuButtonInitialized)
+ if (!m_xGalleryMenu)
{
- bMenuButtonInitialized = true;
- EnterWait();
- PopupMenu* pMenu = m_pBitmapMB->GetPopupMenu();
- PopupMenu* pPopup = pMenu->GetPopupMenu(m_nGalleryId);
+ m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
+ weld::WaitObject aWait(GetDialogFrameWeld());
if (GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames))
{
- pPopup->Clear();
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
Graphic aGraphic;
+ ScopedVclPtrInstance< VirtualDevice > pVD;
size_t i = 0;
for (auto & grfName : aGrfNames)
{
+ OUString sItemId = "gallery" + OUString::number(i);
INetURLObject aObj(grfName);
if(aObj.GetProtocol() == INetProtocol::File)
grfName = aObj.PathToFileName();
@@ -1980,27 +1925,24 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, MenuButton *, void)
double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmap.Scale(nScale, nScale);
}
- Image aImage(aBitmap);
-
- pPopup->InsertItem(MN_GALLERY_ENTRY + i, grfName, aImage );
+ pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
+ pVD->DrawBitmapEx(Point(), aBitmap);
+ m_xGalleryMenu->append(sItemId, grfName, *pVD);
}
else
{
- Image aImage;
- pPopup->InsertItem(
- MN_GALLERY_ENTRY + i, grfName, aImage );
+ m_xGalleryMenu->append(sItemId, grfName);
}
++i;
}
GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
}
- LeaveWait();
}
}
-IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, weld::Button&, void)
{
- SvxCharacterMap aMap(GetFrameWeld(), nullptr, false);
+ SvxCharacterMap aMap(GetDialogFrameWeld(), nullptr, false);
sal_uInt16 nMask = 1;
const vcl::Font* pFmtFont = nullptr;
@@ -2057,13 +1999,13 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, Button*, void)
}
}
-IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
+IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void)
{
- bool bWidth = &rField == m_pWidthMF;
+ bool bWidth = &rField == m_xWidthMF.get();
bLastWidthModified = bWidth;
- bool bRatio = m_pRatioCB->IsChecked();
- long nWidthVal = static_cast<long>(m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_100TH_MM)));
- long nHeightVal = static_cast<long>(m_pHeightMF->Denormalize(m_pHeightMF->GetValue(FUNIT_100TH_MM)));
+ bool bRatio = m_xRatioCB->get_active();
+ long nWidthVal = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FUNIT_100TH_MM)));
+ long nHeightVal = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FUNIT_100TH_MM)));
nWidthVal = OutputDevice::LogicToLogic( nWidthVal ,
MapUnit::Map100thMM, eCoreUnit );
nHeightVal = OutputDevice::LogicToLogic( nHeightVal,
@@ -2094,9 +2036,11 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
if (bRatio)
{
aSize.setHeight( aInitSize[i].Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) );
- m_pHeightMF->SetUserValue(m_pHeightMF->Normalize(
+#if 0 //TODO
+ m_xHeightMF->SetUserValue(m_xHeightMF->normalize(
OutputDevice::LogicToLogic( aSize.Height(), eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
+#endif
}
}
else
@@ -2106,9 +2050,11 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
if (bRatio)
{
aSize.setWidth( aInitSize[i].Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) );
- m_pWidthMF->SetUserValue(m_pWidthMF->Normalize(
+#if 0 //TODO
+ m_xWidthMF->SetUserValue(m_xWidthMF->normalize(
OutputDevice::LogicToLogic( aSize.Width(), eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
+#endif
}
}
const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
@@ -2124,22 +2070,22 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
SetModified(bRepaint);
}
-IMPL_LINK( SvxNumOptionsTabPage, RatioHdl_Impl, Button*, pBox, void )
+IMPL_LINK(SvxNumOptionsTabPage, RatioHdl_Impl, weld::ToggleButton&, rBox, void)
{
- if (static_cast<CheckBox*>(pBox)->IsChecked())
+ if (rBox.get_active())
{
if (bLastWidthModified)
- SizeHdl_Impl(*m_pWidthMF);
+ SizeHdl_Impl(*m_xWidthMF);
else
- SizeHdl_Impl(*m_pHeightMF);
+ SizeHdl_Impl(*m_xHeightMF);
}
}
-IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox&, void)
+IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl, weld::ComboBox&, void)
{
bAutomaticCharStyles = false;
- sal_Int32 nEntryPos = m_pCharFmtLB->GetSelectedEntryPos();
- OUString sEntry = m_pCharFmtLB->GetSelectedEntry();
+ sal_Int32 nEntryPos = m_xCharFmtLB->get_active();
+ OUString sEntry = m_xCharFmtLB->get_active_text();
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
@@ -2160,19 +2106,21 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox&, void)
SetModified(false);
};
-IMPL_LINK_NOARG( SvxNumOptionsTabPage, EditListBoxHdl_Impl, ListBox&, void )
+IMPL_LINK_NOARG(SvxNumOptionsTabPage, EditListBoxHdl_Impl, weld::ComboBox&, void)
{
EditModifyHdl_Impl(nullptr);
}
-IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit&, rEdit, void )
+
+IMPL_LINK(SvxNumOptionsTabPage, EditModifyHdl_Impl, weld::Entry&, rEdit, void)
{
EditModifyHdl_Impl(&rEdit);
}
-void SvxNumOptionsTabPage::EditModifyHdl_Impl( Edit* pEdit )
+
+void SvxNumOptionsTabPage::EditModifyHdl_Impl(weld::Entry* pEdit)
{
- bool bPrefix = pEdit == m_pPrefixED;
- bool bSuffix = pEdit == m_pSuffixED;
- bool bStart = pEdit == m_pStartED;
+ bool bPrefix = pEdit == m_xPrefixED.get();
+ bool bSuffix = pEdit == m_xSuffixED.get();
+ bool bStart = pEdit == m_xStartED.get();
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
@@ -2180,11 +2128,11 @@ void SvxNumOptionsTabPage::EditModifyHdl_Impl( Edit* pEdit )
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
if(bPrefix)
- aNumFmt.SetPrefix( m_pPrefixED->GetText() );
+ aNumFmt.SetPrefix(m_xPrefixED->get_text());
else if(bSuffix)
- aNumFmt.SetSuffix( m_pSuffixED->GetText() );
+ aNumFmt.SetSuffix(m_xSuffixED->get_text());
else if(bStart)
- aNumFmt.SetStart( static_cast<sal_uInt16>(m_pStartED->GetValue()) );
+ aNumFmt.SetStart(m_xStartED->get_value());
pActNum->SetLevel(i, aNumFmt);
}
nMask <<= 1;
@@ -2249,149 +2197,6 @@ static long lcl_DrawBullet(VirtualDevice* pVDev,
return nRet;
}
-SvxNumberingPreview::SvxNumberingPreview(vcl::Window* pParent, WinBits nWinBits)
- : Window(pParent, nWinBits)
- , pActNum(nullptr)
- , nActLevel(SAL_MAX_UINT16)
-{
- SetBorderStyle(WindowBorderStyle::MONO);
-}
-
-VCL_BUILDER_FACTORY_ARGS(SvxNumberingPreview, WB_BORDER)
-
-// paint preview of numeration
-void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& /*rRect*/)
-{
- Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
-
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- const Color aBackColor = rStyleSettings.GetFieldColor();
- const Color aTextColor = rStyleSettings.GetFieldTextColor();
-
- ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
- pVDev->EnableRTL(rRenderContext.IsRTLEnabled());
- pVDev->SetMapMode(rRenderContext.GetMapMode());
- pVDev->SetOutputSize(aSize);
-
- Color aLineColor(COL_LIGHTGRAY);
- if (aLineColor == aBackColor)
- aLineColor.Invert();
- pVDev->SetLineColor(aLineColor);
- pVDev->SetFillColor(aBackColor);
-
- if (pActNum)
- {
- long nWidthRelation = 30; // chapter dialog
-
- // height per level
- long nXStep = aSize.Width() / (3 * pActNum->GetLevelCount());
- if (pActNum->GetLevelCount() < 10)
- nXStep /= 2;
- long nYStart = 4;
- // the whole height mustn't be used for a single level
- long nYStep = (aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5);
-
- aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne);
- aStdFont.SetColor(aTextColor);
- aStdFont.SetFillColor(aBackColor);
-
- long nFontHeight = nYStep * 6 / 10;
- aStdFont.SetFontSize(Size( 0, nFontHeight ));
-
- SvxNodeNum aNum;
- sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart();
-
- //#i5153# painting gray or black rectangles as 'normal' numbering text
- long nWidth = pVDev->GetTextWidth("Preview");
- long nTextHeight = pVDev->GetTextHeight();
- long nRectHeight = nTextHeight * 2 / 3;
- long nTopOffset = nTextHeight - nRectHeight;
- Color aBlackColor(COL_BLACK);
- if (aBlackColor == aBackColor)
- aBlackColor.Invert();
-
- for (sal_uInt16 nLevel = 0; nLevel < pActNum->GetLevelCount(); ++nLevel, nYStart = nYStart + nYStep)
- {
- const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel);
- aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart();
- long nXStart( 0 );
- pVDev->SetFillColor( aBackColor );
-
- if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
- {
- nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
- }
- else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
- {
- const long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation);
- if (nTmpXStart < 0)
- {
- nXStart = 0;
- }
- else
- {
- nXStart = nTmpXStart;
- }
- }
- nXStart /= 2;
- nXStart += 2;
- long nTextOffset = 2 * nXStep;
- if (SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN)))
- {
- if (rFmt.IsShowSymbol())
- {
- long nYMiddle = nYStart + ( nFontHeight / 2 );
- nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation);
- nTextOffset = nTextOffset + nXStep;
- }
- }
- else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType())
- {
- if (rFmt.IsShowSymbol())
- {
- nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetFontSize());
- nTextOffset = nTextOffset + nXStep;
- }
- }
- else
- {
- vcl::Font aColorFont(aStdFont);
- Color aTmpBulletColor = rFmt.GetBulletColor();
- if (aTmpBulletColor == COL_AUTO)
- aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK;
- else if (aTmpBulletColor == aBackColor)
- aTmpBulletColor.Invert();
- aColorFont.SetColor(aTmpBulletColor);
- pVDev->SetFont(aColorFont);
- aNum.SetLevel( nLevel );
- if (pActNum->IsContinuousNumbering())
- aNum.GetLevelVal()[nLevel] = nPreNum;
- OUString aText(pActNum->MakeNumString(aNum));
- pVDev->DrawText(Point(nXStart, nYStart), aText);
- pVDev->SetFont(aStdFont);
- nTextOffset = pVDev->GetTextWidth(aText);
- nTextOffset = nTextOffset + nXStep;
- nPreNum++;
- }
- //#i5153# the selected rectangle(s) should be black
- if (0 != (nActLevel & (1<<nLevel)))
- {
- pVDev->SetFillColor( aBlackColor );
- pVDev->SetLineColor( aBlackColor );
- }
- else
- {
- //#i5153# unselected levels are gray
- pVDev->SetFillColor( aLineColor );
- pVDev->SetLineColor( aLineColor );
- }
- ::tools::Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight));
- pVDev->DrawRect(aRect1);
- }
- }
- rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *pVDev);
-}
-
cui::NumberingPreview::NumberingPreview()
: pActNum(nullptr)
, bPosition(false)
@@ -3506,8 +3311,8 @@ void SvxNumOptionsTabPage::SetModified(bool bRepaint)
bModified = true;
if (bRepaint)
{
- m_pPreviewWIN->SetLevel(nActNumLvl);
- m_pPreviewWIN->Invalidate();
+ m_aPreviewWIN.SetLevel(nActNumLvl);
+ m_aPreviewWIN.Invalidate();
}
}
@@ -3526,7 +3331,7 @@ void SvxNumOptionsTabPage::PageCreated(const SfxAllItemSet& aSet)
const std::vector<OUString> &aList = pListItem->GetList();
sal_uInt32 nCount = aList.size();
for(sal_uInt32 i = 0; i < nCount; i++)
- m_pCharFmtLB->InsertEntry(aList[i]);
+ m_xCharFmtLB->append_text(aList[i]);
}
if (pMetricItem)
SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index eb6a22d3288d..015d4ac84883 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -177,6 +177,7 @@ SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs
// Symbols on a line (eg star charts), MB-handler set
m_xSymbolMB->connect_selected(LINK(this, SvxLineTabPage, GraphicHdl_Impl));
+ m_xSymbolMB->connect_toggled(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl));
m_xSymbolWidthMF->connect_value_changed(LINK(this, SvxLineTabPage, SizeHdl_Impl));
m_xSymbolHeightMF->connect_value_changed(LINK(this, SvxLineTabPage, SizeHdl_Impl));
m_xSymbolRatioCB->connect_toggled(LINK(this, SvxLineTabPage, RatioHdl_Impl));
@@ -193,8 +194,6 @@ void SvxLineTabPage::ShowSymbolControls(bool bOn)
m_bSymbols=bOn;
m_xFlSymbol->show(bOn);
- if (bOn)
- MenuCreate();
m_aCtlPreview.ShowSymbol(bOn);
}
@@ -1368,7 +1367,7 @@ void SvxLineTabPage::FillUserData()
// #58425# Symbols on a list (e.g. StarChart)
// Handler for the symbol selection's popup menu (NumMenueButton)
// The following link originates from SvxNumOptionsTabPage
-void SvxLineTabPage::MenuCreate()
+IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::ToggleButton&, void)
{
ScopedVclPtrInstance< VirtualDevice > pVD;
@@ -1376,6 +1375,7 @@ void SvxLineTabPage::MenuCreate()
if (!m_xGalleryMenu)
{
m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
+ weld::WaitObject aWait(GetDialogFrameWeld());
// Get gallery entries
GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, m_aGrfNames);
diff --git a/cui/uiconfig/ui/numberingoptionspage.ui b/cui/uiconfig/ui/numberingoptionspage.ui
index 7941c2838464..d29e1f586de5 100644
--- a/cui/uiconfig/ui/numberingoptionspage.ui
+++ b/cui/uiconfig/ui/numberingoptionspage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -27,6 +27,45 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="adjustment5">
+ <property name="upper">19.989999999999998</property>
+ <property name="step_increment">0.050000000000000003</property>
+ <property name="page_increment">1</property>
+ </object>
+ <object class="GtkMenu" id="bitmapmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="fromfile">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="numberingoptionspage|fromfile">From file...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="gallery">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="numberingoptionspage|gallery">Gallery</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="gallerysubmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkBox" id="NumberingOptionsPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -45,13 +84,35 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkTreeView" id="levellb:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="search_column">0</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection4"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="levellb">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <property name="search_column">0</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
</child>
@@ -132,6 +193,7 @@
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment3</property>
</object>
<packing>
@@ -143,6 +205,7 @@
<object class="GtkSpinButton" id="startat">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
@@ -180,7 +243,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="numberingoptionspage|bitmapft">Graphics:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">bitmap:bitmapmenu</property>
+ <property name="mnemonic_widget">bitmap</property>
<property name="xalign">1</property>
</object>
<packing>
@@ -194,7 +257,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="numberingoptionspage|widthft">Width:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">widthmf:0.00cm</property>
+ <property name="mnemonic_widget">widthmf</property>
<property name="xalign">1</property>
</object>
<packing>
@@ -203,9 +266,10 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="widthmf:0.00cm">
+ <object class="GtkSpinButton" id="widthmf">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
<property name="digits">2</property>
</object>
@@ -220,7 +284,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="numberingoptionspage|heightft">Height:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">heightmf:0.00cm</property>
+ <property name="mnemonic_widget">heightmf</property>
<property name="ellipsize">end</property>
<property name="xalign">1</property>
</object>
@@ -230,10 +294,11 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="heightmf:0.00cm">
+ <object class="GtkSpinButton" id="heightmf">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment5</property>
<property name="digits">2</property>
</object>
<packing>
@@ -292,11 +357,15 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="bitmap:bitmapmenu">
+ <object class="GtkMenuButton" id="bitmap">
<property name="label" translatable="yes" context="numberingoptionspage|bitmap">Select...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="popup">bitmapmenu</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -304,9 +373,14 @@
</packing>
</child>
<child>
- <object class="svxcorelo-SvxColorListBox" id="color">
+ <object class="GtkMenuButton" id="color">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -314,9 +388,10 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="relsize:0%">
+ <object class="GtkSpinButton" id="relsize">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment4</property>
</object>
<packing>
@@ -380,6 +455,7 @@
<object class="GtkEntry" id="suffix">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -390,6 +466,7 @@
<object class="GtkEntry" id="prefix">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -445,7 +522,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="numberingoptionspage|relsizeft">_Relative size:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">relsize:0%</property>
+ <property name="mnemonic_widget">relsize</property>
<property name="xalign">1</property>
</object>
<packing>
@@ -487,6 +564,12 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -495,11 +578,26 @@
</packing>
</child>
<child>
- <object class="cuilo-SvxNumberingPreview" id="preview">
- <property name="width_request">150</property>
- <property name="height_request">300</property>
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="preview">
+ <property name="width_request">150</property>
+ <property name="height_request">300</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -579,24 +677,4 @@
</packing>
</child>
</object>
- <object class="GtkMenu" id="bitmapmenu">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkMenuItem" id="fromfile">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="numberingoptionspage|fromfile">From file...</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="gallery">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="numberingoptionspage|gallery">Gallery</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- </object>
</interface>
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index 23c371fd9ce0..ccfac3bf2c60 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -137,7 +137,15 @@ public:
void set_sensitive(bool sensitive) { m_xButton->set_sensitive(sensitive); }
bool get_sensitive() const { return m_xButton->get_sensitive(); }
+ void show() { m_xButton->show(); }
void hide() { m_xButton->hide(); }
+ void show(bool bShow)
+ {
+ if (bShow)
+ show();
+ else
+ hide();
+ }
};
#endif
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 08a59377cdaa..739b6d97a5b7 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1155,12 +1155,14 @@ private:
VclPtr<::MenuButton> m_xMenuButton;
DECL_LINK(MenuSelectHdl, ::MenuButton*, void);
+ DECL_LINK(ActivateHdl, ::MenuButton*, void);
public:
SalInstanceMenuButton(::MenuButton* pButton, bool bTakeOwnership)
: SalInstanceButton(pButton, bTakeOwnership)
, m_xMenuButton(pButton)
{
+ m_xMenuButton->SetActivateHdl(LINK(this, SalInstanceMenuButton, ActivateHdl));
m_xMenuButton->SetSelectHdl(LINK(this, SalInstanceMenuButton, MenuSelectHdl));
}
@@ -1222,6 +1224,7 @@ public:
virtual ~SalInstanceMenuButton() override
{
m_xMenuButton->SetSelectHdl(Link<::MenuButton*, void>());
+ m_xMenuButton->SetActivateHdl(Link<::MenuButton*, void>());
}
};
@@ -1230,6 +1233,13 @@ IMPL_LINK_NOARG(SalInstanceMenuButton, MenuSelectHdl, ::MenuButton*, void)
signal_selected(m_xMenuButton->GetCurItemIdent());
}
+IMPL_LINK_NOARG(SalInstanceMenuButton, ActivateHdl, ::MenuButton*, void)
+{
+ if (notify_events_disabled())
+ return;
+ signal_toggled();
+}
+
class SalInstanceRadioButton : public SalInstanceButton, public virtual weld::RadioButton
{
private: