summaryrefslogtreecommitdiff
path: root/svtools/source/config
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-04-22 15:38:05 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:18 +0100
commit60285fdc868635f99644ef1d8a195a2be87074c7 (patch)
treedbd69b9d424b527357c2ba33c2256e99edca3d91 /svtools/source/config
parent3af7ae5ef74756b33d35a67b7a6cee44acf79737 (diff)
Related: #i122041# More unifications for FillStyles
better defaults and better preview visualizations (cherry picked from commit 35c9acfc98fc98399005815e0464b1944f327d4e) Conflicts: officecfg/registry/schema/org/openoffice/Office/Common.xcs svtools/inc/svtools/accessibilityoptions.hxx svtools/inc/svtools/valueset.hxx svtools/source/config/accessibilityoptions.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/valueset.cxx svtools/source/inc/configitems/accessibilityoptions_const.hxx svx/inc/svx/dlgctrl.hxx svx/inc/svx/xtable.hxx svx/source/dialog/dlgctrl.cxx svx/source/tbxctrls/SvxColorValueSet.cxx svx/source/xoutdev/xtabdash.cxx svx/source/xoutdev/xtable.cxx vcl/inc/ilstbox.hxx vcl/inc/vcl/combobox.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/settings.hxx vcl/source/app/settings.cxx vcl/source/control/combobox.cxx vcl/source/control/ilstbox.cxx vcl/source/control/lstbox.cxx Change-Id: I905b6814cb796a35aa23fedb9ce716f77e2bfda0
Diffstat (limited to 'svtools/source/config')
-rw-r--r--svtools/source/config/accessibilityoptions.cxx171
1 files changed, 50 insertions, 121 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index a830a9998c82..35e612e720b4 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -58,6 +58,7 @@ namespace
const char s_sColorValueSetEntryEdgeLength[] = "ColorValueSetEntryEdgeLength";
const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount";
const char s_sEdgeBlending[] = "EdgeBlending";
+ const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount";
}
// class SvtAccessibilityOptions_Impl ---------------------------------------------
@@ -82,10 +83,8 @@ public:
sal_Bool GetIsSystemFont() const;
sal_Int16 GetHelpTipSeconds() const;
sal_Bool IsSelectionInReadonly() const;
- sal_Int16 GetColorValueSetMaximumRowCount() const;
- sal_Int16 GetColorValueSetEntryEdgeLength() const;
- sal_Int16 GetColorValueSetColumnCount() const;
sal_Int16 GetEdgeBlending() const;
+ sal_Int16 GetListBoxMaximumLineCount() const;
void SetAutoDetectSystemHC(sal_Bool bSet);
void SetIsForPagePreviews(sal_Bool bSet);
@@ -96,10 +95,8 @@ public:
void SetIsSystemFont(sal_Bool bSet);
void SetHelpTipSeconds(sal_Int16 nSet);
void SetSelectionInReadonly(sal_Bool bSet);
- void SetColorValueSetMaximumRowCount(sal_Int16 nSet);
- void SetColorValueSetEntryEdgeLength(sal_Int16 nSet);
- void SetColorValueSetColumnCount(sal_Int16 nSet);
void SetEdgeBlending(sal_Int16 nSet);
+ void SetListBoxMaximumLineCount(sal_Int16 nSet);
sal_Bool IsModified() const { return bIsModified; };
};
@@ -304,51 +301,15 @@ sal_Bool SvtAccessibilityOptions_Impl::IsSelectionInReadonly() const
return bRet;
}
-sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetMaximumRowCount() const
-{
- css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
- sal_Int16 nRet = 40;
-
- try
- {
- if(xNode.is())
- xNode->getPropertyValue(s_sColorValueSetMaximumRowCount) >>= nRet;
- }
- catch(const css::uno::Exception& ex)
- {
- SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
- }
-
- return nRet;
-}
-
-sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetEntryEdgeLength() const
-{
- css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
- sal_Int16 nRet = 14;
-
- try
- {
- if(xNode.is())
- xNode->getPropertyValue(s_sColorValueSetEntryEdgeLength) >>= nRet;
- }
- catch(const css::uno::Exception& ex)
- {
- SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
- }
-
- return nRet;
-}
-
-sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
+sal_Int16 SvtAccessibilityOptions_Impl::GetEdgeBlending() const
{
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
- sal_Int16 nRet = 12;
+ sal_Int16 nRet = 35;
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sColorValueSetColumnCount) >>= nRet;
+ xNode->getPropertyValue(s_sEdgeBlending) >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -358,15 +319,15 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
return nRet;
}
-sal_Int16 SvtAccessibilityOptions_Impl::GetEdgeBlending() const
+sal_Int16 SvtAccessibilityOptions_Impl::GetListBoxMaximumLineCount() const
{
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
- sal_Int16 nRet = 35;
+ sal_Int16 nRet = 25;
try
{
if(xNode.is())
- xNode->getPropertyValue(s_sEdgeBlending) >>= nRet;
+ xNode->getPropertyValue(s_sListBoxMaximumLineCount) >>= nRet;
}
catch(const css::uno::Exception& ex)
{
@@ -558,70 +519,58 @@ void SvtAccessibilityOptions_Impl::SetSelectionInReadonly(sal_Bool bSet)
void SvtAccessibilityOptions_Impl::SetVCLSettings()
{
- AllSettings aAllSettings = Application::GetSettings();
- HelpSettings aHelpSettings = aAllSettings.GetHelpSettings();
+ AllSettings aAllSettings(Application::GetSettings());
+ StyleSettings aStyleSettings(aAllSettings.GetStyleSettings());
+ HelpSettings aHelpSettings(aAllSettings.GetHelpSettings());
+ bool StyleSettingsChanged(false);
+
aHelpSettings.SetTipTimeout( GetIsHelpTipsDisappear() ? GetHelpTipSeconds() * 1000 : HELP_TIP_TIMEOUT);
aAllSettings.SetHelpSettings(aHelpSettings);
- if(aAllSettings.GetStyleSettings().GetUseSystemUIFonts() != GetIsSystemFont() )
+
+ if(aStyleSettings.GetUseSystemUIFonts() != GetIsSystemFont())
{
- StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
- aStyleSettings.SetUseSystemUIFonts( GetIsSystemFont() );
- aAllSettings.SetStyleSettings(aStyleSettings);
- Application::MergeSystemSettings( aAllSettings );
+ aStyleSettings.SetUseSystemUIFonts(GetIsSystemFont());
+ StyleSettingsChanged = true;
}
- Application::SetSettings(aAllSettings);
-}
-
-void SvtAccessibilityOptions_Impl::SetColorValueSetMaximumRowCount(sal_Int16 nSet)
-{
- css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+ const sal_Int16 nEdgeBlendingCountA(GetEdgeBlending());
+ OSL_ENSURE(nEdgeBlendingCountA >= 0, "OOps, negative values for EdgeBlending are not allowed (!)");
+ const sal_uInt16 nEdgeBlendingCountB(static_cast< sal_uInt16 >(nEdgeBlendingCountA >= 0 ? nEdgeBlendingCountA : 0));
- try
+ if(aStyleSettings.GetEdgeBlending() != nEdgeBlendingCountB)
{
- if(xNode.is() && xNode->getPropertyValue(s_sColorValueSetMaximumRowCount)!=nSet)
- {
- xNode->setPropertyValue(s_sColorValueSetMaximumRowCount, 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);
+ aStyleSettings.SetEdgeBlending(nEdgeBlendingCountB);
+ StyleSettingsChanged = true;
}
-}
-void SvtAccessibilityOptions_Impl::SetColorValueSetEntryEdgeLength(sal_Int16 nSet)
-{
- css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
+ const sal_Int16 nMaxLineCountA(GetListBoxMaximumLineCount());
+ OSL_ENSURE(nMaxLineCountA >= 0, "OOps, negative values for ListBoxMaximumLineCount are not allowed (!)");
+ const sal_uInt16 nMaxLineCountB(static_cast< sal_uInt16 >(nMaxLineCountA >= 0 ? nMaxLineCountA : 0));
- try
+ if(aStyleSettings.GetListBoxMaximumLineCount() != nMaxLineCountB)
{
- if(xNode.is() && xNode->getPropertyValue(s_sColorValueSetEntryEdgeLength)!=nSet)
- {
- xNode->setPropertyValue(s_sColorValueSetEntryEdgeLength, css::uno::makeAny(nSet));
- ::comphelper::ConfigurationHelper::flush(m_xCfg);
-
- bIsModified = sal_True;
- }
+ aStyleSettings.SetListBoxMaximumLineCount(nMaxLineCountB);
+ StyleSettingsChanged = true;
}
- catch(const css::uno::Exception& ex)
+
+ if(StyleSettingsChanged)
{
- SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+ aAllSettings.SetStyleSettings(aStyleSettings);
+ Application::MergeSystemSettings(aAllSettings);
}
+
+ Application::SetSettings(aAllSettings);
}
-void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet)
+void SvtAccessibilityOptions_Impl::SetEdgeBlending(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)
+ if(xNode.is() && xNode->getPropertyValue(s_sEdgeBlending)!=nSet)
{
- xNode->setPropertyValue(s_sColorValueSetColumnCount, css::uno::makeAny(nSet));
+ xNode->setPropertyValue(s_sEdgeBlending, css::uno::makeAny(nSet));
::comphelper::ConfigurationHelper::flush(m_xCfg);
bIsModified = sal_True;
@@ -633,15 +582,15 @@ void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet)
}
}
-void SvtAccessibilityOptions_Impl::SetEdgeBlending(sal_Int16 nSet)
+void SvtAccessibilityOptions_Impl::SetListBoxMaximumLineCount(sal_Int16 nSet)
{
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
try
{
- if(xNode.is() && xNode->getPropertyValue(s_sEdgeBlending)!=nSet)
+ if(xNode.is() && xNode->getPropertyValue(s_sListBoxMaximumLineCount)!=nSet)
{
- xNode->setPropertyValue(s_sEdgeBlending, css::uno::makeAny(nSet));
+ xNode->setPropertyValue(s_sListBoxMaximumLineCount, css::uno::makeAny(nSet));
::comphelper::ConfigurationHelper::flush(m_xCfg);
bIsModified = sal_True;
@@ -745,26 +694,14 @@ sal_Bool SvtAccessibilityOptions::IsSelectionInReadonly() const
{
return sm_pSingleImplConfig->IsSelectionInReadonly();
}
-
-sal_Int16 SvtAccessibilityOptions::GetColorValueSetMaximumRowCount() const
-{
- return sm_pSingleImplConfig->GetColorValueSetMaximumRowCount();
-}
-
-sal_Int16 SvtAccessibilityOptions::GetColorValueSetEntryEdgeLength() const
-{
- return sm_pSingleImplConfig->GetColorValueSetEntryEdgeLength();
-}
-
-sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const
-{
- return sm_pSingleImplConfig->GetColorValueSetColumnCount();
-}
-
sal_Int16 SvtAccessibilityOptions::GetEdgeBlending() const
{
return sm_pSingleImplConfig->GetEdgeBlending();
}
+sal_Int16 SvtAccessibilityOptions::GetListBoxMaximumLineCount() const
+{
+ return sm_pSingleImplConfig->GetListBoxMaximumLineCount();
+}
// -----------------------------------------------------------------------
void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet)
@@ -807,22 +744,14 @@ void SvtAccessibilityOptions::SetVCLSettings()
{
sm_pSingleImplConfig->SetVCLSettings();
}
-void SvtAccessibilityOptions::SetColorValueSetMaximumRowCount(sal_Int16 nSet)
-{
- sm_pSingleImplConfig->SetColorValueSetMaximumRowCount(nSet);
-}
-void SvtAccessibilityOptions::SetColorValueSetEntryEdgeLength(sal_Int16 nSet)
-{
- sm_pSingleImplConfig->SetColorValueSetEntryEdgeLength(nSet);
-}
-void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
-{
- sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
-}
void SvtAccessibilityOptions::SetEdgeBlending(sal_Int16 nSet)
{
sm_pSingleImplConfig->SetEdgeBlending(nSet);
}
+void SvtAccessibilityOptions::SetListBoxMaximumLineCount(sal_Int16 nSet)
+{
+ sm_pSingleImplConfig->SetListBoxMaximumLineCount(nSet);
+}
// -----------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */