summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2020-07-08 00:46:29 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2020-07-08 11:04:04 +0200
commitd3a98b87824f2e2248a45b97d7eef5e8ad596dd3 (patch)
treecec9930329eedd631a41c41e37254d928d2956a5 /svx/source/tbxctrls
parent0695b5f5b328a1bc9cfdc8ba020dbdd674185e04 (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>
Diffstat (limited to 'svx/source/tbxctrls')
-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
{