summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2020-07-08 00:46:29 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-14 21:53:22 +0200
commitad6d723bb6e37e70702ea467072a1dc077293839 (patch)
tree87f748a53e93d63d008037ca90966f925db4f04f /svx
parent944892091ad30c5da192b20d189c7a4388b0c91d (diff)
tdf#134188 tdf#114223 Don't override vertical text button visibility
i.e. restore the fix for tdf#33356, which was removed in commit eeb2d19e77d6dc47c68e8ba0920a02cf64a1247b ("Resolves: tdf#130159 hide writedirection unless CTL is enabled"). But do it in a way that doesn't introduce tdf#114223 (a regression of tdf#33356). We can assume that the visibility state of the button at the point of control initialization is the one set with toolbar customization, as any customization triggers clearing of the whole toolbar, and reconstructing from scratch. Change-Id: I2cdf18e144dd6eb99b8c1e1da968beacddbb3728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98317 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit d3a98b87824f2e2248a45b97d7eef5e8ad596dd3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98760 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/verttexttbxctrl.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/svx/source/tbxctrls/verttexttbxctrl.cxx b/svx/source/tbxctrls/verttexttbxctrl.cxx
index 02e245d3fa85..18d6b2b8b4e6 100644
--- a/svx/source/tbxctrls/verttexttbxctrl.cxx
+++ b/svx/source/tbxctrls/verttexttbxctrl.cxx
@@ -64,6 +64,7 @@ com_sun_star_comp_svx_VertTextToolBoxControl_get_implementation(
SvxVertCTLTextTbxCtrl::SvxVertCTLTextTbxCtrl(const css::uno::Reference<css::uno::XComponentContext>& rContext)
: SvxVertCTLTextTbxCtrl_Base(rContext, nullptr, OUString())
+ , m_bVisible(false)
{
}
@@ -76,6 +77,17 @@ void SAL_CALL SvxVertCTLTextTbxCtrl::initialize(const css::uno::Sequence<css::un
SvxVertCTLTextTbxCtrl_Base::initialize(rArguments);
// fdo#83320 Hide vertical text commands early
setFastPropertyValue_NoBroadcast(1, css::uno::makeAny(true));
+
+ if (m_pToolbar)
+ {
+ m_bVisible = m_pToolbar->get_item_visible(m_aCommandURL.toUtf8());
+ return;
+ }
+
+ ToolBox* pToolBox = nullptr;
+ sal_uInt16 nItemId = 0;
+ getToolboxId(nItemId, &pToolBox);
+ m_bVisible = pToolBox && pToolBox->IsItemVisible(nItemId);
}
void SAL_CALL SvxVertCTLTextTbxCtrl::statusChanged(const css::frame::FeatureStateEvent& rEvent)
@@ -88,12 +100,12 @@ void SAL_CALL SvxVertCTLTextTbxCtrl::statusChanged(const css::frame::FeatureStat
if (rEvent.FeatureURL.Complete == ".uno:VerticalTextState")
{
SvtLanguageOptions aLangOptions;
- bEnabled = aLangOptions.IsVerticalTextEnabled();
+ bEnabled = m_bVisible && aLangOptions.IsVerticalTextEnabled();
}
else if (rEvent.FeatureURL.Complete == ".uno:CTLFontState")
{
SvtLanguageOptions aLangOptions;
- bEnabled = aLangOptions.IsCTLFontEnabled();
+ bEnabled = m_bVisible && aLangOptions.IsCTLFontEnabled();
}
else
{