summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-05-03 09:01:43 +0000
committerArmin Le Grand <alg@apache.org>2013-05-03 09:01:43 +0000
commitdc9abefa2d01377b14bef15463e360d9a7e9bdc2 (patch)
treeaf1342e92ec6670843eeb9196131e35d016c4e3d
parent3b31f1c781d367cfebdb388c17b22640d7e82539 (diff)
i122198 added ColorValueSetColumnCount entry to configuration, default is 12
Notes
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs13
-rw-r--r--svtools/inc/svtools/accessibilityoptions.hxx6
-rw-r--r--svtools/source/config/accessibilityoptions.cxx59
-rw-r--r--svtools/source/inc/configitems/accessibilityoptions_const.hxx25
4 files changed, 91 insertions, 12 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 80c6b0547a63..9c17cfe85d71 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6185,6 +6185,19 @@
</info>
<value>25</value>
</prop>
+ <prop oor:name="ColorValueSetColumnCount" oor:type="xs:short">
+ <info>
+ <author>ALG</author>
+ <desc>
+ This option controls how many columns the ColorValueSets (the matrix-organized dialogs for color select)
+ will have. The default is 12 and this is aligned with the layout of the standard color palette. thus, when you
+ change this value, you should know what you do. This setting also influences some width-oriented layouts in
+ dialogs where this ColorValueSets are used, e.g. FillStyle dialog.
+ </desc>
+ <label>Defines the number of columns that will be shown in a ColorValueSet.</label>
+ </info>
+ <value>12</value>
+ </prop>
</group>
<set oor:name="OfficeObjects" oor:node-type="ObjectNames">
<info>
diff --git a/svtools/inc/svtools/accessibilityoptions.hxx b/svtools/inc/svtools/accessibilityoptions.hxx
index 32d962c66f2e..fc78c29bae08 100644
--- a/svtools/inc/svtools/accessibilityoptions.hxx
+++ b/svtools/inc/svtools/accessibilityoptions.hxx
@@ -64,6 +64,11 @@ public:
// is in a ListBox, all will be shown, else a ScrollBar will be used
sal_Int16 GetListBoxMaximumLineCount() const;
+ // option to set the width of ColorValueSets in columns; this allows
+ // adaption to own colr set layouts. The default layout is 12 columns and should
+ // only be changed when the color palette is changed from the default
+ sal_Int16 GetColorValueSetColumnCount() const;
+
void SetIsForPagePreviews(sal_Bool bSet);
void SetIsHelpTipsDisappear(sal_Bool bSet);
void SetIsAllowAnimatedGraphics(sal_Bool bSet);
@@ -76,6 +81,7 @@ public:
void SetEdgeBlending(sal_Int16 nSet);
void SetListBoxMaximumLineCount(sal_Int16 nSet);
+ void SetColorValueSetColumnCount(sal_Int16 nSet);
sal_Bool IsModified() const;
void Commit();
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index e5e06a862c95..c2a02d7dace6 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -88,6 +88,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);
@@ -100,6 +101,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; };
};
@@ -340,6 +342,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)
+ {
+ LogHelper::logIt(ex);
+ }
+
+ return nRet;
+}
+
void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
{
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
@@ -556,6 +576,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);
@@ -605,6 +635,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)
+ {
+ LogHelper::logIt(ex);
+ }
+}
+
// -----------------------------------------------------------------------
// class SvtAccessibilityOptions --------------------------------------------------
@@ -715,6 +765,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)
@@ -765,4 +819,9 @@ void SvtAccessibilityOptions::SetListBoxMaximumLineCount(sal_Int16 nSet)
{
sm_pSingleImplConfig->SetListBoxMaximumLineCount(nSet);
}
+void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
+{
+ sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
+}
+
// -----------------------------------------------------------------------
diff --git a/svtools/source/inc/configitems/accessibilityoptions_const.hxx b/svtools/source/inc/configitems/accessibilityoptions_const.hxx
index 11032327d0c0..82199f8e05ed 100644
--- a/svtools/source/inc/configitems/accessibilityoptions_const.hxx
+++ b/svtools/source/inc/configitems/accessibilityoptions_const.hxx
@@ -31,18 +31,19 @@
namespace
{
- static const ::rtl::OUString s_sAccessibility = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/Accessibility");
- static const ::rtl::OUString s_sAutoDetectSystemHC = ::rtl::OUString::createFromAscii("AutoDetectSystemHC");
- static const ::rtl::OUString s_sIsForPagePreviews = ::rtl::OUString::createFromAscii("IsForPagePreviews");
- static const ::rtl::OUString s_sIsHelpTipsDisappear = ::rtl::OUString::createFromAscii("IsHelpTipsDisappear");
- static const ::rtl::OUString s_sHelpTipSeconds = ::rtl::OUString::createFromAscii("HelpTipSeconds");
- static const ::rtl::OUString s_sIsAllowAnimatedGraphics = ::rtl::OUString::createFromAscii("IsAllowAnimatedGraphics");
- static const ::rtl::OUString s_sIsAllowAnimatedText = ::rtl::OUString::createFromAscii("IsAllowAnimatedText");
- static const ::rtl::OUString s_sIsAutomaticFontColor = ::rtl::OUString::createFromAscii("IsAutomaticFontColor");
- static const ::rtl::OUString s_sIsSystemFont = ::rtl::OUString::createFromAscii("IsSystemFont");
- static const ::rtl::OUString s_sIsSelectionInReadonly = ::rtl::OUString::createFromAscii("IsSelectionInReadonly");
- static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending");
- static const ::rtl::OUString s_sListBoxMaximumLineCount = ::rtl::OUString::createFromAscii("ListBoxMaximumLineCount");
+ static const ::rtl::OUString s_sAccessibility = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/Accessibility");
+ static const ::rtl::OUString s_sAutoDetectSystemHC = ::rtl::OUString::createFromAscii("AutoDetectSystemHC");
+ static const ::rtl::OUString s_sIsForPagePreviews = ::rtl::OUString::createFromAscii("IsForPagePreviews");
+ static const ::rtl::OUString s_sIsHelpTipsDisappear = ::rtl::OUString::createFromAscii("IsHelpTipsDisappear");
+ static const ::rtl::OUString s_sHelpTipSeconds = ::rtl::OUString::createFromAscii("HelpTipSeconds");
+ static const ::rtl::OUString s_sIsAllowAnimatedGraphics = ::rtl::OUString::createFromAscii("IsAllowAnimatedGraphics");
+ static const ::rtl::OUString s_sIsAllowAnimatedText = ::rtl::OUString::createFromAscii("IsAllowAnimatedText");
+ static const ::rtl::OUString s_sIsAutomaticFontColor = ::rtl::OUString::createFromAscii("IsAutomaticFontColor");
+ static const ::rtl::OUString s_sIsSystemFont = ::rtl::OUString::createFromAscii("IsSystemFont");
+ static const ::rtl::OUString s_sIsSelectionInReadonly = ::rtl::OUString::createFromAscii("IsSelectionInReadonly");
+ static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending");
+ static const ::rtl::OUString s_sListBoxMaximumLineCount = ::rtl::OUString::createFromAscii("ListBoxMaximumLineCount");
+ static const ::rtl::OUString s_sColorValueSetColumnCount = ::rtl::OUString::createFromAscii("ColorValueSetColumnCount");
}
#endif // INCLUDE_CONFIGITEMS_ACCESSIBILITYOPTIONS_CONST_HXX