summaryrefslogtreecommitdiff
path: root/svtools/source/config/accessibilityoptions.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-05-03 09:01:43 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:27 +0100
commitdcc7b1c3cf3ab7de287d2d566c87d28c407749a7 (patch)
tree2bcfe63fb4b51f704a4178d51722c55afe845631 /svtools/source/config/accessibilityoptions.cxx
parent57f1888f2626463d57bbfd80d97c0a0565fbbf2b (diff)
Related: #ii122198# added ColorValueSetColumnCount entry to configuration
default is 12 (cherry picked from commit dc9abefa2d01377b14bef15463e360d9a7e9bdc2) Conflicts: officecfg/registry/schema/org/openoffice/Office/Common.xcs svtools/inc/svtools/accessibilityoptions.hxx svtools/source/inc/configitems/accessibilityoptions_const.hxx Change-Id: Ic035b34bbcde426fa8fb76df16f84786908e18fa
Diffstat (limited to 'svtools/source/config/accessibilityoptions.cxx')
-rw-r--r--svtools/source/config/accessibilityoptions.cxx59
1 files changed, 59 insertions, 0 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 35e612e720b4..679d7ac9291c 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -85,6 +85,7 @@ public:
sal_Bool IsSelectionInReadonly() const;
sal_Int16 GetEdgeBlending() const;
sal_Int16 GetListBoxMaximumLineCount() const;
+ sal_Int16 GetColorValueSetColumnCount() const;
void SetAutoDetectSystemHC(sal_Bool bSet);
void SetIsForPagePreviews(sal_Bool bSet);
@@ -97,6 +98,7 @@ public:
void SetSelectionInReadonly(sal_Bool bSet);
void SetEdgeBlending(sal_Int16 nSet);
void SetListBoxMaximumLineCount(sal_Int16 nSet);
+ void SetColorValueSetColumnCount(sal_Int16 nSet);
sal_Bool IsModified() const { return bIsModified; };
};
@@ -337,6 +339,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetListBoxMaximumLineCount() const
return nRet;
}
+sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
+{
+ css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+ sal_Int16 nRet = 12;
+
+ try
+ {
+ if(xNode.is())
+ xNode->getPropertyValue(s_sColorValueSetColumnCount) >>= nRet;
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+ }
+
+ return nRet;
+}
+
void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
{
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
@@ -553,6 +573,16 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings()
StyleSettingsChanged = true;
}
+ const sal_Int16 nMaxColumnCountA(GetColorValueSetColumnCount());
+ OSL_ENSURE(nMaxColumnCountA >= 0, "OOps, negative values for ColorValueSetColumnCount are not allowed (!)");
+ const sal_uInt16 nMaxColumnCountB(static_cast< sal_uInt16 >(nMaxColumnCountA >= 0 ? nMaxColumnCountA : 0));
+
+ if(aStyleSettings.GetColorValueSetColumnCount() != nMaxColumnCountB)
+ {
+ aStyleSettings.SetColorValueSetColumnCount(nMaxColumnCountB);
+ StyleSettingsChanged = true;
+ }
+
if(StyleSettingsChanged)
{
aAllSettings.SetStyleSettings(aStyleSettings);
@@ -602,6 +632,26 @@ void SvtAccessibilityOptions_Impl::SetListBoxMaximumLineCount(sal_Int16 nSet)
}
}
+void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet)
+{
+ css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+
+ try
+ {
+ if(xNode.is() && xNode->getPropertyValue(s_sColorValueSetColumnCount)!=nSet)
+ {
+ xNode->setPropertyValue(s_sColorValueSetColumnCount, css::uno::makeAny(nSet));
+ ::comphelper::ConfigurationHelper::flush(m_xCfg);
+
+ bIsModified = sal_True;
+ }
+ }
+ catch(const css::uno::Exception& ex)
+ {
+ SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+ }
+}
+
// -----------------------------------------------------------------------
// class SvtAccessibilityOptions --------------------------------------------------
@@ -702,6 +752,10 @@ sal_Int16 SvtAccessibilityOptions::GetListBoxMaximumLineCount() const
{
return sm_pSingleImplConfig->GetListBoxMaximumLineCount();
}
+sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const
+{
+ return sm_pSingleImplConfig->GetColorValueSetColumnCount();
+}
// -----------------------------------------------------------------------
void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet)
@@ -752,6 +806,11 @@ void SvtAccessibilityOptions::SetListBoxMaximumLineCount(sal_Int16 nSet)
{
sm_pSingleImplConfig->SetListBoxMaximumLineCount(nSet);
}
+void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
+{
+ sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
+}
+
// -----------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */