summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/Library_sdui.mk2
-rw-r--r--sd/inc/sdabstdlg.hxx2
-rw-r--r--sd/inc/strings.hrc2
-rw-r--r--sd/sdi/_drvwsh.sdi6
-rw-r--r--sd/source/ui/dlg/BulletAndPositionDlg.cxx1361
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx25
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx20
-rw-r--r--sd/source/ui/func/fuolbull.cxx302
-rw-r--r--sd/source/ui/inc/BulletAndPositionDlg.hxx171
-rw-r--r--sd/source/ui/inc/OutlineView.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx2
-rw-r--r--sd/source/ui/inc/drawview.hxx3
-rw-r--r--sd/source/ui/inc/fuolbull.hxx24
-rw-r--r--sd/source/ui/view/drawview.cxx206
-rw-r--r--sd/source/ui/view/drviews2.cxx7
-rw-r--r--sd/source/ui/view/outlview.cxx2
-rw-r--r--sd/source/ui/view/sdview.cxx2
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml1
18 files changed, 2057 insertions, 83 deletions
diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk
index c2ca40f6ed95..73abad77f94b 100644
--- a/sd/Library_sdui.mk
+++ b/sd/Library_sdui.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_Library_use_libraries,sdui,\
tl \
utl \
vcl \
+ cui \
))
$(eval $(call gb_Library_add_exception_objects,sdui,\
@@ -91,6 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,sdui,\
sd/source/ui/dlg/tpoption \
sd/source/ui/dlg/vectdlg \
sd/source/ui/dlg/PhotoAlbumDialog \
+ sd/source/ui/dlg/BulletAndPositionDlg \
))
# $(WORKDIR)/inc/sd/sddll0.hxx :
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index bdfdaef19daf..90d18bf987ee 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -26,6 +26,7 @@
#include <svl/itemset.hxx>
#include <tools/solar.h>
#include <vcl/abstdlg.hxx>
+#include <svx/svxdlg.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -170,6 +171,7 @@ class SdAbstractDialogFactory
public:
SD_DLLPUBLIC static SdAbstractDialogFactory* Create();
+ virtual VclPtr<AbstractSvxBulletAndPositionDlg> CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0;
virtual VclPtr<VclAbstractDialog> CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount ) = 0;
virtual VclPtr<AbstractCopyDlg> CreateCopyDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView ) = 0;
virtual VclPtr<AbstractSdCustomShowDlg> CreateSdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc) = 0;
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 02f709408d72..38b9491b497b 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -489,6 +489,8 @@
#define STR_CTRLCLICKHYPERLINK NC_("STR_CTRLCLICKHYPERLINK", "%s-click to follow hyperlink: ")
#define STR_CLICKHYPERLINK NC_("STR_CLICKHYPERLINK", "Click to open hyperlink: ")
+#define RID_SVXSTR_EDIT_GRAPHIC NC_("RID_SVXSTR_EDIT_GRAPHIC", "Link")
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 93a30e6757dc..1b0171dafea7 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -710,6 +710,12 @@ interface DrawView
StateMethod = GetMenuState ;
MenuConfig = TRUE;
]
+ SID_NUMBERING_AND_POSITION // ole : no, status : ?
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ MenuConfig = TRUE;
+ ]
FN_SVX_SET_BULLET
[
ExecMethod = FuTemporary ;
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
new file mode 100644
index 000000000000..a9fc0adcd9b8
--- /dev/null
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -0,0 +1,1361 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
+
+#include <tools/mapunit.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <i18nlangtag/mslangid.hxx>
+#include <editeng/numitem.hxx>
+#include <svl/eitem.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/colorbox.hxx>
+#include <svx/strarray.hxx>
+#include <svx/gallery.hxx>
+#include <svl/urihelper.hxx>
+#include <editeng/brushitem.hxx>
+#include <svl/intitem.hxx>
+#include <sfx2/objsh.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/settings.hxx>
+#include <editeng/flstitem.hxx>
+#include <svx/dlgutil.hxx>
+#include <svx/xtable.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/numvset.hxx>
+#include <sfx2/htmlmode.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svtools/unitconv.hxx>
+#include <editeng/unolingu.hxx>
+#include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/text/DefaultNumberingProvider.hpp>
+#include <com/sun/star/text/XDefaultNumberingProvider.hpp>
+#include <com/sun/star/text/XNumberingFormatter.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/text/XNumberingTypeInfo.hpp>
+#include <svx/dialogs.hrc>
+#include <svx/svxids.hrc>
+
+#include <algorithm>
+#include <memory>
+#include <vector>
+#include <sfx2/opengrf.hxx>
+
+#include <strings.hrc>
+#include <sfx2/request.hxx>
+#include <svl/aeitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/slstitm.hxx>
+#include <sfx2/filedlghelper.hxx>
+#include <svx/gallery1.hxx>
+#include <svx/galtheme.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <rtl/ustring.h>
+#include <sal/log.hxx>
+#include <vcl/cvtgrf.hxx>
+#include <vcl/graphicfilter.hxx>
+#include <vcl/virdev.hxx>
+#include <svx/SvxNumOptionsTabPageHelper.hxx>
+#include <View.hxx>
+#include <drawdoc.hxx>
+#include <cui/cuicharmap.hxx>
+#include <BulletAndPositionDlg.hxx>
+#include <sdmod.hxx>
+#include <sdpage.hxx>
+#include <sdresid.hxx>
+
+#define SHOW_NUMBERING 0
+#define SHOW_BULLET 1
+#define SHOW_BITMAP 2
+
+#define MAX_BMP_WIDTH 16
+#define MAX_BMP_HEIGHT 16
+
+static bool bLastRelative = false;
+
+static const vcl::Font& lcl_GetDefaultBulletFont()
+{
+ static vcl::Font aDefBulletFont = [&]() {
+ vcl::Font tmp("OpenSymbol", "", Size(0, 14));
+ tmp.SetCharSet(RTL_TEXTENCODING_SYMBOL);
+ tmp.SetFamily(FAMILY_DONTKNOW);
+ tmp.SetPitch(PITCH_DONTKNOW);
+ tmp.SetWeight(WEIGHT_DONTKNOW);
+ tmp.SetTransparent(true);
+ return tmp;
+ }();
+ return aDefBulletFont;
+}
+
+class SdDrawDocument;
+
+SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const SfxItemSet& rSet,
+ ::sd::View* pView)
+ : GenericDialogController(pWindow, "cui/ui/bulletandposition.ui", "BulletAndPosition")
+ , bLastWidthModified(false)
+ , bModified(false)
+ , bPreset(false)
+ , bAutomaticCharStyles(true)
+ , bHTMLMode(false)
+ , bInInitControl(false)
+ , bLabelAlignmentPosAndSpaceModeActive(false)
+ , bApplyToMaster(false)
+ , bIsSlideScope(false)
+ , nBullet(0xff)
+ , nActNumLvl(1)
+ , p_Window(pWindow)
+ , nNumItemId(SID_ATTR_NUMBERING_RULE)
+ , m_xGrid(m_xBuilder->weld_widget("grid2"))
+ , m_xLevelLB(m_xBuilder->weld_tree_view("levellb"))
+ , m_xFmtLB(m_xBuilder->weld_combo_box("numfmtlb"))
+ , 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_xBeforeAfter(m_xBuilder->weld_expander("beforeafter"))
+ , m_xBulColorFT(m_xBuilder->weld_label("colorft"))
+ , m_xBulColLB(new ColorListBox(m_xBuilder->weld_menu_button("color"), pWindow))
+ , m_xBulRelSizeFT(m_xBuilder->weld_label("relsizeft"))
+ , m_xBulRelSizeMF(m_xBuilder->weld_metric_spin_button("relsize", FieldUnit::PERCENT))
+ , 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_xBitmapMB(m_xBuilder->weld_menu_button("bitmap"))
+ , m_xWidthFT(m_xBuilder->weld_label("widthft"))
+ , m_xWidthMF(m_xBuilder->weld_metric_spin_button("widthmf", FieldUnit::CM))
+ , m_xHeightFT(m_xBuilder->weld_label("heightft"))
+ , m_xHeightMF(m_xBuilder->weld_metric_spin_button("heightmf", FieldUnit::CM))
+ , m_xRatioCB(m_xBuilder->weld_check_button("keepratio"))
+ , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
+ , m_xDistBorderFT(m_xBuilder->weld_label("indent"))
+ , m_xDistBorderMF(m_xBuilder->weld_metric_spin_button("indentmf", FieldUnit::CM))
+ , m_xRelativeCB(m_xBuilder->weld_check_button("relative"))
+ , m_xIndentFT(m_xBuilder->weld_label("numberingwidth"))
+ , m_xIndentMF(m_xBuilder->weld_metric_spin_button("numberingwidthmf", FieldUnit::CM))
+ , m_xLeftTB(m_xBuilder->weld_toggle_button("left"))
+ , m_xCenterTB(m_xBuilder->weld_toggle_button("center"))
+ , m_xRightTB(m_xBuilder->weld_toggle_button("right"))
+ , m_xSlideRB(m_xBuilder->weld_radio_button("sliderb"))
+ , m_xSelectionRB(m_xBuilder->weld_radio_button("selectionrb"))
+ , m_xApplyToMaster(m_xBuilder->weld_toggle_button("applytomaster"))
+{
+ m_xBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
+ m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FieldUnit::PERCENT);
+ m_xBulRelSizeMF->set_increments(5, 50, FieldUnit::PERCENT);
+ aActBulletFont = lcl_GetDefaultBulletFont();
+
+ m_xBulletPB->connect_clicked(LINK(this, SvxBulletAndPositionDlg, BulletHdl_Impl));
+ m_xFmtLB->connect_changed(LINK(this, SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl));
+ m_xBitmapMB->connect_selected(LINK(this, SvxBulletAndPositionDlg, GraphicHdl_Impl));
+ m_xBitmapMB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, PopupActivateHdl_Impl));
+ m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
+ m_xLevelLB->connect_changed(LINK(this, SvxBulletAndPositionDlg, LevelHdl_Impl));
+ m_xWidthMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, SizeHdl_Impl));
+ m_xHeightMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, SizeHdl_Impl));
+ m_xRatioCB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, RatioHdl_Impl));
+ m_xStartED->connect_changed(LINK(this, SvxBulletAndPositionDlg, EditModifyHdl_Impl));
+ m_xPrefixED->connect_changed(LINK(this, SvxBulletAndPositionDlg, EditModifyHdl_Impl));
+ m_xSuffixED->connect_changed(LINK(this, SvxBulletAndPositionDlg, EditModifyHdl_Impl));
+ m_xBulRelSizeMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, BulRelSizeHdl_Impl));
+ m_xBulColLB->SetSelectHdl(LINK(this, SvxBulletAndPositionDlg, BulColorHdl_Impl));
+ m_xLeftTB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, SelectLeftAlignmentHdl_Impl));
+ m_xCenterTB->connect_toggled(
+ LINK(this, SvxBulletAndPositionDlg, SelectCenterAlignmentHdl_Impl));
+ m_xRightTB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, SelectRightAlignmentHdl_Impl));
+ m_xApplyToMaster->connect_toggled(LINK(this, SvxBulletAndPositionDlg, ApplyToMasterHdl_Impl));
+
+ aInvalidateTimer.SetInvokeHandler(
+ LINK(this, SvxBulletAndPositionDlg, PreviewInvalidateHdl_Impl));
+ aInvalidateTimer.SetTimeout(50);
+
+ 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)
+ {
+ 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_xFmtLB, (SVX_NUM_BITMAP | LINK_TOKEN));
+
+ m_xFmtLB->set_active(0);
+ m_xRelativeCB->set_active(true);
+
+ Link<weld::MetricSpinButton&, void> aLk3
+ = LINK(this, SvxBulletAndPositionDlg, DistanceHdl_Impl);
+ m_xDistBorderMF->connect_value_changed(aLk3);
+ m_xIndentMF->connect_value_changed(aLk3);
+
+ m_xRelativeCB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, RelativeHdl_Impl));
+ m_xRelativeCB->set_active(bLastRelative);
+
+ Size aSize(m_xGrid->get_preferred_size());
+ m_xGrid->set_size_request(aSize.Width(), -1);
+
+ // PageCreated
+ FieldUnit eMetric = pView->GetDoc().GetUIUnit();
+ SfxAllItemSet aSet(*(rSet.GetPool()));
+ aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM, static_cast<sal_uInt16>(eMetric)));
+
+ const SfxStringItem* pNumCharFmt = aSet.GetItem<SfxStringItem>(SID_NUM_CHAR_FMT, false);
+ const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
+ const SfxAllEnumItem* pMetricItem = aSet.GetItem<SfxAllEnumItem>(SID_METRIC_ITEM, false);
+
+ if (pNumCharFmt && pBulletCharFmt)
+ SetCharFmts(pNumCharFmt->GetValue(), pBulletCharFmt->GetValue());
+
+ if (pMetricItem)
+ SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
+
+ // End PageCreated
+
+ Reset(&rSet);
+
+ // ActivatePage part
+
+ const SfxPoolItem* pItem;
+ const SfxItemSet* pExampleSet = &rSet;
+ sal_uInt16 nTmpNumLvl = 1;
+ if (pExampleSet)
+ {
+ if (SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
+ bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+ if (SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
+ nTmpNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
+ }
+ if (SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
+ {
+ pSaveNum.reset(new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()));
+ }
+
+ bModified = (!pActNum->Get(0) || bPreset);
+ if (*pActNum != *pSaveNum || nActNumLvl != nTmpNumLvl)
+ {
+ nActNumLvl = nTmpNumLvl;
+ sal_uInt16 nMask = 1;
+ 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_xLevelLB->select(i);
+ nMask <<= 1;
+ }
+ }
+ *pActNum = *pSaveNum;
+
+ m_xRelativeCB->set_sensitive(nActNumLvl != 1);
+
+ InitPosAndSpaceMode();
+ InitControls();
+ }
+
+ m_aPreviewWIN.SetLevel(nActNumLvl);
+ m_aPreviewWIN.Invalidate();
+
+ // End of the ActivatePage part
+}
+
+SvxBulletAndPositionDlg::~SvxBulletAndPositionDlg() {}
+
+void SvxBulletAndPositionDlg::dispose()
+{
+ m_xPreviewWIN.reset();
+ m_xBulColLB.reset();
+ pActNum.reset();
+ pSaveNum.reset();
+}
+
+void SvxBulletAndPositionDlg::SetMetric(FieldUnit eMetric)
+{
+ if (eMetric == FieldUnit::MM)
+ {
+ m_xWidthMF->set_digits(1);
+ m_xHeightMF->set_digits(1);
+ m_xDistBorderMF->set_digits(1);
+ m_xIndentMF->set_digits(1);
+ }
+ m_xWidthMF->set_unit(eMetric);
+ m_xHeightMF->set_unit(eMetric);
+ m_xDistBorderMF->set_unit(eMetric);
+ m_xIndentMF->set_unit(eMetric);
+}
+
+SfxItemSet* SvxBulletAndPositionDlg::GetOutputItemSet(SfxItemSet* pSet)
+{
+ pSet->Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl));
+ if (bModified && pActNum)
+ {
+ *pSaveNum = *pActNum;
+ pSet->Put(SvxNumBulletItem(*pSaveNum, nNumItemId));
+ pSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, false));
+ }
+ return pSet;
+};
+
+bool SvxBulletAndPositionDlg::IsApplyToMaster() { return bApplyToMaster; }
+bool SvxBulletAndPositionDlg::IsSlideScope() { return m_xSlideRB->get_active(); }
+
+void SvxBulletAndPositionDlg::Reset(const SfxItemSet* rSet)
+{
+ const SfxPoolItem* pItem;
+ // in Draw the item exists as WhichId, in Writer only as SlotId
+ SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
+ if (eState != SfxItemState::SET)
+ {
+ nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ eState = rSet->GetItemState(nNumItemId, false, &pItem);
+
+ if (eState != SfxItemState::SET)
+ {
+ pItem = &static_cast<const SvxNumBulletItem&>(rSet->Get(nNumItemId));
+ eState = SfxItemState::SET;
+ }
+ }
+ DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
+ pSaveNum.reset(new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()));
+
+ // insert levels
+ if (!m_xLevelLB->n_children())
+ {
+ for (sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++)
+ m_xLevelLB->append_text(OUString::number(i));
+ if (pSaveNum->GetLevelCount() > 1)
+ {
+ OUString sEntry = "1 - " + OUString::number(pSaveNum->GetLevelCount());
+ m_xLevelLB->append_text(sEntry);
+ m_xLevelLB->select_text(sEntry);
+ }
+ else
+ m_xLevelLB->select(0);
+ }
+ else
+ m_xLevelLB->select(m_xLevelLB->n_children() - 1);
+
+ sal_uInt16 nMask = 1;
+ m_xLevelLB->unselect_all();
+ if (nActNumLvl == SAL_MAX_UINT16)
+ {
+ m_xLevelLB->select(pSaveNum->GetLevelCount());
+ }
+ else
+ {
+ for (sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ m_xLevelLB->select(i);
+ nMask <<= 1;
+ }
+ }
+
+ if (!pActNum)
+ pActNum.reset(new SvxNumRule(*pSaveNum));
+ else if (*pSaveNum != *pActNum)
+ *pActNum = *pSaveNum;
+ m_aPreviewWIN.SetNumRule(pActNum.get());
+
+ SfxObjectShell* pShell;
+ if (SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem)
+ || (nullptr != (pShell = SfxObjectShell::Current())
+ && nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
+ {
+ sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
+ bHTMLMode = 0 != (nHtmlMode & HTMLMODE_ON);
+ }
+
+ bool bContinuous = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
+
+ // 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_xFmtLB->get_count();
+ for (sal_Int32 i = nFmtCount; i; i--)
+ {
+ sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
+ if (/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
+ (SVX_NUM_BITMAP | LINK_TOKEN) == nEntryData)
+ m_xFmtLB->remove(i - 1);
+ }
+ }
+ //one must be enabled
+ if (!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_LINKED_BMP))
+ {
+ 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))
+ {
+ 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_xFmtLB->get_count();
+ for (sal_Int32 i = nFmtCount; i; i--)
+ {
+ sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
+ if (/*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
+ m_xFmtLB->remove(i - 1);
+ }
+ }
+
+ InitPosAndSpaceMode();
+
+ InitControls();
+ bModified = false;
+}
+
+void SvxBulletAndPositionDlg::InitControls()
+{
+ bInInitControl = true;
+
+ const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive && m_xRelativeCB->get_sensitive()
+ && m_xRelativeCB->get_active();
+ const bool bSingleSelection
+ = m_xLevelLB->count_selected_rows() == 1 && SAL_MAX_UINT16 != nActNumLvl;
+
+ m_xDistBorderMF->set_sensitive(!bLabelAlignmentPosAndSpaceModeActive
+ && (bSingleSelection || bRelative));
+ m_xDistBorderFT->set_sensitive(!bLabelAlignmentPosAndSpaceModeActive
+ && (bSingleSelection || bRelative));
+
+ bool bShowBullet = true;
+ bool bShowBitmap = true;
+ bool bSameType = true;
+ bool bSameStart = true;
+ bool bSamePrefix = true;
+ bool bSameSuffix = true;
+ bool bAllLevel = true;
+ bool bSameCharFmt = true;
+ bool bSameVOrient = true;
+ bool bSameSize = true;
+ bool bSameBulColor = true;
+ bool bSameBulRelSize = true;
+ bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive;
+ bool bSetDistEmpty = false;
+ bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive;
+
+ const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM];
+ OUString sFirstCharFmt;
+ sal_Int16 eFirstOrient = text::VertOrientation::NONE;
+ SvxAdjust eFirstAdjust = SvxAdjust::Left;
+ Size aFirstSize(0, 0);
+ sal_uInt16 nMask = 1;
+ sal_uInt16 nLvl = SAL_MAX_UINT16;
+ sal_uInt16 nHighestLevel = 0;
+ (void)nHighestLevel;
+
+ bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
+ bool bBullRelSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ aNumFmtArr[i] = &pActNum->GetLevel(i);
+ bShowBullet &= aNumFmtArr[i]->GetNumberingType() == SVX_NUM_CHAR_SPECIAL;
+ bShowBitmap &= (aNumFmtArr[i]->GetNumberingType() & (~LINK_TOKEN)) == SVX_NUM_BITMAP;
+ eFirstAdjust = aNumFmtArr[i]->GetNumAdjust();
+ if (SAL_MAX_UINT16 == nLvl)
+ {
+ nLvl = i;
+ sFirstCharFmt = aNumFmtArr[i]->GetCharFormatName();
+ eFirstOrient = aNumFmtArr[i]->GetVertOrient();
+ if (bShowBitmap)
+ aFirstSize = aNumFmtArr[i]->GetGraphicSize();
+ }
+ if (i > nLvl)
+ {
+ bSameType
+ &= aNumFmtArr[i]->GetNumberingType() == aNumFmtArr[nLvl]->GetNumberingType();
+ bSameStart = aNumFmtArr[i]->GetStart() == aNumFmtArr[nLvl]->GetStart();
+
+ bSamePrefix = aNumFmtArr[i]->GetPrefix() == aNumFmtArr[nLvl]->GetPrefix();
+ bSameSuffix = aNumFmtArr[i]->GetSuffix() == aNumFmtArr[nLvl]->GetSuffix();
+ bAllLevel &= aNumFmtArr[i]->GetIncludeUpperLevels()
+ == aNumFmtArr[nLvl]->GetIncludeUpperLevels();
+ bSameCharFmt &= sFirstCharFmt == aNumFmtArr[i]->GetCharFormatName();
+ bSameVOrient &= eFirstOrient == aNumFmtArr[i]->GetVertOrient();
+ //bSameAdjust &= eFirstAdjust == aNumFmtArr[i]->GetNumAdjust();
+ if (bShowBitmap && bSameSize)
+ bSameSize &= aNumFmtArr[i]->GetGraphicSize() == aFirstSize;
+ bSameBulColor
+ &= aNumFmtArr[i]->GetBulletColor() == aNumFmtArr[nLvl]->GetBulletColor();
+ bSameBulRelSize
+ &= aNumFmtArr[i]->GetBulletRelSize() == aNumFmtArr[nLvl]->GetBulletRelSize();
+ bSameIndent //?
+ &= aNumFmtArr[i]->GetFirstLineOffset()
+ == aNumFmtArr[nLvl]->GetFirstLineOffset();
+ }
+ nHighestLevel = i;
+ }
+ else
+ aNumFmtArr[i] = nullptr;
+
+ nMask <<= 1;
+ }
+ SwitchNumberType(bShowBullet ? 1 : bShowBitmap ? 2 : 0);
+
+ sal_uInt16 nNumberingType;
+ if (nLvl != SAL_MAX_UINT16)
+ nNumberingType = aNumFmtArr[nLvl]->GetNumberingType();
+ else
+ {
+ nNumberingType = SVX_NUM_NUMBER_NONE;
+ bAllLevel = false;
+ bSameBulRelSize = false;
+ bSameBulColor = false;
+ bSameStart = false;
+ bSamePrefix = false;
+ bSameSuffix = false;
+ }
+
+ CheckForStartValue_Impl(nNumberingType);
+
+ if (bShowBitmap)
+ {
+ if (bSameSize)
+ {
+ SetMetricValue(*m_xHeightMF, aFirstSize.Height(), eCoreUnit);
+ SetMetricValue(*m_xWidthMF, aFirstSize.Width(), eCoreUnit);
+ }
+ else
+ {
+ m_xHeightMF->set_text("");
+ m_xWidthMF->set_text("");
+ }
+ }
+
+ if (bSameType)
+ {
+ sal_uInt16 nLBData = nNumberingType;
+ m_xFmtLB->set_active_id(OUString::number(nLBData));
+ }
+ else
+ m_xFmtLB->set_active(-1);
+
+ if (bBullRelSize)
+ {
+ if (bSameBulRelSize)
+ m_xBulRelSizeMF->set_value(aNumFmtArr[nLvl]->GetBulletRelSize(), FieldUnit::PERCENT);
+ else
+ m_xBulRelSizeMF->set_text("");
+ }
+ if (bBullColor)
+ {
+ if (bSameBulColor)
+ m_xBulColLB->SelectEntry(aNumFmtArr[nLvl]->GetBulletColor());
+ else
+ m_xBulColLB->SetNoSelection();
+ }
+ switch (nBullet)
+ {
+ case SHOW_NUMBERING:
+ if (bSameStart)
+ {
+ m_xStartED->set_value(aNumFmtArr[nLvl]->GetStart());
+ }
+ else
+ m_xStartED->set_text("");
+ break;
+ case SHOW_BULLET:
+ break;
+ case SHOW_BITMAP:
+ break;
+ }
+
+ switch (eFirstAdjust)
+ {
+ case SvxAdjust::Left:
+ m_xLeftTB->set_active(true);
+ m_xCenterTB->set_active(false);
+ m_xRightTB->set_active(false);
+ break;
+ case SvxAdjust::Center:
+ m_xLeftTB->set_active(false);
+ m_xCenterTB->set_active(true);
+ m_xRightTB->set_active(false);
+ break;
+ case SvxAdjust::Right:
+ m_xLeftTB->set_active(false);
+ m_xCenterTB->set_active(false);
+ m_xRightTB->set_active(true);
+ break;
+ default:
+ break;
+ }
+
+ if (bSamePrefix)
+ m_xPrefixED->set_text(aNumFmtArr[nLvl]->GetPrefix());
+ else
+ m_xPrefixED->set_text("");
+ if (bSameSuffix)
+ m_xSuffixED->set_text(aNumFmtArr[nLvl]->GetSuffix());
+ else
+ m_xSuffixED->set_text("");
+
+ if (bSameDistBorderNum)
+ {
+ long nDistBorderNum;
+ if (bRelative)
+ {
+ nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())
+ + aNumFmtArr[nLvl]->GetFirstLineOffset();
+ if (nLvl)
+ nDistBorderNum -= static_cast<long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())
+ + aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
+ }
+ else
+ {
+ nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())
+ + aNumFmtArr[nLvl]->GetFirstLineOffset();
+ }
+ SetMetricValue(*m_xDistBorderMF, nDistBorderNum, eCoreUnit);
+ }
+ else
+ bSetDistEmpty = true;
+
+ if (bSetDistEmpty)
+ m_xDistBorderMF->set_text("");
+
+ if (bSameIndent)
+ SetMetricValue(*m_xIndentMF, -aNumFmtArr[nLvl]->GetFirstLineOffset(), eCoreUnit);
+ else
+ m_xIndentMF->set_text("");
+
+ m_xSelectionRB->set_active(true);
+
+ m_aPreviewWIN.SetLevel(nActNumLvl);
+ m_aPreviewWIN.Invalidate();
+ bInInitControl = false;
+}
+
+// 0 - Number; 1 - Bullet; 2 - Bitmap
+void SvxBulletAndPositionDlg::SwitchNumberType(sal_uInt8 nType)
+{
+ if (nBullet == nType)
+ return;
+ nBullet = nType;
+ bool bBullet = (nType == SHOW_BULLET);
+ bool bBitmap = (nType == SHOW_BITMAP);
+ bool bEnableBitmap = (nType == SHOW_BITMAP);
+ bool bNumeric = !(bBitmap || bBullet);
+ m_xPrefixFT->set_visible(bNumeric);
+ m_xPrefixED->set_visible(bNumeric);
+ m_xSuffixFT->set_visible(bNumeric);
+ m_xSuffixED->set_visible(bNumeric);
+ m_xBeforeAfter->set_visible(bNumeric);
+
+ m_xStartFT->set_visible(!(bBullet || bBitmap));
+ m_xStartED->set_visible(!(bBullet || bBitmap));
+
+ m_xBulletFT->set_visible(bBullet);
+ m_xBulletPB->set_visible(bBullet);
+ bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
+ m_xBulColorFT->set_visible(!bBitmap && bBullColor);
+ m_xBulColLB->set_visible(!bBitmap && bBullColor);
+ bool bBullResSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
+ m_xBulRelSizeFT->set_visible(!bBitmap && bBullResSize);
+ m_xBulRelSizeMF->set_visible(!bBitmap && bBullResSize);
+
+ m_xBitmapMB->set_visible(bBitmap);
+
+ m_xWidthFT->set_visible(bBitmap);
+ m_xWidthMF->set_visible(bBitmap);
+ m_xHeightFT->set_visible(bBitmap);
+ m_xHeightMF->set_visible(bBitmap);
+ m_xRatioCB->set_visible(bBitmap);
+
+ 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);
+}
+
+void SvxBulletAndPositionDlg::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
+{
+ 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_xStartED->set_min(bNoZeroAllowed ? 1 : 0);
+ if (bIsNull && bNoZeroAllowed)
+ EditModifyHdl_Impl(*m_xStartED);
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, LevelHdl_Impl, weld::TreeView&, rBox, void)
+{
+ sal_uInt16 nSaveNumLvl = nActNumLvl;
+ nActNumLvl = 0;
+ auto aSelectedRows = rBox.get_selected_rows();
+ if (std::find(aSelectedRows.begin(), aSelectedRows.end(), pActNum->GetLevelCount())
+ != aSelectedRows.end()
+ && (aSelectedRows.size() == 1 || nSaveNumLvl != 0xffff))
+ {
+ nActNumLvl = 0xFFFF;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ rBox.unselect(i);
+ }
+ else if (!aSelectedRows.empty())
+ {
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (std::find(aSelectedRows.begin(), aSelectedRows.end(), i) != aSelectedRows.end())
+ nActNumLvl |= nMask;
+ nMask <<= 1;
+ }
+ rBox.unselect(pActNum->GetLevelCount());
+ }
+ else
+ {
+ nActNumLvl = nSaveNumLvl;
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ rBox.select(i);
+ break;
+ }
+ nMask <<= 1;
+ }
+ }
+ InitControls();
+}
+
+IMPL_LINK_NOARG(SvxBulletAndPositionDlg, PreviewInvalidateHdl_Impl, Timer*, void)
+{
+ m_aPreviewWIN.Invalidate();
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl, weld::ComboBox&, rBox, void)
+{
+ OUString sSelectStyle;
+ bool bBmp = false;
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ // PAGEDESC does not exist
+ 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)))
+ {
+ bBmp |= nullptr != aNumFmt.GetBrush();
+ aNumFmt.SetIncludeUpperLevels(0);
+ aNumFmt.SetSuffix("");
+ aNumFmt.SetPrefix("");
+ if (!bBmp)
+ aNumFmt.SetGraphic("");
+ pActNum->SetLevel(i, aNumFmt);
+ SwitchNumberType(SHOW_BITMAP);
+ }
+ else if (SVX_NUM_CHAR_SPECIAL == nNumberingType)
+ {
+ aNumFmt.SetIncludeUpperLevels(0);
+ aNumFmt.SetSuffix("");
+ aNumFmt.SetPrefix("");
+ if (!aNumFmt.GetBulletFont())
+ aNumFmt.SetBulletFont(&aActBulletFont);
+ if (!aNumFmt.GetBulletChar())
+ aNumFmt.SetBulletChar(SVX_DEF_BULLET);
+ pActNum->SetLevel(i, aNumFmt);
+ SwitchNumberType(SHOW_BULLET);
+ // allocation of the drawing pattern is automatic
+ if (bAutomaticCharStyles)
+ {
+ sSelectStyle = m_sBulletCharFormatName;
+ }
+ }
+ else
+ {
+ aNumFmt.SetPrefix(m_xPrefixED->get_text());
+ aNumFmt.SetSuffix(m_xSuffixED->get_text());
+ SwitchNumberType(SHOW_NUMBERING);
+ pActNum->SetLevel(i, aNumFmt);
+ CheckForStartValue_Impl(nNumberingType);
+
+ // allocation of the drawing pattern is automatic
+ if (bAutomaticCharStyles)
+ {
+ sSelectStyle = m_sNumCharFmtName;
+ }
+ }
+ }
+ nMask <<= 1;
+ }
+
+ SetModified();
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, BulColorHdl_Impl, ColorListBox&, rColorBox, void)
+{
+ Color nSetColor = rColorBox.GetSelectEntryColor();
+
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ aNumFmt.SetBulletColor(nSetColor);
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+ SetModified();
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, BulRelSizeHdl_Impl, weld::MetricSpinButton&, rField, void)
+{
+ sal_uInt16 nRelSize = rField.get_value(FieldUnit::PERCENT);
+
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ aNumFmt.SetBulletRelSize(nRelSize);
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+ SetModified();
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, GraphicHdl_Impl, const OString&, rIdent, void)
+{
+ OUString aGrfName;
+ Size aSize;
+ bool bSucc(false);
+ SvxOpenGraphicDialog aGrfDlg(SdResId(RID_SVXSTR_EDIT_GRAPHIC), p_Window);
+
+ OString sNumber;
+ if (rIdent.startsWith("gallery", &sNumber))
+ {
+ auto idx = sNumber.toUInt32();
+ if (idx < aGrfNames.size())
+ {
+ aGrfName = aGrfNames[idx];
+ Graphic aGraphic;
+ if (GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, idx, &aGraphic))
+ {
+ aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
+ bSucc = true;
+ }
+ }
+ }
+ else if (rIdent == "fromfile")
+ {
+ aGrfDlg.EnableLink(false);
+ aGrfDlg.AsLink(false);
+ if (!aGrfDlg.Execute())
+ {
+ // memorize selected filter
+ aGrfName = aGrfDlg.GetPath();
+
+ Graphic aGraphic;
+ if (!aGrfDlg.GetGraphic(aGraphic))
+ {
+ aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
+ bSucc = true;
+ }
+ }
+ }
+ if (bSucc)
+ {
+ aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit));
+
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ aNumFmt.SetCharFormatName(m_sNumCharFmtName);
+ aNumFmt.SetGraphic(aGrfName);
+
+ // set size for a later comparison
+ const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
+ // initiate asynchronous loading
+ sal_Int16 eOrient = aNumFmt.GetVertOrient();
+ aNumFmt.SetGraphicBrush(pBrushItem, &aSize, &eOrient);
+ aInitSize[i] = aNumFmt.GetGraphicSize();
+
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+ 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);
+
+ SetModified();
+ //needed due to asynchronous loading of graphics in the SvxBrushItem
+ aInvalidateTimer.Start();
+ }
+}
+
+IMPL_LINK_NOARG(SvxBulletAndPositionDlg, PopupActivateHdl_Impl, weld::ToggleButton&, void)
+{
+ if (!m_xGalleryMenu)
+ {
+ m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
+ weld::WaitObject aWait(p_Window);
+
+ if (GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames))
+ {
+ GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
+
+ Graphic aGraphic;
+ OUString sGrfName;
+ ScopedVclPtrInstance<VirtualDevice> pVD;
+ size_t i = 0;
+ for (auto& grfName : aGrfNames)
+ {
+ sGrfName = grfName;
+ OUString sItemId = "gallery" + OUString::number(i);
+ INetURLObject aObj(sGrfName);
+ if (aObj.GetProtocol() == INetProtocol::File)
+ sGrfName = aObj.PathToFileName();
+ if (GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, i, &aGraphic))
+ {
+ BitmapEx aBitmap(aGraphic.GetBitmapEx());
+ Size aSize(aBitmap.GetSizePixel());
+ if (aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
+ {
+ bool bWidth = aSize.Width() > aSize.Height();
+ double nScale
+ = bWidth ? double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width())
+ : double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
+ aBitmap.Scale(nScale, nScale);
+ }
+ pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
+ pVD->DrawBitmapEx(Point(), aBitmap);
+ m_xGalleryMenu->append(sItemId, sGrfName, *pVD);
+ }
+ else
+ {
+ m_xGalleryMenu->append(sItemId, sGrfName);
+ }
+ ++i;
+ }
+ GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
+ }
+ }
+}
+
+IMPL_LINK_NOARG(SvxBulletAndPositionDlg, BulletHdl_Impl, weld::Button&, void)
+{
+ SvxCharacterMap aMap(p_Window, nullptr, nullptr);
+
+ sal_uInt16 nMask = 1;
+ const vcl::Font* pFmtFont = nullptr;
+ bool bSameBullet = true;
+ sal_Unicode cBullet = 0;
+ bool bFirst = true;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ const SvxNumberFormat& rCurFmt = pActNum->GetLevel(i);
+ if (bFirst)
+ {
+ cBullet = rCurFmt.GetBulletChar();
+ }
+ else if (rCurFmt.GetBulletChar() != cBullet)
+ {
+ bSameBullet = false;
+ break;
+ }
+ if (!pFmtFont)
+ pFmtFont = rCurFmt.GetBulletFont();
+ bFirst = false;
+ }
+ nMask <<= 1;
+ }
+
+ if (pFmtFont)
+ aMap.SetCharFont(*pFmtFont);
+ else
+ aMap.SetCharFont(aActBulletFont);
+ if (bSameBullet)
+ aMap.SetChar(cBullet);
+ if (aMap.run() == RET_OK)
+ {
+ // change Font Numrules
+ aActBulletFont = aMap.GetCharFont();
+
+ sal_uInt16 _nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & _nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ aNumFmt.SetBulletFont(&aActBulletFont);
+ aNumFmt.SetBulletChar(static_cast<sal_Unicode>(aMap.GetChar()));
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ _nMask <<= 1;
+ }
+
+ SetModified();
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, SizeHdl_Impl, weld::MetricSpinButton&, rField, void)
+{
+ bool bWidth = &rField == m_xWidthMF.get();
+ bLastWidthModified = bWidth;
+ bool bRatio = m_xRatioCB->get_active();
+ long nWidthVal
+ = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH)));
+ long nHeightVal
+ = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH)));
+ nWidthVal = OutputDevice::LogicToLogic(nWidthVal, MapUnit::Map100thMM, eCoreUnit);
+ nHeightVal = OutputDevice::LogicToLogic(nHeightVal, MapUnit::Map100thMM, eCoreUnit);
+ double fSizeRatio;
+
+ bool bRepaint = false;
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ if (SVX_NUM_BITMAP == (aNumFmt.GetNumberingType() & (~LINK_TOKEN)))
+ {
+ Size aSize(aNumFmt.GetGraphicSize());
+ Size aSaveSize(aSize);
+
+ if (aInitSize[i].Height())
+ fSizeRatio = static_cast<double>(aInitSize[i].Width())
+ / static_cast<double>(aInitSize[i].Height());
+ else
+ fSizeRatio = double(1);
+
+ if (bWidth)
+ {
+ long nDelta = nWidthVal - aInitSize[i].Width();
+ aSize.setWidth(nWidthVal);
+ if (bRatio)
+ {
+ aSize.setHeight(
+ aInitSize[i].Height()
+ + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio));
+ m_xHeightMF->set_value(m_xHeightMF->normalize(OutputDevice::LogicToLogic(
+ aSize.Height(), eCoreUnit, MapUnit::Map100thMM)),
+ FieldUnit::MM_100TH);
+ }
+ }
+ else
+ {
+ long nDelta = nHeightVal - aInitSize[i].Height();
+ aSize.setHeight(nHeightVal);
+ if (bRatio)
+ {
+ aSize.setWidth(
+ aInitSize[i].Width()
+ + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio));
+ m_xWidthMF->set_value(m_xWidthMF->normalize(OutputDevice::LogicToLogic(
+ aSize.Width(), eCoreUnit, MapUnit::Map100thMM)),
+ FieldUnit::MM_100TH);
+ }
+ }
+ const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
+ sal_Int16 eOrient = aNumFmt.GetVertOrient();
+ if (aSize != aSaveSize)
+ bRepaint = true;
+ aNumFmt.SetGraphicBrush(pBrushItem, &aSize, &eOrient);
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ }
+ nMask <<= 1;
+ }
+ SetModified(bRepaint);
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, RatioHdl_Impl, weld::ToggleButton&, rBox, void)
+{
+ if (rBox.get_active())
+ {
+ if (bLastWidthModified)
+ SizeHdl_Impl(*m_xWidthMF);
+ else
+ SizeHdl_Impl(*m_xHeightMF);
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, SelectLeftAlignmentHdl_Impl, weld::ToggleButton&, rButton, void)
+{
+ if (rButton.get_active())
+ {
+ SetAlignmentHdl_Impl(SvxAdjust::Left);
+
+ m_xCenterTB->set_active(false);
+ m_xRightTB->set_active(false);
+
+ SetModified();
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, SelectCenterAlignmentHdl_Impl, weld::ToggleButton&, rButton,
+ void)
+{
+ if (rButton.get_active())
+ {
+ SetAlignmentHdl_Impl(SvxAdjust::Center);
+
+ m_xLeftTB->set_active(false);
+ m_xRightTB->set_active(false);
+
+ SetModified();
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, SelectRightAlignmentHdl_Impl, weld::ToggleButton&, rButton, void)
+{
+ if (rButton.get_active())
+ {
+ SetAlignmentHdl_Impl(SvxAdjust::Right);
+
+ m_xLeftTB->set_active(false);
+ m_xCenterTB->set_active(false);
+
+ SetModified();
+ }
+}
+
+void SvxBulletAndPositionDlg::SetAlignmentHdl_Impl(SvxAdjust eAdjust)
+{
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ aNumFmt.SetNumAdjust(eAdjust);
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, ApplyToMasterHdl_Impl, weld::ToggleButton&, rButton, void)
+{
+ bApplyToMaster = rButton.get_active();
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, EditModifyHdl_Impl, weld::Entry&, rEdit, void)
+{
+ EditModifyHdl_Impl(&rEdit);
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, DistanceHdl_Impl, weld::MetricSpinButton&, rFld, void)
+{
+ if (bInInitControl)
+ return;
+ long nValue = GetCoreValue(rFld, eCoreUnit);
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ if (&rFld == m_xDistBorderMF.get())
+ {
+ if (m_xRelativeCB->get_active())
+ {
+ if (0 == i)
+ {
+ auto const nTmp = aNumFmt.GetFirstLineOffset();
+ aNumFmt.SetAbsLSpace(nValue - nTmp);
+ }
+ else
+ {
+ long nTmp = pActNum->GetLevel(i - 1).GetAbsLSpace()
+ + pActNum->GetLevel(i - 1).GetFirstLineOffset()
+ - pActNum->GetLevel(i).GetFirstLineOffset();
+
+ aNumFmt.SetAbsLSpace(nValue + nTmp);
+ }
+ }
+ else
+ {
+ aNumFmt.SetAbsLSpace(nValue - aNumFmt.GetFirstLineOffset());
+ }
+ }
+ else if (&rFld == m_xIndentMF.get())
+ {
+ // together with the FirstLineOffset the AbsLSpace must be changed, too
+ long nDiff = nValue + aNumFmt.GetFirstLineOffset();
+ auto const nAbsLSpace = aNumFmt.GetAbsLSpace();
+ aNumFmt.SetAbsLSpace(nAbsLSpace + nDiff);
+ aNumFmt.SetFirstLineOffset(-nValue);
+ }
+
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+
+ SetModified();
+ if (!m_xDistBorderMF->get_sensitive())
+ {
+ m_xDistBorderMF->set_text("");
+ }
+}
+
+IMPL_LINK(SvxBulletAndPositionDlg, RelativeHdl_Impl, weld::ToggleButton&, rBox, void)
+{
+ bool bOn = rBox.get_active();
+ bool bSingleSelection = m_xLevelLB->count_selected_rows() == 1 && SAL_MAX_UINT16 != nActNumLvl;
+ bool bSetValue = false;
+ long nValue = 0;
+ if (bOn || bSingleSelection)
+ {
+ sal_uInt16 nMask = 1;
+ bool bFirst = true;
+ bSetValue = true;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ const SvxNumberFormat& rNumFmt = pActNum->GetLevel(i);
+ if (bFirst)
+ {
+ nValue = rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset();
+ if (bOn && i)
+ nValue -= (pActNum->GetLevel(i - 1).GetAbsLSpace()
+ + pActNum->GetLevel(i - 1).GetFirstLineOffset());
+ }
+ else
+ bSetValue = nValue
+ == (rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset())
+ - (pActNum->GetLevel(i - 1).GetAbsLSpace()
+ + pActNum->GetLevel(i - 1).GetFirstLineOffset());
+ bFirst = false;
+ }
+ nMask <<= 1;
+ }
+ }
+ if (bSetValue)
+ SetMetricValue(*m_xDistBorderMF, nValue, eCoreUnit);
+ else
+ m_xDistBorderMF->set_text("");
+ m_xDistBorderMF->set_sensitive(bOn || bSingleSelection);
+ m_xDistBorderFT->set_sensitive(bOn || bSingleSelection);
+ bLastRelative = bOn;
+}
+
+void SvxBulletAndPositionDlg::EditModifyHdl_Impl(const weld::Entry* pEdit)
+{
+ 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++)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ if (bPrefix)
+ aNumFmt.SetPrefix(m_xPrefixED->get_text());
+ else if (bSuffix)
+ aNumFmt.SetSuffix(m_xSuffixED->get_text());
+ else if (bStart)
+ aNumFmt.SetStart(m_xStartED->get_value());
+ pActNum->SetLevel(i, aNumFmt);
+ }
+ nMask <<= 1;
+ }
+ SetModified();
+}
+
+void SvxBulletAndPositionDlg::SetModified(bool bRepaint)
+{
+ bModified = true;
+ if (bRepaint)
+ {
+ m_aPreviewWIN.SetLevel(nActNumLvl);
+ m_aPreviewWIN.Invalidate();
+ }
+}
+
+void SvxBulletAndPositionDlg::InitPosAndSpaceMode()
+{
+ if (pActNum == nullptr)
+ {
+ SAL_WARN("cui.tabpages", "<SvxNumPositionTabPage::InitPosAndSpaceMode()> - misusage of "
+ "method -> <pAktNum> has to be already set!");
+ return;
+ }
+
+ SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode = SvxNumberFormat::LABEL_ALIGNMENT;
+ sal_uInt16 nMask = 1;
+ for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i)
+ {
+ if (nActNumLvl & nMask)
+ {
+ SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
+ ePosAndSpaceMode = aNumFmt.GetPositionAndSpaceMode();
+ if (ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT)
+ {
+ break;
+ }
+ }
+ nMask <<= 1;
+ }
+
+ bLabelAlignmentPosAndSpaceModeActive = ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 0f8507b9a6dd..05353b7bcecd 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -46,11 +46,31 @@
IMPL_ABSTDLG_BASE(SdVclAbstractDialog_Impl);
+short AbstractSvxBulletAndPositionDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
short SdAbstractGenericDialog_Impl::Execute()
{
return m_xDlg->run();
}
+const SfxItemSet* AbstractSvxBulletAndPositionDlg_Impl::GetOutputItemSet( SfxItemSet* pSet ) const
+{
+ return m_xDlg->GetOutputItemSet( pSet );
+}
+
+bool AbstractSvxBulletAndPositionDlg_Impl::IsApplyToMaster()
+{
+ return m_xDlg->IsApplyToMaster();
+}
+
+bool AbstractSvxBulletAndPositionDlg_Impl::IsSlideScope()
+{
+ return m_xDlg->IsSlideScope();
+}
+
short AbstractCopyDlg_Impl::Execute()
{
return m_xDlg->run();
@@ -362,6 +382,11 @@ void AbstractSdPublishingDlg_Impl::GetParameterSequence( css::uno::Sequence< css
//-------------- SdAbstractDialogFactory implementation--------------
+VclPtr<AbstractSvxBulletAndPositionDlg> SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView)
+{
+ return VclPtr<AbstractSvxBulletAndPositionDlg_Impl>::Create(std::make_unique<SvxBulletAndPositionDlg>(pParent, *pAttr, pView));
+}
+
VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateBreakDlg(
weld::Window* pParent,
::sd::DrawView* pDrView,
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index b14705c519ee..389211e1c119 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -22,6 +22,7 @@
#include <sdabstdlg.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/sfxdlg.hxx>
+#include <svx/svxdlg.hxx>
#include <morphdlg.hxx>
#include <copydlg.hxx>
@@ -38,6 +39,7 @@
#include <dlgsnap.hxx>
#include <present.hxx>
#include <vectdlg.hxx>
+#include <BulletAndPositionDlg.hxx>
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
ScopedVclPtr<DialogClass> pDlg; \
@@ -79,6 +81,23 @@ bool Class::StartExecuteAsync(AsyncContext &ctx) \
// class MasterLayoutDialog;
//}
+class SvxBulletAndPositionDlg;
+
+class AbstractSvxBulletAndPositionDlg_Impl :public AbstractSvxBulletAndPositionDlg
+{
+ std::unique_ptr<SvxBulletAndPositionDlg> m_xDlg;
+public:
+ explicit AbstractSvxBulletAndPositionDlg_Impl(std::unique_ptr<SvxBulletAndPositionDlg> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual const SfxItemSet* GetOutputItemSet( SfxItemSet* ) const override ;
+ virtual bool IsApplyToMaster() override;
+ virtual bool IsSlideScope() override;
+};
+
+
class SdVclAbstractDialog_Impl : public VclAbstractDialog
{
DECL_ABSTDLG_BASE(SdVclAbstractDialog_Impl,Dialog)
@@ -343,6 +362,7 @@ class SdAbstractDialogFactory_Impl : public SdAbstractDialogFactory
public:
virtual ~SdAbstractDialogFactory_Impl() {}
+ virtual VclPtr<AbstractSvxBulletAndPositionDlg> CreateSvxBulletAndPositionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
virtual VclPtr<VclAbstractDialog> CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) override;
virtual VclPtr<AbstractCopyDlg> CreateCopyDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) override;
virtual VclPtr<AbstractSdCustomShowDlg> CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc) override;
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 7c1322b7673f..df5aa7277bdf 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -37,7 +37,9 @@
#include <svx/nbdtmg.hxx>
#include <svx/nbdtmgfact.hxx>
#include <svx/svdoutl.hxx>
+#include <sdabstdlg.hxx>
#include <memory>
+#include <sdpage.hxx>
using namespace svx::sidebar;
namespace sd {
@@ -362,6 +364,306 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u
return pTmpItem;
}
+
+// New merged dialog
+
+
+FuBulletAndPosition::FuBulletAndPosition(ViewShell* pViewShell, ::sd::Window* pWindow,
+ ::sd::View* pView, SdDrawDocument* pDoc,
+ SfxRequest& rReq)
+ : FuPoor(pViewShell, pWindow, pView, pDoc, rReq)
+{
+}
+
+rtl::Reference<FuPoor> FuBulletAndPosition::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
+{
+ rtl::Reference<FuPoor> xFunc( new FuBulletAndPosition( pViewSh, pWin, pView, pDoc, rReq ) );
+ xFunc->DoExecute(rReq);
+ return xFunc;
+}
+
+void FuBulletAndPosition::DoExecute( SfxRequest& rReq )
+{
+ const sal_uInt16 nSId = rReq.GetSlot();
+ if ( nSId == FN_SVX_SET_BULLET || nSId == FN_SVX_SET_NUMBER )
+ {
+ SetCurrentBulletsNumbering(rReq);
+ return;
+ }
+
+ const SfxItemSet* pArgs = rReq.GetArgs();
+ const SfxStringItem* pPageItem = SfxItemSet::GetItem<SfxStringItem>(pArgs, FN_PARAM_1, false);
+
+ if ( pArgs && !pPageItem )
+ {
+ /* not direct to pOlView; therefore, SdDrawView::SetAttributes can catch
+ changes to master page and redirect to a template */
+ mpView->SetAttributes(*pArgs);
+ return;
+ }
+
+ // fill ItemSet for Dialog
+ SfxItemSet aEditAttr( mpDoc->GetPool() );
+ mpView->GetAttributes( aEditAttr );
+
+ SfxItemSet aNewAttr( mpViewShell->GetPool(),
+ svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
+ aNewAttr.Put( aEditAttr, false );
+
+ auto pView = mpView;
+
+ // create and execute dialog
+ SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
+ ScopedVclPtr<AbstractSvxBulletAndPositionDlg> pDlg(pFact->CreateSvxBulletAndPositionDlg(mpViewShell->GetFrameWeld(), &aNewAttr, mpView));
+ sal_uInt16 nResult = pDlg->Execute();
+
+ if( nResult == RET_OK )
+ {
+ const SfxItemSet pOutputSet( *pDlg->GetOutputItemSet( &aNewAttr ) );
+ pView->SetAttributes(pOutputSet, /*bReplaceAll=*/false, /*bSlide*/ pDlg->IsSlideScope(), /*bMaster=*/pDlg->IsApplyToMaster());
+ }
+
+ rReq.Done();
+}
+
+void FuBulletAndPosition::SetCurrentBulletsNumbering(SfxRequest& rReq)
+{
+ if (!mpDoc || !mpView)
+ return;
+
+ const sal_uInt16 nSId = rReq.GetSlot();
+ if ( nSId != FN_SVX_SET_BULLET && nSId != FN_SVX_SET_NUMBER )
+ {
+ // unexpected SfxRequest
+ return;
+ }
+
+ const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSId);
+ if ( !pItem )
+ {
+ rReq.Done();
+ return;
+ }
+
+ SfxItemSet aNewAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
+ {
+ SfxItemSet aEditAttr( mpDoc->GetPool() );
+ mpView->GetAttributes( aEditAttr );
+ aNewAttr.Put( aEditAttr, false );
+ }
+
+ const DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+ //Init bullet level in "Customize" tab page in bullet dialog in master page view
+ const bool bInMasterView = pDrawViewShell && pDrawViewShell->GetEditMode() == EditMode::MasterPage;
+ if ( bInMasterView )
+ {
+ SdrObject* pObj = mpView->GetTextEditObject();
+ if( pObj && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT )
+ {
+ const sal_uInt16 nLevel = mpView->GetSelectionLevel();
+ if( nLevel != 0xFFFF )
+ {
+ //save the itemset value
+ SfxItemSet aStoreSet( aNewAttr );
+ aNewAttr.ClearItem();
+ //extend range
+ aNewAttr.MergeRange( SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL );
+ aNewAttr.Put( aStoreSet );
+ //put current level user selected
+ aNewAttr.Put( SfxUInt16Item( SID_PARAM_CUR_NUM_LEVEL, nLevel ) );
+ }
+ }
+ }
+
+ sal_uInt16 nIdx = pItem->GetValue();
+ bool bToggle = false;
+ if( nIdx == sal_uInt16(0xFFFF) )
+ {
+ // If the nIdx is (sal_uInt16)0xFFFF, means set bullet status to on/off
+ nIdx = 1;
+ bToggle = true;
+ }
+ nIdx--;
+
+ sal_uInt32 nNumItemId = SID_ATTR_NUMBERING_RULE;
+ const SfxPoolItem* pTmpItem = GetNumBulletItem( aNewAttr, nNumItemId );
+ std::unique_ptr<SvxNumRule> pNumRule;
+ if ( pTmpItem )
+ {
+ pNumRule.reset(new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pTmpItem)->GetNumRule()));
+
+ // get numbering rule corresponding to <nIdx> and apply the needed number formats to <pNumRule>
+ NBOTypeMgrBase* pNumRuleMgr =
+ NBOutlineTypeMgrFact::CreateInstance(
+ nSId == FN_SVX_SET_BULLET ? NBOType::Bullets : NBOType::Numbering );
+ if ( pNumRuleMgr )
+ {
+ sal_uInt16 nActNumLvl = sal_uInt16(0xFFFF);
+ const SfxPoolItem* pNumLevelItem = nullptr;
+ if(SfxItemState::SET == aNewAttr.GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pNumLevelItem))
+ nActNumLvl = static_cast<const SfxUInt16Item*>(pNumLevelItem)->GetValue();
+
+ pNumRuleMgr->SetItems(&aNewAttr);
+ SvxNumRule aTmpRule( *pNumRule );
+ if ( nSId == FN_SVX_SET_BULLET && bToggle && nIdx==0 )
+ {
+ // for toggling bullets get default numbering rule
+ pNumRuleMgr->ApplyNumRule( aTmpRule, nIdx, nActNumLvl, true );
+ }
+ else
+ {
+ pNumRuleMgr->ApplyNumRule( aTmpRule, nIdx, nActNumLvl );
+ }
+
+ sal_uInt16 nMask = 1;
+ for(sal_uInt16 i = 0; i < pNumRule->GetLevelCount(); i++)
+ {
+ if(nActNumLvl & nMask)
+ {
+ const SvxNumberFormat& aFmt(aTmpRule.GetLevel(i));
+ pNumRule->SetLevel(i, aFmt);
+ }
+ nMask <<= 1;
+ }
+ }
+ }
+
+ OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+ std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
+ if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
+ {
+ pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
+ aGuard.reset(new OutlineViewModelChangeGuard(*pView));
+ }
+
+ SdrOutliner* pOwner = bInMasterView ? mpView->GetTextEditOutliner() : nullptr;
+ const bool bOutlinerUndoEnabled = pOwner && !pOwner->IsInUndo() && pOwner->IsUndoEnabled();
+ SdrModel* pSdrModel = bInMasterView ? mpView->GetModel() : nullptr;
+ const bool bModelUndoEnabled = pSdrModel && pSdrModel->IsUndoEnabled();
+
+ if ( bOutlinerUndoEnabled )
+ {
+ pOwner->UndoActionStart( OLUNDO_ATTR );
+ }
+ else if ( bModelUndoEnabled )
+ {
+ pSdrModel->BegUndo();
+ }
+
+ if ( pOLV )
+ {
+ pOLV->ToggleBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? nullptr : pNumRule.get() );
+ }
+ else
+ {
+ mpView->ChangeMarkedObjectsBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? nullptr : pNumRule.get() );
+ }
+
+ if (bInMasterView && pNumRule)
+ {
+ SfxItemSet aSetAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
+ aSetAttr.Put(SvxNumBulletItem( *pNumRule, nNumItemId ));
+ mpView->SetAttributes(aSetAttr);
+ }
+
+ if( bOutlinerUndoEnabled )
+ {
+ pOwner->UndoActionEnd();
+ }
+ else if ( bModelUndoEnabled )
+ {
+ pSdrModel->EndUndo();
+ }
+
+ pNumRule.reset();
+ rReq.Done();
+}
+
+const SfxPoolItem* FuBulletAndPosition::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt32& nNumItemId)
+{
+ //SvxNumBulletItem* pRetItem = NULL;
+ const SfxPoolItem* pTmpItem = nullptr;
+
+ if(aNewAttr.GetItemState(nNumItemId, false, &pTmpItem) == SfxItemState::SET)
+ {
+ return pTmpItem;
+ }
+ else
+ {
+ nNumItemId = aNewAttr.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+ SfxItemState eState = aNewAttr.GetItemState(nNumItemId, false, &pTmpItem);
+ if (eState == SfxItemState::SET)
+ return pTmpItem;
+ else
+ {
+ bool bOutliner = false;
+ bool bTitle = false;
+
+ if( mpView )
+ {
+ const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ const size_t nCount = rMarkList.GetMarkCount();
+
+ for(size_t nNum = 0; nNum < nCount; ++nNum)
+ {
+ SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj();
+ if( pObj->GetObjInventor() == SdrInventor::Default )
+ {
+ switch(pObj->GetObjIdentifier())
+ {
+ case OBJ_TITLETEXT:
+ bTitle = true;
+ break;
+ case OBJ_OUTLINETEXT:
+ bOutliner = true;
+ break;
+ }
+ }
+ }
+ }
+
+ const SvxNumBulletItem *pItem = nullptr;
+ if(bOutliner)
+ {
+ SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool();
+ SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( STR_LAYOUT_OUTLINE " 1", SfxStyleFamily::Pseudo);
+ if( pFirstStyleSheet )
+ pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pItem));
+ }
+
+ if( pItem == nullptr )
+ pItem = aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET);
+
+ //DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in the Pool!" );
+
+ std::unique_ptr<SfxPoolItem> pNewItem(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
+ aNewAttr.Put(*pNewItem);
+
+ if(bTitle && aNewAttr.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
+ {
+ const SvxNumBulletItem* pBulletItem = aNewAttr.GetItem(EE_PARA_NUMBULLET);
+ SvxNumRule* pLclRule = pBulletItem->GetNumRule();
+ if(pLclRule)
+ {
+ SvxNumRule aNewRule( *pLclRule );
+ aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS );
+
+ SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
+ aNewAttr.Put(aNewItem);
+ }
+ }
+
+ SfxItemState eItemState = aNewAttr.GetItemState(nNumItemId, false, &pTmpItem);
+ if (eItemState == SfxItemState::SET)
+ return pTmpItem;
+
+ }
+ //DBG_ASSERT(eState == SfxItemState::SET, "No item found");
+ }
+ return pTmpItem;
+}
+
+
} // end of namespace sd
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/BulletAndPositionDlg.hxx b/sd/source/ui/inc/BulletAndPositionDlg.hxx
new file mode 100644
index 000000000000..3ddaff6095af
--- /dev/null
+++ b/sd/source/ui/inc/BulletAndPositionDlg.hxx
@@ -0,0 +1,171 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SD_SOURCE_UI_INC_BULLETANDPOSITIONDIALOG_HXX
+#define INCLUDED_SD_SOURCE_UI_INC_BULLETANDPOSITIONDIALOG_HXX
+
+#include <vector>
+#include <memory>
+
+#include <sfx2/tabdlg.hxx>
+#include <svx/Palette.hxx>
+#include <editeng/numdef.hxx>
+#include <editeng/svxenum.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <vcl/weld.hxx>
+#include "View.hxx"
+#include <cui/numberingpreview.hxx>
+
+#define MN_GALLERY_ENTRY 100
+
+class ColorListBox;
+class NumValueSet;
+class SvxNumRule;
+class SvxBmpNumValueSet;
+class SvxBrushItem;
+class ValueSet;
+class SdDrawDocument;
+
+namespace sd
+{
+class View;
+}
+
+class SvxBulletAndPositionDlg : public weld::GenericDialogController
+{
+ OUString m_sNumCharFmtName;
+ OUString m_sBulletCharFormatName;
+
+ Timer aInvalidateTimer;
+
+ std::unique_ptr<SvxNumRule> pActNum;
+ std::unique_ptr<SvxNumRule> pSaveNum;
+
+ Size aInitSize[SVX_MAX_NUM];
+
+ bool bLastWidthModified : 1;
+ bool bModified : 1;
+ bool bPreset : 1;
+ bool bAutomaticCharStyles : 1;
+ bool bHTMLMode : 1;
+ bool bInInitControl : 1; // workaround for Modify-error, is said to be corrected from 391 on
+ bool bLabelAlignmentPosAndSpaceModeActive;
+ bool bApplyToMaster;
+ bool bIsSlideScope;
+
+ std::vector<OUString> aGrfNames;
+ vcl::Font aActBulletFont;
+
+ sal_uInt8 nBullet;
+ sal_uInt16 nActNumLvl;
+ weld::Window* p_Window;
+ sal_uInt16 nNumItemId;
+ MapUnit eCoreUnit;
+ ::sd::View* p_View;
+
+ SvxNumberingPreview m_aPreviewWIN;
+ std::unique_ptr<weld::Widget> m_xGrid;
+ std::unique_ptr<weld::TreeView> m_xLevelLB;
+ std::unique_ptr<weld::ComboBox> m_xFmtLB;
+ 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::Expander> m_xBeforeAfter;
+ 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_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::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::Menu> m_xGalleryMenu;
+ std::unique_ptr<weld::CustomWeld> m_xPreviewWIN;
+ std::unique_ptr<weld::Label> m_xDistBorderFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xDistBorderMF;
+ std::unique_ptr<weld::CheckButton> m_xRelativeCB;
+ std::unique_ptr<weld::Label> m_xIndentFT;
+ std::unique_ptr<weld::MetricSpinButton> m_xIndentMF;
+ std::unique_ptr<weld::ToggleButton> m_xLeftTB;
+ std::unique_ptr<weld::ToggleButton> m_xCenterTB;
+ std::unique_ptr<weld::ToggleButton> m_xRightTB;
+ std::unique_ptr<weld::RadioButton> m_xSlideRB;
+ std::unique_ptr<weld::RadioButton> m_xSelectionRB;
+ std::unique_ptr<weld::ToggleButton> m_xApplyToMaster;
+
+ void InitControls();
+ /** To switch between the numbering type
+ 0 - Number;
+ 1 - Bullet;
+ 2 - Bitmap; */
+ void SwitchNumberType(sal_uInt8 nType);
+ void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
+
+ 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(EditModifyHdl_Impl, weld::Entry&, 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);
+ DECL_LINK(DistanceHdl_Impl, weld::MetricSpinButton&, void);
+ DECL_LINK(RelativeHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(SelectLeftAlignmentHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(SelectCenterAlignmentHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(SelectRightAlignmentHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(ApplyToMasterHdl_Impl, weld::ToggleButton&, void);
+ void EditModifyHdl_Impl(const weld::Entry*);
+ void InitPosAndSpaceMode();
+ void SetAlignmentHdl_Impl(SvxAdjust);
+
+public:
+ SvxBulletAndPositionDlg(weld::Window* pWindow, const SfxItemSet& rSet, ::sd::View* pView);
+ virtual ~SvxBulletAndPositionDlg() override;
+ virtual void dispose();
+
+ SfxItemSet* GetOutputItemSet(SfxItemSet* rSet);
+ bool IsApplyToMaster();
+ bool IsSlideScope();
+ void Reset(const SfxItemSet* rSet);
+
+ void SetCharFmts(const OUString& rNumName, const OUString& rBulletName)
+ {
+ m_sNumCharFmtName = rNumName;
+ m_sBulletCharFormatName = rBulletName;
+ }
+ void SetMetric(FieldUnit eSet);
+
+ void SetModified(bool bRepaint = true);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index e02f8a5516ab..c9151846efcf 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -110,7 +110,7 @@ public:
void PrepareClose();
virtual void GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const override;
- virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false) override;
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, bool bSlide = false, bool bMaster = false) override;
void FillOutliner();
void SetLinks();
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index e88424122877..2c4bf3bb1357 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -79,7 +79,7 @@ public:
void CompleteRedraw( OutputDevice* pOutDev, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
virtual void GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const;
- virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false);
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, bool bSlide = false, bool bMaster = false);
virtual void MarkListHasChanged() override;
void SelectAll();
void DoCut();
diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx
index 1a15b37ca446..3e410c1422c0 100644
--- a/sd/source/ui/inc/drawview.hxx
+++ b/sd/source/ui/inc/drawview.hxx
@@ -43,7 +43,8 @@ public:
virtual void MarkListHasChanged() override;
void CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) override;
- virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false) override;
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false, bool bSlide = false, bool bMaster = false) override;
+ void SetMasterAttributes(SdrObject* pObject, SdPage& rPage, SfxItemSet rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide);
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/sd/source/ui/inc/fuolbull.hxx b/sd/source/ui/inc/fuolbull.hxx
index 383cd2d412ab..7a5ff9bac2e3 100644
--- a/sd/source/ui/inc/fuolbull.hxx
+++ b/sd/source/ui/inc/fuolbull.hxx
@@ -56,6 +56,30 @@ private:
const SfxPoolItem* GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt32& nNumItemId);
};
+/**
+ * New merged bullet and position functions in outline mode
+ */
+class FuBulletAndPosition
+ : public FuPoor
+{
+public:
+
+ static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
+ virtual void DoExecute( SfxRequest& rReq ) override;
+
+private:
+ FuBulletAndPosition (
+ ViewShell* pViewShell,
+ ::sd::Window* pWin,
+ ::sd::View* pView,
+ SdDrawDocument* pDoc,
+ SfxRequest& rReq);
+
+ void SetCurrentBulletsNumbering(SfxRequest& rReq);
+
+ const SfxPoolItem* GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt32& nNumItemId);
+};
+
} // end of namespace sd
#endif
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index eb5613c1742b..b67fb350ca3a 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -132,12 +132,38 @@ void DrawView::ModelHasChanged()
*/
bool DrawView::SetAttributes(const SfxItemSet& rSet,
- bool bReplaceAll)
+ bool bReplaceAll, bool bSlide, bool bMaster)
{
bool bOk = false;
+ if (mpDrawViewShell && bMaster)
+ {
+ SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
+ SdPage& rPage = *mpDrawViewShell->getCurrentPage();
+ SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
+ size_t nObjCount = rMasterPage.GetObjCount();
+ for (size_t nObj = 0; nObj < nObjCount; ++nObj)
+ {
+ SdrObject* pObject = rMasterPage.GetObj(nObj);
+ SetMasterAttributes(pObject, rPage, rSet, pStShPool, bOk, bMaster, bSlide);
+ }
+ return bOk;
+ }
+ if (mpDrawViewShell && bSlide)
+ {
+ SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
+ SdPage& rPage = *mpDrawViewShell->getCurrentPage();
+ size_t nObjCount = rPage.GetObjCount();
+ for (size_t nObj = 0; nObj < nObjCount; ++nObj)
+ {
+ SdrObject* pObject = rPage.GetObj(nObj);
+ SetMasterAttributes(pObject, rPage, rSet, pStShPool, bOk, bMaster, bSlide);
+ }
+ return bOk;
+ }
+
// is there a masterpage edit?
- if ( mpDrawViewShell && mpDrawViewShell->GetEditMode() == EditMode::MasterPage )
+ if ( mpDrawViewShell && (mpDrawViewShell->GetEditMode() == EditMode::MasterPage) )
{
SfxStyleSheetBasePool* pStShPool = mrDoc.GetStyleSheetPool();
SdPage& rPage = *mpDrawViewShell->getCurrentPage();
@@ -274,100 +300,124 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
for (size_t nMark = 0; nMark < nMarkCount; ++nMark)
{
SdrObject* pObject = rList.GetMark(nMark)->GetMarkedSdrObj();
- SdrInventor nInv = pObject->GetObjInventor();
+ SetMasterAttributes(pObject, rPage, rSet, pStShPool, bOk, bMaster, bSlide);
+ }
- if (nInv == SdrInventor::Default)
- {
- sal_uInt16 eObjKind = pObject->GetObjIdentifier();
- PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
+ if(!bOk)
+ bOk = ::sd::View::SetAttributes(rSet, bReplaceAll);
+ }
+ }
+ else // not at masterpage
+ {
+ bOk = ::sd::View::SetAttributes(rSet, bReplaceAll);
+ }
- if (ePresObjKind == PRESOBJ_TITLE ||
- ePresObjKind == PRESOBJ_NOTES)
- {
- // Presentation object (except outline)
- SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
- DBG_ASSERT(pSheet, "StyleSheet not found");
+ return bOk;
+}
- SfxItemSet aTempSet( pSheet->GetItemSet() );
- aTempSet.Put( rSet );
- aTempSet.ClearInvalidItems();
+void DrawView::SetMasterAttributes( SdrObject* pObject, SdPage& rPage, SfxItemSet rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool /*bMaster*/, bool bSlide )
+{
+ SdrInventor nInv = pObject->GetObjInventor();
- // Undo-Action
- mpDocSh->GetUndoManager()->AddUndoAction(
- std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
+ if (nInv == SdrInventor::Default)
+ {
+ sal_uInt16 eObjKind = pObject->GetObjIdentifier();
+ PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
+ if (bSlide && eObjKind == OBJ_TEXT)
+ {
+ // Presentation object (except outline)
+ SfxStyleSheet* pSheet = rPage.GetTextStyleSheetForObject(pObject);
+ DBG_ASSERT(pSheet, "StyleSheet not found");
- pSheet->GetItemSet().Put(aTempSet,false);
- pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
- bOk = true;
- }
- else if (eObjKind == OBJ_OUTLINETEXT)
- {
- // Presentation object outline
- for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--)
- {
- OUString aName = rPage.GetLayoutName() + " " +
- OUString::number(nLevel);
- SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool->
- Find(aName, SfxStyleFamily::Page));
- DBG_ASSERT(pSheet, "StyleSheet not found");
+ SfxItemSet aTempSet( pSheet->GetItemSet() );
+ aTempSet.Put( rSet );
+ aTempSet.ClearInvalidItems();
- SfxItemSet aTempSet( pSheet->GetItemSet() );
+ // Undo-Action
+ mpDocSh->GetUndoManager()->AddUndoAction(
+ std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
- if( nLevel > 1 )
- {
- // for all levels over 1, clear all items that will be
- // hard set to level 1
- SfxWhichIter aWhichIter(rSet);
- sal_uInt16 nWhich(aWhichIter.FirstWhich());
- while( nWhich )
- {
- if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
- aTempSet.ClearItem( nWhich );
- nWhich = aWhichIter.NextWhich();
- }
+ pSheet->GetItemSet().Put(aTempSet,false);
+ pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
+ bOk = true;
+ }
- }
- else
- {
- // put the items hard into level one
- aTempSet.Put( rSet );
- }
+ if (!bSlide &&
+ (ePresObjKind == PRESOBJ_TITLE ||
+ ePresObjKind == PRESOBJ_NOTES))
+ {
+ // Presentation object (except outline)
+ SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
+ DBG_ASSERT(pSheet, "StyleSheet not found");
- aTempSet.ClearInvalidItems();
+ SfxItemSet aTempSet( pSheet->GetItemSet() );
+ aTempSet.Put( rSet );
+ aTempSet.ClearInvalidItems();
- // Undo-Action
- mpDocSh->GetUndoManager()->AddUndoAction(
- std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
+ // Undo-Action
+ mpDocSh->GetUndoManager()->AddUndoAction(
+ std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
- pSheet->GetItemSet().Set(aTempSet,false);
- pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
- }
+ pSheet->GetItemSet().Put(aTempSet,false);
+ pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
+ bOk = true;
+ }
+ else if (eObjKind == OBJ_OUTLINETEXT)
+ {
+ // Presentation object outline
+ for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--)
+ {
+ OUString aName = rPage.GetLayoutName() + " " +
+ OUString::number(nLevel);
+ SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool->
+ Find(aName, SfxStyleFamily::Page));
+ DBG_ASSERT(pSheet, "StyleSheet not found");
- // remove all hard set items from shape that are now set in style
- SfxWhichIter aWhichIter(rSet);
- sal_uInt16 nWhich(aWhichIter.FirstWhich());
- while( nWhich )
- {
- if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
- pObject->ClearMergedItem( nWhich );
- nWhich = aWhichIter.NextWhich();
- }
+ SfxItemSet aTempSet( pSheet->GetItemSet() );
- bOk = true;
+ if( nLevel > 1 )
+ {
+ // for all levels over 1, clear all items that will be
+ // hard set to level 1
+ SfxWhichIter aWhichIter(rSet);
+ sal_uInt16 nWhich(aWhichIter.FirstWhich());
+ while( nWhich )
+ {
+ if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
+ aTempSet.ClearItem( nWhich );
+ nWhich = aWhichIter.NextWhich();
}
+
}
+ else
+ {
+ // put the items hard into level one
+ aTempSet.Put( rSet );
+ }
+
+ aTempSet.ClearInvalidItems();
+
+ // Undo-Action
+ mpDocSh->GetUndoManager()->AddUndoAction(
+ std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
+
+ pSheet->GetItemSet().Set(aTempSet,false);
+ pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
}
- if(!bOk)
- bOk = ::sd::View::SetAttributes(rSet, bReplaceAll);
- }
- }
- else // not at masterpage
- {
- bOk = ::sd::View::SetAttributes(rSet, bReplaceAll);
- }
+ // remove all hard set items from shape that are now set in style
+ SfxWhichIter aWhichIter(rSet);
+ sal_uInt16 nWhich(aWhichIter.FirstWhich());
+ while( nWhich )
+ {
+ if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
+ pObject->ClearMergedItem( nWhich );
+ nWhich = aWhichIter.NextWhich();
+ }
- return bOk;
+ bOk = true;
+ }
+ }
}
/**
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 2c5df1abb7a1..5ad0e0bd6c94 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1449,6 +1449,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_NUMBERING_AND_POSITION:
+ {
+ SetCurrentFunction( FuBulletAndPosition::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq ) );
+ Cancel();
+ }
+ break;
+
case FN_INSERT_SOFT_HYPHEN:
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 9cfb5ae72c94..da0a60cf8a15 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -980,7 +980,7 @@ void OutlineView::PrepareClose()
/**
* Set attributes of the selected text
*/
-bool OutlineView::SetAttributes(const SfxItemSet& rSet, bool )
+bool OutlineView::SetAttributes(const SfxItemSet& rSet, bool /*bSlide*/, bool /*bReplaceAll*/, bool /*bMaster*/)
{
bool bOk = false;
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index d5d986d23e11..47930638bdbc 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -498,7 +498,7 @@ void View::MarkListHasChanged()
maSmartTags.deselect();
}
-bool View::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
+bool View::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll, bool /*bSlide*/, bool /*bMaster*/)
{
bool bOk = FmFormView::SetAttributes(rSet, bReplaceAll);
return bOk;
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 1aaa09786d0c..7e20197d3673 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -393,6 +393,7 @@
<menu:menuitem menu:id=".uno:FontDialog"/>
<menu:menuitem menu:id=".uno:ParagraphDialog"/>
<menu:menuitem menu:id=".uno:OutlineBullet"/>
+ <menu:menuitem menu:id=".uno:NumberingAndPosition"/>
<menu:menuseparator/>
<menu:menu menu:id=".uno:TableMenu">
<menu:menupopup>