[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 6 commits - cui/source officecfg/registry scp2/inc scp2/source sfx2/source solenv/bin svtools/inc svtools/source svx/inc svx/source vcl/inc vcl/source
Armin Le Grand
alg at apache.org
Tue Apr 23 00:57:58 PDT 2013
cui/source/tabpages/tpbitmap.cxx | 12
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 52 -
scp2/inc/macros.inc | 11
scp2/source/base/file_base.scp | 2
scp2/source/base/folderitem_base.scp | 3
scp2/source/calc/folderitem_calc.scp | 3
scp2/source/draw/folderitem_draw.scp | 3
scp2/source/impress/folderitem_impress.scp | 3
scp2/source/kde/file_kde.scp | 3
scp2/source/math/folderitem_math.scp | 3
scp2/source/onlineupdate/file_onlineupdate.scp | 3
scp2/source/ooo/common_brand.scp | 26
scp2/source/ooo/directory_ooo.scp | 66 +
scp2/source/ooo/file_library_ooo.scp | 36
scp2/source/ooo/file_ooo.scp | 66 +
scp2/source/ooo/folderitem_ooo.scp | 6
scp2/source/ooo/makefile.mk | 1
scp2/source/ooo/profile_ooo.scp | 9
scp2/source/ooo/shortcut_ooo.scp | 21
scp2/source/ooo/starregistry_ooo.scp | 7
scp2/source/ooo/ure.scp | 79 +-
scp2/source/python/file_python.scp | 88 +-
scp2/source/python/module_python_mailmerge.scp | 7
scp2/source/python/profileitem_python.scp | 7
scp2/source/winexplorerext/file_winexplorerext.scp | 8
scp2/source/writer/folderitem_writer.scp | 3
sfx2/source/sidebar/SidebarController.cxx | 28
sfx2/source/sidebar/SidebarController.hxx | 6
solenv/bin/modules/installer/systemactions.pm | 3
svtools/inc/svtools/accessibilityoptions.hxx | 13
svtools/inc/svtools/valueset.hxx | 62 -
svtools/source/config/accessibilityoptions.cxx | 170 +---
svtools/source/control/ctrlbox.cxx | 33
svtools/source/control/valueset.cxx | 195 ++---
svtools/source/inc/configitems/accessibilityoptions_const.hxx | 7
svx/inc/svx/dlgctrl.hxx | 29
svx/inc/svx/xtable.hxx | 4
svx/source/dialog/dlgctrl.cxx | 373 +++-------
svx/source/sidebar/area/AreaPropertyPanel.cxx | 6
svx/source/sidebar/line/LinePropertyPanel.cxx | 6
svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 6
svx/source/sidebar/paragraph/ParaPropertyPanel.src | 66 -
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 2
svx/source/tbxctrls/SvxColorValueSet.cxx | 16
svx/source/xoutdev/xtabdash.cxx | 7
svx/source/xoutdev/xtabgrdt.cxx | 5
svx/source/xoutdev/xtabhtch.cxx | 2
svx/source/xoutdev/xtable.cxx | 21
svx/source/xoutdev/xtablend.cxx | 5
vcl/inc/ilstbox.hxx | 165 ++--
vcl/inc/vcl/combobox.hxx | 1
vcl/inc/vcl/lstbox.hxx | 19
vcl/inc/vcl/settings.hxx | 91 +-
vcl/source/app/settings.cxx | 43 +
vcl/source/control/combobox.cxx | 15
vcl/source/control/ilstbox.cxx | 193 +++--
vcl/source/control/lstbox.cxx | 56 +
57 files changed, 1184 insertions(+), 992 deletions(-)
New commits:
commit 35c9acfc98fc98399005815e0464b1944f327d4e
Author: Armin Le Grand <alg at apache.org>
Date: Mon Apr 22 15:38:05 2013 +0000
i122041 More unifications for FillStyles, better defaults, better preview visualizations
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 65a7c9a..380d275 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -593,8 +593,8 @@ IMPL_LINK( SvxBitmapTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
if( pEntry )
{
pBitmapList->Insert( pEntry );
- const Size aUiSize(pBitmapList->getUiBitmapWidth(), pBitmapList->getUiBitmapHeight());
- aLbBitmaps.Append(aUiSize, *pEntry );
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ aLbBitmaps.Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry );
aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
#ifdef WNT
@@ -701,8 +701,8 @@ IMPL_LINK( SvxBitmapTabPage, ClickImportHdl_Impl, void *, EMPTYARG )
XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName );
pBitmapList->Insert( pEntry );
- const Size aUiSize(pBitmapList->getUiBitmapWidth(), pBitmapList->getUiBitmapHeight());
- aLbBitmaps.Append(aUiSize, *pEntry );
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ aLbBitmaps.Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry );
aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
#ifdef WNT
@@ -757,7 +757,7 @@ IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
long nCount = pBitmapList->Count();
sal_Bool bDifferent = sal_False;
sal_Bool bLoop = sal_True;
- const Size aUiSize(pBitmapList->getUiBitmapWidth(), pBitmapList->getUiBitmapHeight());
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
while( bLoop && pDlg->Execute() == RET_OK )
{
@@ -782,7 +782,7 @@ IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
pEntry->SetGraphicObject(Graphic(aBitmapEx));
- aLbBitmaps.Modify( aUiSize, *pEntry, nPos );
+ aLbBitmaps.Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos );
aLbBitmaps.SelectEntryPos( nPos );
// Flag fuer modifiziert setzen
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 3ab729e..80c6b05 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6156,46 +6156,14 @@
</info>
<value>false</value>
</prop>
- <prop oor:name="ColorValueSetMaximumRowCount" oor:type="xs:short">
- <info>
- <author>ALG</author>
- <desc>
- Defines the maximum row count for ColorValueSets. If more rows are needed, a Scrollbar will be used.
- </desc>
- <label>A Scrollbar will be used when more rows are needed.</label>
- </info>
- <value>40</value>
- </prop>
- <prop oor:name="ColorValueSetEntryEdgeLength" oor:type="xs:short">
- <info>
- <author>ALG</author>
- <desc>
- Defines the EdgeLength in Pixels for Entries generated inside of ColorValueSets. The Entries are quadratic for Colors.
- </desc>
- <label>Entries in ColorValueSets will have this quadratic size in Pixels.</label>
- </info>
- <value>14</value>
- </prop>
- <prop oor:name="ColorValueSetColumnCount" oor:type="xs:short">
- <info>
- <author>ALG</author>
- <desc>
- Defines how many colums are to be used in ColorValueSets. The idea is to use this defined count to have a
- good visualisation in ColorValueSets which offers the used ColorTable Schema nicely layouted to the User.
- This Schema is layouted to a width of twelve colums, though this value should not be changed.
- </desc>
- <label>The ColumnCount used in ColorValueSets.</label>
- </info>
- <value>12</value>
- </prop>
<prop oor:name="EdgeBlending" oor:type="xs:short">
<info>
<author>ALG</author>
<desc>
- Option to use EdgeBlending for previews in the UI (for ColorValueSet, ColorDropDown, FillStyle/LineStyle
+ Option to use EdgeBlending for previews in the UI (for ColorValueSet, ColorDropDown, FillStyle/LineStyle
previews, etc...). EdgeBlending will visualize a one pixel border on the preview object with interpolated
- colors (default: TopLeft White, BottomRight Black) so that a nice 3D effect is shown. It is a percent
- value describing how strong the effect shall be. The value 0% switches it off, while the value 100% will
+ colors (default: TopLeft White, BottomRight Black) so that a nice 3D effect is shown. It is a percent
+ value describing how strong the effect shall be. The value 0% switches it off, while the value 100% will
cover the preview object's border completely with one pixel. Values in-between vill be alpha-blended with
the original preview image.
</desc>
@@ -6203,6 +6171,20 @@
</info>
<value>35</value>
</prop>
+ <prop oor:name="ListBoxMaximumLineCount" oor:type="xs:short">
+ <info>
+ <author>ALG</author>
+ <desc>
+ This option controls how many lines of a ListBox will be shown as a maximum. If the ListBox has less lines,
+ all lines will be shown when opening the drop down content. If it has more lines, the visible number of
+ lines will be limited to this number. The value 0 disables this feature, negative values are not allowed.
+ This feature may not be used automatically by all ListBox implementations,
+ but it gives a central hint value to use if an implementation wants to adapt to something useful.
+ </desc>
+ <label>Defines the maximum number of lines visible in a ListBox.</label>
+ </info>
+ <value>25</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 e66ce25..32d962c 100644
--- a/svtools/inc/svtools/accessibilityoptions.hxx
+++ b/svtools/inc/svtools/accessibilityoptions.hxx
@@ -56,15 +56,14 @@ public:
sal_Bool IsSelectionInReadonly() const;
sal_Bool GetAutoDetectSystemHC() const;
- // options for configuring the look and feel for the ColorValueSet (color selector)
- sal_Int16 GetColorValueSetMaximumRowCount() const;
- sal_Int16 GetColorValueSetEntryEdgeLength() const;
- sal_Int16 GetColorValueSetColumnCount() const;
-
// option to activate EdgeBlending for previews in the UI (ColorValueSet, ColorDropDown,
// FillStyle/LineStyle previews, etc...). 0 == off, 100% == full paint, in-between == alpha
sal_Int16 GetEdgeBlending() const;
+ // option to set a maximum line count for ListBoxes; when less or equal than this count
+ // is in a ListBox, all will be shown, else a ScrollBar will be used
+ sal_Int16 GetListBoxMaximumLineCount() const;
+
void SetIsForPagePreviews(sal_Bool bSet);
void SetIsHelpTipsDisappear(sal_Bool bSet);
void SetIsAllowAnimatedGraphics(sal_Bool bSet);
@@ -75,10 +74,8 @@ public:
void SetSelectionInReadonly(sal_Bool bSet);
void SetAutoDetectSystemHC(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;
void Commit();
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 50bbce3..8a81c15 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -250,31 +250,34 @@ private:
long mnLines;
long mnUserItemWidth;
long mnUserItemHeight;
- sal_uInt16 mnOldItemId;
- sal_uInt16 mnSelItemId;
- sal_uInt16 mnHighItemId;
- sal_uInt16 mnDropPos;
- sal_uInt16 mnCols;
- sal_uInt16 mnCurCol;
- sal_uInt16 mnUserCols;
- sal_uInt16 mnUserVisLines;
- sal_uInt16 mnFirstLine;
- sal_uInt16 mnSpacing;
- sal_uInt16 mnFrameStyle;
- sal_Bool mbFormat;
- sal_Bool mbHighlight;
- sal_Bool mbSelection;
- sal_Bool mbNoSelection;
- sal_Bool mbDrawSelection;
- sal_Bool mbBlackSel;
- sal_Bool mbDoubleSel;
- sal_Bool mbScroll;
- sal_Bool mbDropPos;
- sal_Bool mbFullMode;
+ sal_uInt16 mnOldItemId;
+ sal_uInt16 mnSelItemId;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnDropPos;
+ sal_uInt16 mnCols;
+ sal_uInt16 mnCurCol;
+ sal_uInt16 mnUserCols;
+ sal_uInt16 mnUserVisLines;
+ sal_uInt16 mnFirstLine;
+ sal_uInt16 mnSpacing;
+ sal_uInt16 mnFrameStyle;
Color maColor;
Link maDoubleClickHdl;
Link maSelectHdl;
+ // bitfield
+ bool mbFormat : 1;
+ bool mbHighlight : 1;
+ bool mbSelection : 1;
+ bool mbNoSelection : 1;
+ bool mbDrawSelection : 1;
+ bool mbBlackSel : 1;
+ bool mbDoubleSel : 1;
+ bool mbScroll : 1;
+ bool mbDropPos : 1;
+ bool mbFullMode : 1;
+ bool mbEdgeBlending : 1;
+
#ifdef _SV_VALUESET_CXX
friend class ValueSetAcc;
friend class ValueItemAcc;
@@ -368,8 +371,8 @@ public:
sal_uInt16 GetItemId( const Point& rPos ) const;
Rectangle GetItemRect( sal_uInt16 nItemId ) const;
- void EnableFullItemMode( sal_Bool bFullMode = sal_True );
- sal_Bool IsFullItemModeEnabled() const { return mbFullMode; }
+ void EnableFullItemMode( bool bFullMode = true );
+ bool IsFullItemModeEnabled() const { return mbFullMode; }
void SetColCount( sal_uInt16 nNewCols = 1 );
sal_uInt16 GetColCount() const { return mnUserCols; }
void SetLineCount( sal_uInt16 nNewLines = 0 );
@@ -383,10 +386,10 @@ public:
void SelectItem( sal_uInt16 nItemId );
sal_uInt16 GetSelectItemId() const { return mnSelItemId; }
- sal_Bool IsItemSelected( sal_uInt16 nItemId ) const
- { return ((!mbNoSelection && (nItemId == mnSelItemId)) ? sal_True : sal_False); }
+ bool IsItemSelected( sal_uInt16 nItemId ) const
+ { return (!mbNoSelection && (nItemId == mnSelItemId)); }
void SetNoSelection();
- sal_Bool IsNoSelection() const { return mbNoSelection; }
+ bool IsNoSelection() const { return mbNoSelection; }
void SetItemBits( sal_uInt16 nItemId, sal_uInt16 nBits );
sal_uInt16 GetItemBits( sal_uInt16 nItemId ) const;
@@ -401,7 +404,7 @@ public:
void SetColor( const Color& rColor );
void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
Color GetColor() const { return maColor; }
- sal_Bool IsColor() const { return maColor.GetTransparency() == 0; }
+ bool IsColor() const { return maColor.GetTransparency() == 0; }
void SetExtraSpacing( sal_uInt16 nNewSpacing );
sal_uInt16 GetExtraSpacing() { return mnSpacing; }
@@ -414,7 +417,7 @@ public:
Size CalcWindowSizePixel( const Size& rItemSize,
sal_uInt16 nCalcCols = 0,
sal_uInt16 nCalcLines = 0 );
- Size CalcItemSizePixel( const Size& rSize, sal_Bool bOut = sal_True ) const;
+ Size CalcItemSizePixel( const Size& rSize, bool bOut = true ) const;
long GetScrollWidth() const;
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
@@ -425,6 +428,9 @@ public:
void SetHighlightHdl( const Link& rLink );
const Link& GetHighlightHdl() const;
+ bool GetEdgeBlending() const { return mbEdgeBlending; }
+ void SetEdgeBlending(bool bNew);
+
private:
/** Determine whether RTL (right to left writing) is active. For this
method to return <true/> two conditions have to be fullfilled:
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 8ca7243..e5e06a86 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -86,10 +86,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);
@@ -100,10 +98,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; };
};
@@ -308,51 +304,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)
- {
- LogHelper::logIt(ex);
- }
-
- 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)
- {
- LogHelper::logIt(ex);
- }
-
- 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)
{
@@ -362,15 +322,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)
{
@@ -562,70 +522,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)
- {
- LogHelper::logIt(ex);
+ 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)
{
- LogHelper::logIt(ex);
+ 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;
@@ -637,15 +585,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;
@@ -759,26 +707,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)
@@ -821,20 +757,12 @@ 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);
+}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 274e87e..6e17dc1 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -68,10 +68,8 @@ DECLARE_LIST( ImpColorList, ImplColorListData* )
void ColorListBox::ImplInit()
{
pColorList = new ImpColorList( 256, 64 );
- aImageSize.Width() = GetTextWidth( XubString( RTL_CONSTASCII_USTRINGPARAM( "xxx" ) ) );
- aImageSize.Height() = GetTextHeight();
- aImageSize.Height() -= 2;
-
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ aImageSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
EnableUserDraw( sal_True );
SetUserItemSize( aImageSize );
}
@@ -94,6 +92,7 @@ ColorListBox::ColorListBox( Window* pParent, WinBits nWinStyle ) :
ListBox( pParent, nWinStyle )
{
ImplInit();
+ SetEdgeBlending(true);
}
// -----------------------------------------------------------------------
@@ -102,6 +101,7 @@ ColorListBox::ColorListBox( Window* pParent, const ResId& rResId ) :
ListBox( pParent, rResId )
{
ImplInit();
+ SetEdgeBlending(true);
}
// -----------------------------------------------------------------------
@@ -215,13 +215,36 @@ void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt )
if ( pData->bColor )
{
Point aPos( rUDEvt.GetRect().TopLeft() );
+
aPos.X() += 2;
aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aImageSize.Height() ) / 2;
+
+ const Rectangle aRect(aPos, aImageSize);
+
rUDEvt.GetDevice()->Push();
rUDEvt.GetDevice()->SetFillColor( pData->aColor );
rUDEvt.GetDevice()->SetLineColor( rUDEvt.GetDevice()->GetTextColor() );
- rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) );
+ rUDEvt.GetDevice()->DrawRect(aRect);
rUDEvt.GetDevice()->Pop();
+
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0);
+
+ if(nEdgeBlendingPercent)
+ {
+ Bitmap aBitmap(rUDEvt.GetDevice()->GetBitmap(aRect.TopLeft(), aRect.GetSize()));
+
+ if(!aBitmap.IsEmpty())
+ {
+ const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor());
+ const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor());
+ const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
+
+ aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight);
+ rUDEvt.GetDevice()->DrawBitmap(aRect.TopLeft(), aBitmap);
+ }
+ }
+
ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_False );
}
else
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 85f5ee9..eb0d2d1 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <rtl/ustring.hxx>
-#include <svtools/accessibilityoptions.hxx>
#include "valueimp.hxx"
#define _SV_VALUESET_CXX
@@ -70,16 +69,17 @@ void ValueSet::ImplInit()
mnUserVisLines = 0;
mnSpacing = 0;
mnFrameStyle = 0;
- mbFormat = sal_True;
- mbHighlight = sal_False ;
- mbSelection = sal_False;
- mbNoSelection = sal_True;
- mbDrawSelection = sal_True;
- mbBlackSel = sal_False;
- mbDoubleSel = sal_False;
- mbScroll = sal_False;
- mbDropPos = sal_False;
- mbFullMode = sal_True;
+ mbFormat = true;
+ mbHighlight = false;
+ mbSelection = false;
+ mbNoSelection = true;
+ mbDrawSelection = true;
+ mbBlackSel = false;
+ mbDoubleSel = false;
+ mbScroll = false;
+ mbDropPos = false;
+ mbFullMode = true;
+ mbEdgeBlending = false;
// #106446#, #106601# force mirroring of virtual device
maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
@@ -152,8 +152,7 @@ void ValueSet::ImplDeleteItems()
// -----------------------------------------------------------------------
-void ValueSet::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void ValueSet::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -256,9 +255,10 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
{
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
if ( pItem == mpNoneItem )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
maVirDev.SetFont( GetFont() );
maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() );
maVirDev.SetTextFillColor();
@@ -284,29 +284,9 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
{
maVirDev.SetFillColor( pItem->maColor );
maVirDev.DrawRect( aRect );
-
- const SvtAccessibilityOptions aOptions;
- const sal_Int16 nEdgeBlendingPercent(aOptions.GetEdgeBlending());
- static bool bTest(false);
-
- if(nEdgeBlendingPercent && bTest)
- {
- Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
-
- if(!aBitmap.IsEmpty())
- {
- const Color aTopLeft(COL_WHITE);
- const Color aBottomRight(COL_BLACK);
- const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
-
- aBitmap.DrawBlendFrame(nAlpha, aTopLeft, aBottomRight);
- maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
- }
- }
}
else
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsColor() )
maVirDev.SetFillColor( maColor );
else if ( nStyle & WB_MENUSTYLEVALUESET )
@@ -345,6 +325,23 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle );
}
}
+
+ const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0);
+
+ if(nEdgeBlendingPercent)
+ {
+ Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
+
+ if(!aBitmap.IsEmpty())
+ {
+ const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor());
+ const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor());
+ const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
+
+ aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight);
+ maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
+ }
+ }
}
}
@@ -451,7 +448,7 @@ void ValueSet::Format()
mnCols = mnUserCols;
// Zeilenanzahl berechnen
- mbScroll = sal_False;
+ mbScroll = false;
mnLines = (long)mpImpl->mpItemList->Count() / mnCols;
if ( mpImpl->mpItemList->Count() % mnCols )
mnLines++;
@@ -470,7 +467,7 @@ void ValueSet::Format()
else
mnVisLines = mnLines;
if ( mnLines > mnVisLines )
- mbScroll = sal_True;
+ mbScroll = true;
if ( mnLines <= mnVisLines )
mnFirstLine = 0;
else
@@ -550,17 +547,17 @@ void ValueSet::Format()
(aHighColor.GetBlue() > 0x80)) ||
((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
(aHighColor.GetBlue() == 0x80)) )
- mbBlackSel = sal_True;
+ mbBlackSel = true;
else
- mbBlackSel = sal_False;
+ mbBlackSel = false;
// Wenn die Items groesser sind, dann die Selektion doppelt so breit
// zeichnen
if ( (nStyle & WB_DOUBLEBORDER) &&
((nItemWidth >= 25) && (nItemHeight >= 20)) )
- mbDoubleSel = sal_True;
+ mbDoubleSel = true;
else
- mbDoubleSel = sal_False;
+ mbDoubleSel = false;
// Calculate offsets
long nStartX;
@@ -682,7 +679,7 @@ void ValueSet::Format()
}
// Jetzt haben wir formatiert und warten auf das naechste
- mbFormat = sal_False;
+ mbFormat = false;
// ScrollBar loeschen
if ( pDelScrBar )
@@ -947,12 +944,12 @@ void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection )
// Wenn keiner selektiert ist, dann Selektion nicht malen
if ( !bIsSelection && mbNoSelection )
- mbDrawSelection = sal_False;
+ mbDrawSelection = false;
// Neu ausgeben und alte Selection wegnehmen
ImplHideSelect( nOldItem );
ImplDrawSelect();
- mbDrawSelection = sal_True;
+ mbDrawSelection = true;
}
}
@@ -1140,7 +1137,7 @@ sal_Bool ValueSet::ImplScroll( const Point& rPos )
if ( mnFirstLine != nOldLine )
{
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
return sal_True;
}
@@ -1275,7 +1272,7 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
if ( nNewFirstLine != mnFirstLine )
{
mnFirstLine = nNewFirstLine;
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
}
return 0;
@@ -1310,14 +1307,14 @@ void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat )
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = sal_True;
+ mbHighlight = true;
ImplHighlightItem( pItem->mnId );
}
else
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = sal_True;
+ mbHighlight = true;
ImplHighlightItem( mnSelItemId, sal_False );
}
@@ -1340,15 +1337,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )
SelectItem( pItem->mnId );
if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
GrabFocus();
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ mbHighlight = false;
+ mbSelection = false;
Select();
}
else
{
ImplHighlightItem( mnSelItemId, sal_False );
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ mbHighlight = false;
+ mbSelection = false;
}
}
@@ -1361,7 +1358,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
if ( mbSelection )
{
- mbHighlight = sal_True;
+ mbHighlight = true;
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
mnOldItemId = mnSelItemId;
@@ -1378,7 +1375,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
{
mnOldItemId = mnSelItemId;
- mbHighlight = sal_True;
+ mbHighlight = true;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
StartTracking( STARTTRACK_SCROLLREPEAT );
@@ -1712,7 +1709,7 @@ void ValueSet::LoseFocus()
void ValueSet::Resize()
{
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
Control::Resize();
@@ -1786,7 +1783,7 @@ void ValueSet::StateChanged( StateChangedType nType )
}
else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
{
- mbFormat = sal_True;
+ mbFormat = true;
ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
@@ -1804,7 +1801,7 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = sal_True;
+ mbFormat = true;
ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
@@ -1844,7 +1841,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, sal_uInt16 n
pItem->maImage = rImage;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1863,7 +1860,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, sal_uInt16 n
pItem->maColor = rColor;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1884,7 +1881,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
pItem->maText = rText;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1905,7 +1902,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
pItem->maText = rText;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1923,7 +1920,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos )
pItem->meType = VALUESETITEM_USERDRAW;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1941,7 +1938,7 @@ void ValueSet::InsertSpace( sal_uInt16 nItemId, sal_uInt16 nPos )
pItem->meType = VALUESETITEM_SPACE;
mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos );
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1964,10 +1961,10 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = sal_True;
+ mbNoSelection = true;
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2003,9 +2000,9 @@ void ValueSet::CopyItems( const ValueSet& rValueSet )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = sal_True;
+ mbNoSelection = true;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2022,9 +2019,9 @@ void ValueSet::Clear()
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = sal_True;
+ mbNoSelection = true;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2088,7 +2085,7 @@ Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::EnableFullItemMode( sal_Bool bFullMode )
+void ValueSet::EnableFullItemMode( bool bFullMode )
{
mbFullMode = bFullMode;
}
@@ -2100,7 +2097,7 @@ void ValueSet::SetColCount( sal_uInt16 nNewCols )
if ( mnUserCols != nNewCols )
{
mnUserCols = nNewCols;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2113,7 +2110,7 @@ void ValueSet::SetLineCount( sal_uInt16 nNewLines )
if ( mnUserVisLines != nNewLines )
{
mnUserVisLines = nNewLines;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2126,7 +2123,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
if ( mnUserItemWidth != nNewItemWidth )
{
mnUserItemWidth = nNewItemWidth;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2139,7 +2136,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
if ( mnUserItemHeight != nNewItemHeight )
{
mnUserItemHeight = nNewItemHeight;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2152,7 +2149,7 @@ void ValueSet::SetFirstLine( sal_uInt16 nNewLine )
if ( mnFirstLine != nNewLine )
{
mnFirstLine = nNewLine;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2177,7 +2174,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
{
sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
mnSelItemId = nItemId;
- mbNoSelection = sal_False;
+ mbNoSelection = false;
sal_Bool bNewOut;
sal_Bool bNewLine;
@@ -2209,7 +2206,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
{
// Falls sich der sichtbare Bereich geaendert hat,
// alles neu ausgeben
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
}
else
@@ -2291,9 +2288,9 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
void ValueSet::SetNoSelection()
{
- mbNoSelection = sal_True;
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ mbNoSelection = true;
+ mbHighlight = false;
+ mbSelection = false;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
@@ -2340,7 +2337,7 @@ void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
// -----------------------------------------------------------------------
@@ -2374,7 +2371,7 @@ void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
// -----------------------------------------------------------------------
@@ -2409,7 +2406,7 @@ void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
}
@@ -2485,7 +2482,7 @@ XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
void ValueSet::SetColor( const Color& rColor )
{
maColor = rColor;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
}
@@ -2498,7 +2495,7 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
{
mnSpacing = nNewSpacing;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2509,8 +2506,8 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
void ValueSet::StartSelection()
{
mnOldItemId = mnSelItemId;
- mbHighlight = sal_True;
- mbSelection = sal_True;
+ mbHighlight = true;
+ mbSelection = true;
mnHighItemId = mnSelItemId;
}
@@ -2524,9 +2521,9 @@ void ValueSet::EndSelection()
EndTracking( ENDTRACK_CANCEL );
ImplHighlightItem( mnSelItemId );
- mbHighlight = sal_False;
+ mbHighlight = false;
}
- mbSelection = sal_False;
+ mbSelection = false;
}
// -----------------------------------------------------------------------
@@ -2655,7 +2652,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
// -----------------------------------------------------------------------
-Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const
+Size ValueSet::CalcItemSizePixel( const Size& rItemSize, bool bOut ) const
{
Size aSize = rItemSize;
@@ -2701,7 +2698,7 @@ long ValueSet::GetScrollWidth() const
sal_uInt16 ValueSet::ShowDropPos( const Point& rPos )
{
- mbDropPos = sal_True;
+ mbDropPos = true;
// Gegebenenfalls scrollen
ImplScroll( rPos );
@@ -2744,7 +2741,7 @@ void ValueSet::HideDropPos()
if ( mbDropPos )
{
ImplDrawDropPos( sal_False );
- mbDropPos = sal_False;
+ mbDropPos = false;
}
}
@@ -2771,3 +2768,19 @@ const Link& ValueSet::GetHighlightHdl() const
// -----------------------------------------------------------------------
+void ValueSet::SetEdgeBlending(bool bNew)
+{
+ if(mbEdgeBlending != bNew)
+ {
+ mbEdgeBlending = bNew;
+ mbFormat = true;
+
+ if(IsReallyVisible() && IsUpdateMode())
+ {
+ Invalidate();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+// eof
diff --git a/svtools/source/inc/configitems/accessibilityoptions_const.hxx b/svtools/source/inc/configitems/accessibilityoptions_const.hxx
index 82818be..1103232 100644
--- a/svtools/source/inc/configitems/accessibilityoptions_const.hxx
+++ b/svtools/source/inc/configitems/accessibilityoptions_const.hxx
@@ -41,11 +41,8 @@ namespace
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_sColorValueSetMaximumRowCount = ::rtl::OUString::createFromAscii("ColorValueSetMaximumRowCount");
- static const ::rtl::OUString s_sColorValueSetEntryEdgeLength = ::rtl::OUString::createFromAscii("ColorValueSetEntryEdgeLength");
- static const ::rtl::OUString s_sColorValueSetColumnCount = ::rtl::OUString::createFromAscii("ColorValueSetColumnCount");
- static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending");
+ static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending");
+ static const ::rtl::OUString s_sListBoxMaximumLineCount = ::rtl::OUString::createFromAscii("ListBoxMaximumLineCount");
}
#endif // INCLUDE_CONFIGITEMS_ACCESSIBILITYOPTIONS_CONST_HXX
diff --git a/svx/inc/svx/dlgctrl.hxx b/svx/inc/svx/dlgctrl.hxx
index 2b0fdc8..d69d228 100644
--- a/svx/inc/svx/dlgctrl.hxx
+++ b/svx/inc/svx/dlgctrl.hxx
@@ -30,6 +30,7 @@
#include "svx/svxdllapi.h"
#include <svx/rectenum.hxx>
#include <vcl/graph.hxx>
+
#ifndef _XTABLE_HXX
class XBitmapEntry;
class XBitmapList;
@@ -274,20 +275,17 @@ class SVX_DLLPUBLIC HatchingLB : public ListBox
{
public:
- HatchingLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True );
- HatchingLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw = sal_True );
+ explicit HatchingLB( Window* pParent, ResId Id);
+ explicit HatchingLB( Window* pParent, WinBits aWB);
virtual void Fill( const XHatchList* pList );
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
void Append( XHatchEntry* pEntry, Bitmap* pBmp = NULL );
void Modify( XHatchEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
- void SelectEntryByList( const XHatchList* pList, const String& rStr,
- const XHatch& rXHatch, sal_uInt16 nDist = 0 );
+ void SelectEntryByList( const XHatchList* pList, const String& rStr, const XHatch& rXHatch, sal_uInt16 nDist = 0 );
private:
XHatchList* mpList;
- sal_Bool mbUserDraw;
};
/*************************************************************************
@@ -298,20 +296,17 @@ private:
class SVX_DLLPUBLIC GradientLB : public ListBox
{
public:
- GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw = sal_True );
- GradientLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw = sal_True );
+ explicit GradientLB( Window* pParent, ResId Id);
+ explicit GradientLB( Window* pParent, WinBits aWB);
virtual void Fill( const XGradientList* pList );
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
void Append( XGradientEntry* pEntry, Bitmap* pBmp = NULL );
void Modify( XGradientEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL );
- void SelectEntryByList( const XGradientList* pList, const String& rStr,
- const XGradient& rXGradient, sal_uInt16 nDist = 0 );
+ void SelectEntryByList( const XGradientList* pList, const String& rStr, const XGradient& rXGradient, sal_uInt16 nDist = 0 );
private:
XGradientList* mpList;
- sal_Bool mbUserDraw;
};
/*************************************************************************
@@ -322,23 +317,18 @@ private:
class SVX_DLLPUBLIC BitmapLB : public ListBox
{
public:
- BitmapLB(Window* pParent, ResId Id, bool bUserDraw = true);
+ explicit BitmapLB(Window* pParent, ResId Id);
virtual void Fill(const XBitmapList* pList);
- virtual void UserDraw(const UserDrawEvent& rUDEvt);
void Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* pBmpEx = 0);
void Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16 nPos, BitmapEx* pBmpEx = 0);
void SelectEntryByList(const XBitmapList* pList, const String& rStr);
private:
- VirtualDevice maVD;
BitmapEx maBitmapEx;
XBitmapList* mpList;
- bool mbUserDraw;
-
- SVX_DLLPRIVATE void SetVirtualDevice(const Size& rSize);
};
/*************************************************************************
@@ -349,11 +339,8 @@ private:
class FillAttrLB : public ColorListBox
{
private:
- VirtualDevice maVD;
BitmapEx maBitmapEx;
- void SetVirtualDevice(const Size& rSize);
-
public:
FillAttrLB( Window* pParent, ResId Id );
FillAttrLB( Window* pParent, WinBits aWB );
diff --git a/svx/inc/svx/xtable.hxx b/svx/inc/svx/xtable.hxx
index 6ba0dde..dca32c0 100644
--- a/svx/inc/svx/xtable.hxx
+++ b/svx/inc/svx/xtable.hxx
@@ -228,10 +228,6 @@ public:
virtual sal_Bool Load() = 0;
virtual sal_Bool Save() = 0;
virtual sal_Bool Create() = 0;
-
- sal_uInt32 getUiBitmapWidth() const;
- sal_uInt32 getUiBitmapHeight() const;
- sal_uInt32 getUiBitmapLineWidth() const;
};
// -------------------
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a0e8c4c..80fb23b 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1105,6 +1105,8 @@ void ColorLB::Fill( const XColorList* pColorTab )
pEntry = pColorTab->GetColor( i );
InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
@@ -1113,6 +1115,7 @@ void ColorLB::Fill( const XColorList* pColorTab )
void ColorLB::Append( XColorEntry* pEntry, Bitmap* )
{
InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
@@ -1140,6 +1143,8 @@ void FillAttrLB::Fill( const XColorList* pColorTab )
pEntry = pColorTab->GetColor( i );
InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
@@ -1149,20 +1154,18 @@ void FillAttrLB::Fill( const XColorList* pColorTab )
|*
\************************************************************************/
-HatchingLB::HatchingLB( Window* pParent, ResId Id, sal_Bool bUserDraw /*= sal_True*/ )
+HatchingLB::HatchingLB( Window* pParent, ResId Id)
: ListBox( pParent, Id ),
- mpList ( NULL ),
- mbUserDraw( bUserDraw )
+ mpList ( NULL )
{
- EnableUserDraw( mbUserDraw );
+ SetEdgeBlending(true);
}
-HatchingLB::HatchingLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw /*= sal_True*/ )
+HatchingLB::HatchingLB( Window* pParent, WinBits aWB)
: ListBox( pParent, aWB ),
- mpList ( NULL ),
- mbUserDraw( bUserDraw )
+ mpList ( NULL )
{
- EnableUserDraw( mbUserDraw );
+ SetEdgeBlending(true);
}
void HatchingLB::Fill( const XHatchList* pList )
@@ -1173,65 +1176,20 @@ void HatchingLB::Fill( const XHatchList* pList )
SetUpdateMode( sal_False );
- if( mbUserDraw )
- {
- for( long i = 0; i < nCount; i++ )
- InsertEntry( pList->GetHatch( i )->GetName() );
- }
- else
+ for( long i = 0; i < nCount; i++ )
{
- for( long i = 0; i < nCount; i++ )
- {
- pEntry = pList->GetHatch( i );
- const Bitmap aBitmap = pList->GetUiBitmap( i );
- if( !aBitmap.IsEmpty() )
- InsertEntry( pEntry->GetName(), aBitmap );
- else
- InsertEntry( pEntry->GetName() );
- }
+ pEntry = pList->GetHatch( i );
+ const Bitmap aBitmap = pList->GetUiBitmap( i );
+ if( !aBitmap.IsEmpty() )
+ InsertEntry( pEntry->GetName(), aBitmap );
+ else
+ InsertEntry( pEntry->GetName() );
}
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
-void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt )
-{
- if( mpList != NULL )
- {
- // Draw gradient with borderrectangle
- const Rectangle& rDrawRect = rUDEvt.GetRect();
- Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 );
-
- sal_Int32 nId = rUDEvt.GetItemId();
- if( nId >= 0 && nId <= mpList->Count() )
- {
- OutputDevice* pDevice = rUDEvt.GetDevice();
-
- sal_uIntPtr nOldDrawMode = pDevice->GetDrawMode();
- pDevice->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
-
- const XHatch& rXHatch = mpList->GetHatch( rUDEvt.GetItemId() )->GetHatch();
- MapMode aMode( MAP_100TH_MM );
- Hatch aHatch( (HatchStyle) rXHatch.GetHatchStyle(),
- rXHatch.GetColor(),
- rUDEvt.GetDevice()->LogicToPixel( Point( rXHatch.GetDistance(), 0 ), aMode ).X(),
- (sal_uInt16)rXHatch.GetAngle() );
- const Polygon aPolygon( aRect );
- const PolyPolygon aPolypoly( aPolygon );
- pDevice->DrawHatch( aPolypoly, aHatch );
-
- pDevice->SetLineColor( COL_BLACK );
- pDevice->SetFillColor();
- pDevice->DrawRect( aRect );
-
- pDevice->SetDrawMode( nOldDrawMode );
-
- // Draw name
- pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetHatch( rUDEvt.GetItemId() )->GetName() );
- }
- }
-}
-
/************************************************************************/
void HatchingLB::Append( XHatchEntry* pEntry, Bitmap* pBmp )
@@ -1240,6 +1198,7 @@ void HatchingLB::Append( XHatchEntry* pEntry, Bitmap* pBmp )
InsertEntry( pEntry->GetName(), *pBmp );
else
InsertEntry( pEntry->GetName() );
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
@@ -1299,6 +1258,8 @@ void FillAttrLB::Fill( const XHatchList* pList )
else
InsertEntry( pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
ListBox::SetUpdateMode( sal_True );
}
@@ -1308,20 +1269,18 @@ void FillAttrLB::Fill( const XHatchList* pList )
|*
\************************************************************************/
-GradientLB::GradientLB( Window* pParent, ResId Id, sal_Bool bUserDraw /*= sal_True*/ )
+GradientLB::GradientLB( Window* pParent, ResId Id)
: ListBox( pParent, Id ),
- mpList(NULL),
- mbUserDraw( bUserDraw )
+ mpList(NULL)
{
- EnableUserDraw( mbUserDraw);
+ SetEdgeBlending(true);
}
-GradientLB::GradientLB( Window* pParent, WinBits aWB, sal_Bool bUserDraw /*= sal_True*/ )
+GradientLB::GradientLB( Window* pParent, WinBits aWB)
: ListBox( pParent, aWB ),
- mpList(NULL),
- mbUserDraw( bUserDraw )
+ mpList(NULL)
{
- EnableUserDraw( mbUserDraw );
+ SetEdgeBlending(true);
}
void GradientLB::Fill( const XGradientList* pList )
@@ -1332,78 +1291,20 @@ void GradientLB::Fill( const XGradientList* pList )
SetUpdateMode( sal_False );
- if( mbUserDraw )
- {
- for( long i = 0; i < nCount; i++ )
- InsertEntry( pList->GetGradient( i )->GetName() );
- }
- else
+ for( long i = 0; i < nCount; i++ )
{
- for( long i = 0; i < nCount; i++ )
- {
- pEntry = pList->GetGradient( i );
- const Bitmap aBitmap = pList->GetUiBitmap( i );
- if( !aBitmap.IsEmpty() )
- InsertEntry( pEntry->GetName(), aBitmap );
- else
- InsertEntry( pEntry->GetName() );
- }
+ pEntry = pList->GetGradient( i );
+ const Bitmap aBitmap = pList->GetUiBitmap( i );
+ if( !aBitmap.IsEmpty() )
+ InsertEntry( pEntry->GetName(), aBitmap );
+ else
+ InsertEntry( pEntry->GetName() );
}
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
-void GradientLB::UserDraw( const UserDrawEvent& rUDEvt )
-{
- if( mpList != NULL )
- {
- // Draw gradient with borderrectangle
- const Rectangle& rDrawRect = rUDEvt.GetRect();
- Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 );
-
- sal_Int32 nId = rUDEvt.GetItemId();
- if( nId >= 0 && nId <= mpList->Count() )
- {
- OutputDevice* pDevice = rUDEvt.GetDevice();
-
- const XGradient& rXGrad = mpList->GetGradient( rUDEvt.GetItemId() )->GetGradient();
- Gradient aGradient( (GradientStyle) rXGrad.GetGradientStyle(), rXGrad.GetStartColor(), rXGrad.GetEndColor() );
- aGradient.SetAngle( (sal_uInt16)rXGrad.GetAngle() );
- aGradient.SetBorder( rXGrad.GetBorder() );
- aGradient.SetOfsX( rXGrad.GetXOffset() );
- aGradient.SetOfsY( rXGrad.GetYOffset() );
- aGradient.SetStartIntensity( rXGrad.GetStartIntens() );
- aGradient.SetEndIntensity( rXGrad.GetEndIntens() );
- aGradient.SetSteps( 255 );
-
- // #i76307# always paint the preview in LTR, because this is what the document does
- Window* pWin = dynamic_cast<Window*>(pDevice);
- if( pWin && pWin->IsRTLEnabled() && Application::GetSettings().GetLayoutRTL())
- {
- long nWidth = pDevice->GetOutputSize().Width();
-
- pWin->EnableRTL( sal_False );
-
- Rectangle aMirrorRect( Point( nWidth - aRect.Left() - aRect.GetWidth(), aRect.Top() ),
- aRect.GetSize() );
-
- pDevice->DrawGradient( aMirrorRect, aGradient );
-
- pWin->EnableRTL( sal_True );
- }
- else
- pDevice->DrawGradient( aRect, aGradient );
-
- pDevice->SetLineColor( COL_BLACK );
- pDevice->SetFillColor();
- pDevice->DrawRect( aRect );
-
- // Draw name
- pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetGradient( rUDEvt.GetItemId() )->GetName() );
- }
- }
-}
-
/************************************************************************/
void GradientLB::Append( XGradientEntry* pEntry, Bitmap* pBmp )
@@ -1412,6 +1313,7 @@ void GradientLB::Append( XGradientEntry* pEntry, Bitmap* pBmp )
InsertEntry( pEntry->GetName(), *pBmp );
else
InsertEntry( pEntry->GetName() );
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
@@ -1471,6 +1373,8 @@ void FillAttrLB::Fill( const XGradientList* pList )
else
InsertEntry( pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
ListBox::SetUpdateMode( sal_True );
}
@@ -1480,41 +1384,61 @@ void FillAttrLB::Fill( const XGradientList* pList )
|*
\************************************************************************/
-BitmapLB::BitmapLB(Window* pParent, ResId Id, bool bUserDraw /*= false*/ )
+BitmapLB::BitmapLB(Window* pParent, ResId Id)
: ListBox(pParent, Id),
- maVD(),
maBitmapEx(),
- mpList(NULL),
- mbUserDraw(bUserDraw)
+ mpList(NULL)
{
- EnableUserDraw(mbUserDraw);
+ SetEdgeBlending(true);
}
/************************************************************************/
-void BitmapLB::SetVirtualDevice(const Size& rSize)
+namespace
{
- maVD.SetOutputSizePixel(rSize);
-
- if(maBitmapEx.GetSizePixel().Width() > 8 || maBitmapEx.GetSizePixel().Height() > 8)
+ void formatBitmapExToSize(BitmapEx& rBitmapEx, const Size& rSize)
{
- maVD.DrawBitmapEx(Point(0, 0), rSize, maBitmapEx);
- }
- else
- {
- const Size aBitmapSize(maBitmapEx.GetSizePixel());
-
- for(sal_Int32 y(0); y < rSize.Height(); y += aBitmapSize.Height())
+ if(!rBitmapEx.IsEmpty() && rSize.Width() > 0 && rSize.Height() > 0)
{
- for(sal_Int32 x(0); x < rSize.Width(); x += aBitmapSize.Width())
+ VirtualDevice aVirtualDevice;
+ aVirtualDevice.SetOutputSizePixel(rSize);
+
+ if(rBitmapEx.IsTransparent())
+ {
+ const Point aNull(0, 0);
+ static const sal_uInt32 nLen(8);
+ static const Color aW(COL_WHITE);
+ static const Color aG(0xef, 0xef, 0xef);
+
+ aVirtualDevice.DrawCheckered(aNull, rSize, nLen, aW, aG);
+ }
+
+ if(rBitmapEx.GetSizePixel().Width() >= rSize.Width() && rBitmapEx.GetSizePixel().Height() >= rSize.Height())
+ {
+ static sal_uInt32 nScaleFlag(BMP_SCALE_FASTESTINTERPOLATE);
+
+ rBitmapEx.Scale(rSize, nScaleFlag);
+ aVirtualDevice.DrawBitmapEx(Point(0, 0), rBitmapEx);
+ }
+ else
{
- maVD.DrawBitmapEx(
- Point(x, y),
- maBitmapEx);
+ const Size aBitmapSize(rBitmapEx.GetSizePixel());
+
+ for(sal_Int32 y(0); y < rSize.Height(); y += aBitmapSize.Height())
+ {
+ for(sal_Int32 x(0); x < rSize.Width(); x += aBitmapSize.Width())
+ {
+ aVirtualDevice.DrawBitmapEx(
+ Point(x, y),
+ rBitmapEx);
+ }
+ }
}
+
+ rBitmapEx = aVirtualDevice.GetBitmap(Point(0, 0), rSize);
}
}
-}
+} // end of anonymous namespace
/************************************************************************/
@@ -1523,76 +1447,23 @@ void BitmapLB::Fill(const XBitmapList* pList)
mpList = (XBitmapList*)pList;
XBitmapEntry* pEntry;
const long nCount(pList->Count());
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ const Size aSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize());
SetUpdateMode(false);
- if(mbUserDraw)
- {
- for(long i(0); i < nCount; i++)
- {
- InsertEntry(pList->GetBitmap(i)->GetName());
- }
- }
- else
+ for(long i(0); i < nCount; i++)
{
- for(long i(0); i < nCount; i++)
- {
- pEntry = pList->GetBitmap(i);
- maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx();
- const Size aSize(pList->getUiBitmapWidth(), pList->getUiBitmapHeight());
- SetVirtualDevice(aSize);
- InsertEntry(
- pEntry->GetName(),
- maVD.GetBitmap(Point(0, 0),
- aSize));
- }
+ pEntry = pList->GetBitmap(i);
+ maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx();
+ formatBitmapExToSize(maBitmapEx, aSize);
+ InsertEntry(pEntry->GetName(), maBitmapEx);
}
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode(true);
}
-void BitmapLB::UserDraw(const UserDrawEvent& rUDEvt)
-{
- if(mpList)
- {
- // Draw bitmap
- const Rectangle& rDrawRect = rUDEvt.GetRect();
- const Rectangle aRect(rDrawRect.nLeft + 1, rDrawRect.nTop + 1, rDrawRect.nLeft + 33, rDrawRect.nBottom - 1);
- const sal_Int32 nId(rUDEvt.GetItemId());
-
- if(nId >= 0 && nId <= mpList->Count())
- {
- const Rectangle aClipRect(rDrawRect.nLeft + 1, rDrawRect.nTop + 1, rDrawRect.nRight - 1, rDrawRect.nBottom - 1);
- OutputDevice* pDevice = rUDEvt.GetDevice();
- pDevice->SetClipRegion(Region(aClipRect));
- maBitmapEx = mpList->GetBitmap(nId)->GetGraphicObject().GetGraphic().GetBitmapEx();
- long nPosBaseX = aRect.nLeft;
- long nPosBaseY = aRect.nTop;
-
- if(maBitmapEx.GetSizePixel().Width() > 8 || maBitmapEx.GetSizePixel().Height() > 8)
- {
- pDevice->DrawBitmapEx(Point(nPosBaseX, nPosBaseY), Size(32, 16), maBitmapEx);
- }
- else
- {
- pDevice->DrawBitmapEx(Point(nPosBaseX+ 0, nPosBaseY+0 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+ 8, nPosBaseY+0 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+16, nPosBaseY+0 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+24, nPosBaseY+0 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+ 0, nPosBaseY+8 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+ 8, nPosBaseY+8 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+16, nPosBaseY+8 ), maBitmapEx);
- pDevice->DrawBitmapEx(Point(nPosBaseX+24, nPosBaseY+8 ), maBitmapEx);
- }
-
- pDevice->SetClipRegion();
-
- // Draw name
- pDevice->DrawText(Point(aRect.nRight + 7, aRect.nTop - 1), mpList->GetBitmap(nId)->GetName());
- }
- }
-}
-
/************************************************************************/
void BitmapLB::Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* pBmpEx)
@@ -1600,16 +1471,15 @@ void BitmapLB::Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* p
if(pBmpEx)
{
maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx();
- SetVirtualDevice(rSize);
- InsertEntry(
- rEntry.GetName(),
- maVD.GetBitmap(Point(0, 0),
- rSize));
+ formatBitmapExToSize(maBitmapEx, rSize);
+ InsertEntry(rEntry.GetName(), maBitmapEx);
}
else
{
InsertEntry(rEntry.GetName());
}
+
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
@@ -1621,11 +1491,8 @@ void BitmapLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16
if(pBmpEx)
{
maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx();
- SetVirtualDevice(rSize);
- InsertEntry(
- rEntry.GetName(),
- maVD.GetBitmap(Point(0, 0), rSize),
- nPos);
+ formatBitmapExToSize(maBitmapEx, rSize);
+ InsertEntry(rEntry.GetName(), maBitmapEx, nPos);
}
else
{
@@ -1667,7 +1534,6 @@ void BitmapLB::SelectEntryByList(const XBitmapList* pList, const String& rStr)
FillAttrLB::FillAttrLB( Window* pParent, ResId Id )
: ColorListBox(pParent, Id),
- maVD(),
maBitmapEx()
{
}
@@ -1681,37 +1547,12 @@ FillAttrLB::FillAttrLB(Window* pParent, WinBits aWB)
/************************************************************************/
-void FillAttrLB::SetVirtualDevice(const Size& rSize)
-{
- maVD.SetOutputSizePixel(rSize);
- maVD.Erase();
-
- if(maBitmapEx.GetSizePixel().Width() > 8 || maBitmapEx.GetSizePixel().Height() > 8)
- {
- maVD.DrawBitmapEx(Point(0, 0), rSize, maBitmapEx);
- }
- else
- {
- const Size aBitmapSize(maBitmapEx.GetSizePixel());
-
- for(sal_Int32 y(0); y < rSize.Height(); y += aBitmapSize.Height())
- {
- for(sal_Int32 x(0); x < rSize.Width(); x += aBitmapSize.Width())
- {
- maVD.DrawBitmapEx(
- Point(x, y),
- maBitmapEx);
- }
- }
- }
-}
-
-/************************************************************************/
-
void FillAttrLB::Fill(const XBitmapList* pList)
{
const long nCount(pList->Count());
XBitmapEntry* pEntry;
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ const Size aSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize());
ListBox::SetUpdateMode(false);
@@ -1719,14 +1560,11 @@ void FillAttrLB::Fill(const XBitmapList* pList)
{
pEntry = pList->GetBitmap( i );
maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx();
- const Size aSize(pList->getUiBitmapWidth(), pList->getUiBitmapHeight());
- SetVirtualDevice(aSize);
- ListBox::InsertEntry(
- pEntry->GetName(),
- maVD.GetBitmap(Point(0, 0),
- aSize));
+ formatBitmapExToSize(maBitmapEx, aSize);
+ ListBox::InsertEntry(pEntry->GetName(), maBitmapEx);
}
+ AdaptDropDownLineCountToMaximum();
ListBox::SetUpdateMode(true);
}
@@ -1765,11 +1603,14 @@ void FillAttrLB::SelectEntryByList( const XBitmapList* pList, const String& rStr
void FillTypeLB::Fill()
{
SetUpdateMode( sal_False );
+
InsertEntry( String( SVX_RES( RID_SVXSTR_INVISIBLE ) ) );
InsertEntry( String( SVX_RES( RID_SVXSTR_COLOR ) ) );
InsertEntry( String( SVX_RES( RID_SVXSTR_GRADIENT ) ) );
InsertEntry( String( SVX_RES( RID_SVXSTR_HATCH ) ) );
InsertEntry( String( SVX_RES( RID_SVXSTR_BITMAP ) ) );
+
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
@@ -1782,12 +1623,14 @@ LineLB::LineLB(Window* pParent, ResId Id)
: ListBox(pParent, Id),
mbAddStandardFields(true)
{
+ // No EdgeBlending for LineStyle/Dash SetEdgeBlending(true);
}
LineLB::LineLB(Window* pParent, WinBits aWB)
: ListBox(pParent, aWB),
mbAddStandardFields(true)
{
+ // No EdgeBlending for LineStyle/Dash SetEdgeBlending(true);
}
LineLB::~LineLB()
@@ -1832,6 +1675,8 @@ void LineLB::Fill( const XDashList* pList )
else
InsertEntry( pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
@@ -1843,6 +1688,7 @@ void LineLB::Append( XDashEntry* pEntry, const Bitmap* pBmp )
InsertEntry( pEntry->GetName(), *pBmp );
else
InsertEntry( pEntry->GetName() );
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
@@ -1891,11 +1737,13 @@ void LineLB::SelectEntryByList( const XDashList* pList, const String& rStr,
LineEndLB::LineEndLB( Window* pParent, ResId Id )
: ListBox( pParent, Id )
{
+ // No EdgeBlending for LineEnds SetEdgeBlending(true);
}
LineEndLB::LineEndLB( Window* pParent, WinBits aWB )
: ListBox( pParent, aWB )
{
+ // No EdgeBlending for LineEnds SetEdgeBlending(true);
}
LineEndLB::~LineEndLB(void)
@@ -1927,6 +1775,8 @@ void LineEndLB::Fill( const XLineEndList* pList, sal_Bool bStart )
else
InsertEntry( pEntry->GetName() );
}
+
+ AdaptDropDownLineCountToMaximum();
SetUpdateMode( sal_True );
}
@@ -1947,6 +1797,7 @@ void LineEndLB::Append( XLineEndEntry* pEntry, const Bitmap* pBmp, sal_Bool bSta
}
else
InsertEntry( pEntry->GetName() );
+ AdaptDropDownLineCountToMaximum();
}
/************************************************************************/
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 466fee8..e926438 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -329,7 +329,7 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
mpLbFillAttr->Fill( aItem.GetGradientList() );
}
- mpLbFillAttr->SetDropDownLineCount(std::min(sal_uInt16(20), mpLbFillAttr->GetEntryCount()));
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if ( mnLastPosGradient != LISTBOX_ENTRY_NOTFOUND)
{
@@ -364,7 +364,7 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
mpLbFillAttr->Fill( aItem.GetHatchList() );
}
- mpLbFillAttr->SetDropDownLineCount(std::min(sal_uInt16(20), mpLbFillAttr->GetEntryCount()));
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if ( mnLastPosHatch != LISTBOX_ENTRY_NOTFOUND )
{
@@ -399,7 +399,7 @@ IMPL_LINK( AreaPropertyPanel, SelectFillTypeHdl, ListBox *, pToolBox )
mpLbFillAttr->Fill( aItem.GetBitmapList() );
}
- mpLbFillAttr->SetDropDownLineCount(std::min(sal_uInt16(20), mpLbFillAttr->GetEntryCount()));
+ mpLbFillAttr->AdaptDropDownLineCountToMaximum();
if ( mnLastPosBitmap != LISTBOX_ENTRY_NOTFOUND )
{
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 40b6279..7f0e52e 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -305,7 +305,7 @@ void LinePropertyPanel::Initialize()
aLink = LINK( this, LinePropertyPanel, ChangeLineStyleHdl );
mpLBStyle->SetSelectHdl( aLink );
mpLBStyle->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Style")));
- mpLBStyle->SetDropDownLineCount(std::min(sal_uInt16(20), mpLBStyle->GetEntryCount()));
+ mpLBStyle->AdaptDropDownLineCountToMaximum();
mpTBWidth->SetItemImage(TBI_WIDTH, mpIMGWidthIcon[0]);
aTbxSize = mpTBWidth->CalcWindowSizePixel() ;
@@ -324,11 +324,11 @@ void LinePropertyPanel::Initialize()
aLink = LINK( this, LinePropertyPanel, ChangeStartHdl );
mpLBStart->SetSelectHdl( aLink );
mpLBStart->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Beginning Style"))); //wj acc
- mpLBStart->SetDropDownLineCount(std::min(sal_uInt16(20), mpLBStart->GetEntryCount()));
+ mpLBStart->AdaptDropDownLineCountToMaximum();
aLink = LINK( this, LinePropertyPanel, ChangeEndHdl );
mpLBEnd->SetSelectHdl( aLink );
mpLBEnd->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Ending Style"))); //wj acc
- mpLBEnd->SetDropDownLineCount(std::min(sal_uInt16(20), mpLBEnd->GetEntryCount()));
+ mpLBEnd->AdaptDropDownLineCountToMaximum();
aLink = LINK(this, LinePropertyPanel, ChangeTransparentHdl);
mpMFTransparent->SetModifyHdl(aLink);
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 8e8d920..2266692 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -207,7 +207,7 @@ void PosSizePropertyPanel::Initialize()
mpMtrAngle->InsertValue(22500, FUNIT_CUSTOM);
mpMtrAngle->InsertValue(27000, FUNIT_CUSTOM);
mpMtrAngle->InsertValue(31500, FUNIT_CUSTOM);
- mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
+ mpMtrAngle->AdaptDropDownLineCountToMaximum();
SfxViewShell* pCurSh = SfxViewShell::Current();
if ( pCurSh )
diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx
index 55333d9..b546528 100755
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -24,39 +24,41 @@
#include <svx/SvxColorValueSet.hxx>
#include <svx/xtable.hxx>
-#include <svtools/accessibilityoptions.hxx>
+#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
SvxColorValueSet::SvxColorValueSet(Window* _pParent, WinBits nWinStyle)
: ValueSet(_pParent, nWinStyle)
{
+ SetEdgeBlending(true);
}
SvxColorValueSet::SvxColorValueSet(Window* _pParent, const ResId& rResId)
: ValueSet(_pParent, rResId)
{
+ SetEdgeBlending(true);
}
sal_uInt32 SvxColorValueSet::getMaxRowCount() const
{
- const SvtAccessibilityOptions aOptions;
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- return aOptions.GetColorValueSetMaximumRowCount();
+ return rStyleSettings.GetColorValueSetMaximumRowCount();
}
sal_uInt32 SvxColorValueSet::getEntryEdgeLength() const
{
- const SvtAccessibilityOptions aOptions;
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- return aOptions.GetColorValueSetEntryEdgeLength();
+ return rStyleSettings.GetListBoxPreviewDefaultPixelSize().Height() + 1;
}
sal_uInt32 SvxColorValueSet::getColumnCount() const
{
- const SvtAccessibilityOptions aOptions;
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- return aOptions.GetColorValueSetColumnCount();
+ return rStyleSettings.GetColorValueSetColumnCount();
}
void SvxColorValueSet::addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 nStartIndex)
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 043f1a1..52d0397 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -117,9 +117,10 @@ void XDashList::impCreate()
VirtualDevice* pVirDev = new VirtualDevice;
OSL_ENSURE(0 != pVirDev, "XDashList: no VirtualDevice created!" );
pVirDev->SetMapMode(MAP_100TH_MM);
+ const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
const Size aSize(pVirDev->PixelToLogic(Size(
- bUseDoubleSize ? getUiBitmapWidth() * 5 : getUiBitmapWidth() * 5 / 2,
- bUseDoubleSize ? getUiBitmapHeight() * 2 : getUiBitmapHeight())));
+ bUseDoubleSize ? rSize.Width() * 5 : rSize.Width() * 5 / 2,
+ bUseDoubleSize ? rSize.Height() * 2 : rSize.Height())));
pVirDev->SetOutputSize(aSize);
pVirDev->SetDrawMode(rStyleSettings.GetHighContrastMode()
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
@@ -149,7 +150,7 @@ void XDashList::impCreate()
pLineObject->SetModel(pSdrModel);
pLineObject->SetMergedItem(XLineStyleItem(XLINE_DASH));
pLineObject->SetMergedItem(XLineColorItem(String(), rStyleSettings.GetFieldTextColor()));
- const Size aLineWidth(pVirDev->PixelToLogic(Size(getUiBitmapLineWidth(), 0)));
+ const Size aLineWidth(pVirDev->PixelToLogic(Size(rStyleSettings.GetListBoxPreviewDefaultLineWidth(), 0)));
pLineObject->SetMergedItem(XLineWidthItem(bUseDoubleSize ? aLineWidth.getWidth() * 2 : aLineWidth.getWidth()));
mpData = new impXDashList(pVirDev, pSdrModel, pBackgroundObject, pLineObject);
OSL_ENSURE(0 != mpData, "XDashList: data creation went wrong!" );
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 69e19ac..41a676b 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -106,7 +106,8 @@ void XGradientList::impCreate()
VirtualDevice* pVirDev = new VirtualDevice;
OSL_ENSURE(0 != pVirDev, "XGradientList: no VirtualDevice created!" );
pVirDev->SetMapMode(MAP_100TH_MM);
- const Size aSize(pVirDev->PixelToLogic(Size(getUiBitmapWidth(), getUiBitmapHeight())));
+ const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
+ const Size aSize(pVirDev->PixelToLogic(rSize));
pVirDev->SetOutputSize(aSize);
pVirDev->SetDrawMode(rStyleSettings.GetHighContrastMode()
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
@@ -125,7 +126,7 @@ void XGradientList::impCreate()
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_GRADIENT));
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_SOLID));
pBackgroundObject->SetMergedItem(XLineColorItem(String(), Color(COL_BLACK)));
- pBackgroundObject->SetMergedItem(XGradientStepCountItem(sal_uInt16((getUiBitmapWidth() + getUiBitmapHeight()) / 3)));
+ pBackgroundObject->SetMergedItem(XGradientStepCountItem(sal_uInt16((rSize.Width() + rSize.Height()) / 3)));
mpData = new impXGradientList(pVirDev, pSdrModel, pBackgroundObject);
OSL_ENSURE(0 != mpData, "XGradientList: data creation went wrong!" );
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 7f0e6d7..0b0a705 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -109,7 +109,7 @@ void XHatchList::impCreate()
VirtualDevice* pVirDev = new VirtualDevice;
OSL_ENSURE(0 != pVirDev, "XDashList: no VirtualDevice created!" );
pVirDev->SetMapMode(MAP_100TH_MM);
- const Size aSize(pVirDev->PixelToLogic(Size(getUiBitmapWidth(), getUiBitmapHeight())));
+ const Size aSize(pVirDev->PixelToLogic(rStyleSettings.GetListBoxPreviewDefaultPixelSize()));
pVirDev->SetOutputSize(aSize);
pVirDev->SetDrawMode(rStyleSettings.GetHighContrastMode()
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx
index 775e0a1..a9c6a30 100644
--- a/svx/source/xoutdev/xtable.cxx
+++ b/svx/source/xoutdev/xtable.cxx
@@ -210,25 +210,4 @@ void XPropertyList::SetName( const String& rString )
}
}
-sal_uInt32 XPropertyList::getUiBitmapWidth() const
-{
- static sal_uInt32 nWidth = 32; // alternative: 42;
-
- return nWidth;
-}
-
-sal_uInt32 XPropertyList::getUiBitmapHeight() const
-{
- static sal_uInt32 nHeight = 12; // alternative: 16;
-
- return nHeight;
-}
-
-sal_uInt32 XPropertyList::getUiBitmapLineWidth() const
-{
- static sal_uInt32 nLineWidth = 1;
-
- return nLineWidth;
-}
-
// eof
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index 4f40c1a..3a5788c 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -122,7 +122,8 @@ void XLineEndList::impCreate()
VirtualDevice* pVirDev = new VirtualDevice;
OSL_ENSURE(0 != pVirDev, "XLineEndList: no VirtualDevice created!" );
pVirDev->SetMapMode(MAP_100TH_MM);
- const Size aSize(pVirDev->PixelToLogic(Size(getUiBitmapWidth() * 2, getUiBitmapHeight())));
+ const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
+ const Size aSize(pVirDev->PixelToLogic(Size(rSize.Width() * 2, rSize.Height())));
pVirDev->SetOutputSize(aSize);
pVirDev->SetDrawMode(rStyleSettings.GetHighContrastMode()
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
@@ -149,7 +150,7 @@ void XLineEndList::impCreate()
SdrObject* pLineObject = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygon));
OSL_ENSURE(0 != pLineObject, "XLineEndList: no LineObject created!" );
pLineObject->SetModel(pSdrModel);
- const Size aLineWidth(pVirDev->PixelToLogic(Size(getUiBitmapLineWidth(), 0)));
+ const Size aLineWidth(pVirDev->PixelToLogic(Size(rStyleSettings.GetListBoxPreviewDefaultLineWidth(), 0)));
pLineObject->SetMergedItem(XLineWidthItem(aLineWidth.getWidth()));
const sal_uInt32 nArrowHeight((aSize.Height() * 8) / 10);
pLineObject->SetMergedItem(XLineStartWidthItem(nArrowHeight));
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index d35f250..65c2115 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -66,33 +66,33 @@ struct ImplEntryType
long mnFlags;
long mnHeight;
- ImplEntryType( const XubString& rStr, const Image& rImage ) :
- maStr( rStr ),
- maImage( rImage ),
- mnFlags( 0 ),
- mnHeight( 0 )
- {
- mbIsSelected = sal_False;
- mpUserData = NULL;
- }
-
- ImplEntryType( const XubString& rStr ) :
- maStr( rStr ),
- mnFlags( 0 ),
- mnHeight( 0 )
- {
- mbIsSelected = sal_False;
- mpUserData = NULL;
- }
-
- ImplEntryType( const Image& rImage ) :
- maImage( rImage ),
- mnFlags( 0 ),
- mnHeight( 0 )
- {
- mbIsSelected = sal_False;
- mpUserData = NULL;
- }
+ ImplEntryType( const XubString& rStr, const Image& rImage ) :
+ maStr( rStr ),
+ maImage( rImage ),
+ mnFlags( 0 ),
+ mnHeight( 0 )
+ {
+ mbIsSelected = sal_False;
+ mpUserData = NULL;
+ }
+
+ ImplEntryType( const XubString& rStr ) :
+ maStr( rStr ),
+ mnFlags( 0 ),
+ mnHeight( 0 )
+ {
+ mbIsSelected = sal_False;
+ mpUserData = NULL;
+ }
+
+ ImplEntryType( const Image& rImage ) :
+ maImage( rImage ),
+ mnFlags( 0 ),
+ mnHeight( 0 )
+ {
+ mbIsSelected = sal_False;
+ mpUserData = NULL;
+ }
};
// -----------------
@@ -223,24 +223,26 @@ private:
sal_uInt16 mnSelectModifier; // Modifiers
- sal_Bool mbHasFocusRect: 1,
- mbSort: 1, // ListBox sortiert
- mbTrack: 1, // Tracking
- mbMulti: 1, // MultiListBox
- mbStackMode: 1, // StackSelection
- mbSimpleMode: 1, // SimpleMode fuer MultiListBox
- mbImgsDiffSz: 1, // Images haben verschiedene Groessen
- mbTravelSelect: 1, // TravelSelect
- mbTrackingSelect: 1, // Selektiert bei MouseMove
- mbSelectionChanged: 1, // Select() nicht zu oft rufen...
- mbMouseMoveSelect: 1, // Selektieren bei MouseMove
- mbGrabFocus: 1, // Focus bei MBDown grabben
- mbUserDrawEnabled: 1, // UserDraw possible
- mbInUserDraw: 1, // In UserDraw
- mbReadOnly: 1, // ReadOnly
- mbMirroring: 1, // pb: #106948# explicit mirroring for calc
- mbRight: 1, // right align Text output
- mbCenter: 1; // center Text output
+ /// bitfield
+ bool mbHasFocusRect : 1;
+ bool mbSort : 1; // ListBox sortiert
+ bool mbTrack : 1; // Tracking
+ bool mbMulti : 1; // MultiListBox
+ bool mbStackMode : 1; // StackSelection
+ bool mbSimpleMode : 1; // SimpleMode fuer MultiListBox
+ bool mbImgsDiffSz : 1; // Images haben verschiedene Groessen
+ bool mbTravelSelect : 1; // TravelSelect
+ bool mbTrackingSelect : 1; // Selektiert bei MouseMove
+ bool mbSelectionChanged : 1; // Select() nicht zu oft rufen...
+ bool mbMouseMoveSelect : 1; // Selektieren bei MouseMove
+ bool mbGrabFocus : 1; // Focus bei MBDown grabben
+ bool mbUserDrawEnabled : 1; // UserDraw possible
+ bool mbInUserDraw : 1; // In UserDraw
+ bool mbReadOnly : 1; // ReadOnly
+ bool mbMirroring : 1; // pb: #106948# explicit mirroring for calc
+ bool mbRight : 1; // right align Text output
+ bool mbCenter : 1; // center Text output
+ bool mbEdgeBlending : 1;
Link maScrollHdl;
Link maSelectHdl;
@@ -249,8 +251,7 @@ private:
Link maUserDrawHdl;
Link maMRUChangedHdl;
- ::vcl::QuickSelectionEngine
- maQuickSelectionEngine;
+ ::vcl::QuickSelectionEngine maQuickSelectionEngine;
protected:
virtual void KeyInput( const KeyEvent& rKEvt );
@@ -315,31 +316,31 @@ public:
void SetLeftIndent( long n );
void ScrollHorz( long nDiff );
- void AllowGrabFocus( sal_Bool b ) { mbGrabFocus = b; }
- sal_Bool IsGrabFocusAllowed() const { return mbGrabFocus; }
+ void AllowGrabFocus( bool b ) { mbGrabFocus = b; }
+ bool IsGrabFocusAllowed() const { return mbGrabFocus; }
void SetSeparatorPos( sal_uInt16 n ) { mnSeparatorPos = n; }
sal_uInt16 GetSeparatorPos() const { return mnSeparatorPos; }
- void SetTravelSelect( sal_Bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
- sal_Bool IsTravelSelect() const { return mbTravelSelect; }
- sal_Bool IsTrackingSelect() const { return mbTrackingSelect; }
+ void SetTravelSelect( bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
+ bool IsTravelSelect() const { return mbTravelSelect; }
+ bool IsTrackingSelect() const { return mbTrackingSelect; }
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
- sal_Bool IsMultiSelectionEnabled() const { return mbMulti; }
+ void EnableMultiSelection( bool bMulti, bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
+ bool IsMultiSelectionEnabled() const { return mbMulti; }
- void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { mbSimpleMode = bSimple; }
- sal_Bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
+ void SetMultiSelectionSimpleMode( bool bSimple ) { mbSimpleMode = bSimple; }
+ bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
- void EnableMouseMoveSelect( sal_Bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
- sal_Bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
- sal_Bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
+ void EnableMouseMoveSelect( bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
+ bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
+ bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
Size CalcSize( sal_uInt16 nMaxLines ) const;
Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
@@ -360,21 +361,24 @@ public:
void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
- sal_Bool IsSelectionChanged() const { return mbSelectionChanged; }
+ bool IsSelectionChanged() const { return mbSelectionChanged; }
sal_uInt16 GetSelectModifier() const { return mnSelectModifier; }
- void EnableSort( sal_Bool b ) { mbSort = b; }
+ void EnableSort( bool b ) { mbSort = b; }
- void SetReadOnly( sal_Bool bReadOnly ) { mbReadOnly = bReadOnly; }
- sal_Bool IsReadOnly() const { return mbReadOnly; }
+ void SetReadOnly( bool bReadOnly ) { mbReadOnly = bReadOnly; }
+ bool IsReadOnly() const { return mbReadOnly; }
using Control::ImplInitSettings;
void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
sal_uInt16 ImplGetTextStyle() const;
// pb: #106948# explicit mirroring for calc
- inline void EnableMirroring() { mbMirroring = sal_True; }
- inline sal_Bool IsMirroring() const { return mbMirroring; }
+ inline void EnableMirroring() { mbMirroring = true; }
+ inline bool IsMirroring() const { return mbMirroring; }
+
+ bool GetEdgeBlending() const { return mbEdgeBlending; }
+ void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; }
protected:
// ISearchableStringList
@@ -394,9 +398,13 @@ private:
ScrollBar* mpHScrollBar;
ScrollBar* mpVScrollBar;
ScrollBarBox* mpScrollBarBox;
- sal_Bool mbVScroll : 1, // VScroll an oder aus
- mbHScroll : 1, // HScroll an oder aus
- mbAutoHScroll : 1; // AutoHScroll an oder aus
+
+ /// bitfield
+ bool mbVScroll : 1; // VScroll an oder aus
+ bool mbHScroll : 1; // HScroll an oder aus
+ bool mbAutoHScroll : 1; // AutoHScroll an oder aus
+ bool mbEdgeBlending : 1;
+
Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird.
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
@@ -501,6 +509,9 @@ public:
sal_uInt16 GetDisplayLineCount() const
{ return maLBWindow.GetDisplayLineCount(); }
+ bool GetEdgeBlending() const { return mbEdgeBlending; }
+ void SetEdgeBlending(bool bNew);
+
// pb: #106948# explicit mirroring for calc
inline void EnableMirroring() { maLBWindow.EnableMirroring(); }
inline void SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; }
@@ -568,9 +579,10 @@ private:
Link maMBDownHdl;
Link maUserDrawHdl;
- sal_Bool mbUserDrawEnabled : 1,
- mbInUserDraw : 1;
-
+ /// bitfield
+ bool mbUserDrawEnabled : 1;
+ bool mbInUserDraw : 1;
+ bool mbEdgeBlending : 1;
void ImplDraw( bool bLayout = false );
protected:
@@ -610,10 +622,13 @@ public:
void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
void DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
+
+ bool GetEdgeBlending() const { return mbEdgeBlending; }
+ void SetEdgeBlending(bool bNew) { mbEdgeBlending = bNew; }
};
// -----------
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index 6a13355..0c55810 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -112,6 +112,7 @@ public:
// returns empty rectangle in DropDown mode,
// else it returns the PosSize of the ListBox
+ void AdaptDropDownLineCountToMaximum();
void SetDropDownLineCount( sal_uInt16 nLines );
sal_uInt16 GetDropDownLineCount() const;
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index f4d607c..fa6293d 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -45,12 +45,15 @@ private:
ImplListBoxFloatingWindow* mpFloatWin;
ImplWin* mpImplWin;
ImplBtn* mpBtn;
- sal_uInt16 mnDDHeight;
- sal_uInt16 mnSaveValue;
- sal_Bool mbDDAutoSize;
+ sal_uInt16 mnDDHeight;
+ sal_uInt16 mnSaveValue;
Link maSelectHdl;
Link maDoubleClickHdl;
- sal_uInt16 mnLineCount;
+ sal_uInt16 mnLineCount;
+
+ /// bitfield
+ bool mbDDAutoSize : 1;
+ bool mbEdgeBlending : 1;
//#if 0 // _SOLAR__PRIVATE
private:
@@ -107,11 +110,12 @@ public:
Rectangle GetDropDownPosSizePixel() const;
+ void AdaptDropDownLineCountToMaximum();
void SetDropDownLineCount( sal_uInt16 nLines );
sal_uInt16 GetDropDownLineCount() const;
- void EnableAutoSize( sal_Bool bAuto );
- sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( bool bAuto );
+ bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
void EnableDDAutoWidth( sal_Bool b );
sal_Bool IsDDAutoWidthEnabled() const;
@@ -218,6 +222,9 @@ public:
void EnableMirroring();
+ bool GetEdgeBlending() const { return mbEdgeBlending; }
+ void SetEdgeBlending(bool bNew);
+
/** checks whether a certain point lies within the bounds of
a listbox item and returns the item as well as the character position
the point is at.
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index 5be9c8b..bba89bb 100644
--- a/vcl/inc/vcl/settings.hxx
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list