From 7560f765b32bf9969b89b28c6733faa8098f1809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 9 Sep 2013 11:58:29 +0100 Subject: [PATCH] unify strip previews optimal size in one place Change-Id: I6ae1073d013c9d9bbca39c505955436cd4950d1b --- cui/uiconfig/ui/charnamepage.ui | 1 - cui/uiconfig/ui/effectspage.ui | 1 - cui/uiconfig/ui/positionpage.ui | 1 - cui/uiconfig/ui/textanimtabpage.ui | 73 +++++++++++++++-------------- cui/uiconfig/ui/textattrtabpage.ui | 5 +- cui/uiconfig/ui/twolinespage.ui | 1 - include/sfx2/dialoghelper.hxx | 2 + include/svx/dlgctrl.hxx | 1 + include/svx/fntctrl.hxx | 2 - include/svx/measctrl.hxx | 1 + sfx2/source/dialog/dialoghelper.cxx | 5 ++ svx/source/dialog/dlgctrl.cxx | 9 +++- svx/source/dialog/fntctrl.cxx | 5 +- svx/source/dialog/measctrl.cxx | 8 +++- 14 files changed, 64 insertions(+), 51 deletions(-) diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui index d89402daa8ad..25c67f1a2526 100644 --- a/cui/uiconfig/ui/charnamepage.ui +++ b/cui/uiconfig/ui/charnamepage.ui @@ -748,7 +748,6 @@ 12 - 100 True False diff --git a/cui/uiconfig/ui/effectspage.ui b/cui/uiconfig/ui/effectspage.ui index 592984fdaa9c..12676c2dc1ae 100644 --- a/cui/uiconfig/ui/effectspage.ui +++ b/cui/uiconfig/ui/effectspage.ui @@ -646,7 +646,6 @@ 12 - 100 True False diff --git a/cui/uiconfig/ui/positionpage.ui b/cui/uiconfig/ui/positionpage.ui index 20927c8f7890..c44bee666417 100644 --- a/cui/uiconfig/ui/positionpage.ui +++ b/cui/uiconfig/ui/positionpage.ui @@ -516,7 +516,6 @@ 12 - 100 True False True diff --git a/cui/uiconfig/ui/textanimtabpage.ui b/cui/uiconfig/ui/textanimtabpage.ui index dc74c15ce912..8f0c9f9459f0 100644 --- a/cui/uiconfig/ui/textanimtabpage.ui +++ b/cui/uiconfig/ui/textanimtabpage.ui @@ -1,6 +1,41 @@ + + 100 + 1 + 10 + + + 100 + 1 + 10 + + + 300 + 1 + 50 + + + True + False + gtk-go-down + + + True + False + gtk-go-back + + + True + False + gtk-go-forward + + + True + False + gtk-go-up + True False @@ -25,6 +60,7 @@ False True 18 + True True @@ -68,7 +104,7 @@ True False - end + start True 12 @@ -505,41 +541,6 @@ - - 100 - 1 - 10 - - - 100 - 1 - 10 - - - 300 - 1 - 50 - - - True - False - gtk-go-down - - - True - False - gtk-go-back - - - True - False - gtk-go-forward - - - True - False - gtk-go-up - diff --git a/cui/uiconfig/ui/textattrtabpage.ui b/cui/uiconfig/ui/textattrtabpage.ui index da272cf8ae7f..b5a18ecdc1c0 100644 --- a/cui/uiconfig/ui/textattrtabpage.ui +++ b/cui/uiconfig/ui/textattrtabpage.ui @@ -1,7 +1,7 @@ - + -100 100 @@ -364,7 +364,8 @@ True False - True + start + center True diff --git a/cui/uiconfig/ui/twolinespage.ui b/cui/uiconfig/ui/twolinespage.ui index c931b90d279e..232062c523ca 100644 --- a/cui/uiconfig/ui/twolinespage.ui +++ b/cui/uiconfig/ui/twolinespage.ui @@ -226,7 +226,6 @@ 12 - 100 True False diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx index d31a09492ecc..5b09eb56b73c 100644 --- a/include/sfx2/dialoghelper.hxx +++ b/include/sfx2/dialoghelper.hxx @@ -34,6 +34,8 @@ Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const Window *pReference); Size SFX2_DLLPUBLIC getDrawListBoxOptimalSize(const Window *pReference); +Size SFX2_DLLPUBLIC getPreviewStripSize(const Window *pReference); + OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper); OUString SFX2_DLLPUBLIC formatTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper); diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index c34d1543cb27..64b92ae9531a 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -397,6 +397,7 @@ public: virtual void Paint( const Rectangle& rRect ); virtual void Resize(); + virtual Size GetOptimalSize() const; }; /************************************************************************* diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx index 93edc0d04b13..f4c62621f673 100644 --- a/include/svx/fntctrl.hxx +++ b/include/svx/fntctrl.hxx @@ -45,8 +45,6 @@ private: SVX_DLLPRIVATE void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont); SVX_DLLPRIVATE void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont); - Size m_aInitialSize; - public: SvxFontPrevWindow( Window* pParent, const ResId& rId ); SvxFontPrevWindow(Window* pParent, WinBits nStyle); diff --git a/include/svx/measctrl.hxx b/include/svx/measctrl.hxx index f17190a3edc1..fde082fbb7e7 100644 --- a/include/svx/measctrl.hxx +++ b/include/svx/measctrl.hxx @@ -48,6 +48,7 @@ public: virtual void Paint(const Rectangle& rRect); virtual void Resize(); virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual Size GetOptimalSize() const; void SetAttributes( const SfxItemSet& rInAttrs ); diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx index c3440e6bf5be..cd805006de10 100644 --- a/sfx2/source/dialog/dialoghelper.cxx +++ b/sfx2/source/dialog/dialoghelper.cxx @@ -67,6 +67,11 @@ Size getDrawListBoxOptimalSize(const Window *pReference) return pReference->LogicToPixel(Size(88, 110), MAP_APPFONT); } +Size SFX2_DLLPUBLIC getPreviewStripSize(const Window *pReference) +{ + return pReference->LogicToPixel(Size(70 , 40), MapMode(MAP_APPFONT)); +} + OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper) { Date aDate(22, 12, 2000); diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index d730ea99c640..14bf9cb505f2 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -20,7 +20,7 @@ #include #include #include - +#include #include #include #include @@ -107,7 +107,7 @@ void SvxRectCtl::SetControlSettings(RECT_POINT eRpt, sal_uInt16 nBorder, sal_uIn Size SvxRectCtl::GetOptimalSize() const { - return LogicToPixel(Size(39, 39), MAP_APPFONT); + return LogicToPixel(Size(78, 39), MAP_APPFONT); } extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRectCtl(Window *pParent, VclBuilder::stringmap &) @@ -1838,6 +1838,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXLinePreview(Window *pPa return new SvxXLinePreview(pParent); } +Size SvxXLinePreview::GetOptimalSize() const +{ + return getPreviewStripSize(this); +} + SvxXLinePreview::~SvxXLinePreview() { SdrObject *pFoo = mpLineObjA; diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 04d175b59c7c..fc0e096048be 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include // SfxViewShell #include // Printer #include @@ -502,14 +503,12 @@ void SvxFontPrevWindow::Init() SvxFontPrevWindow::SvxFontPrevWindow( Window* pParent, const ResId& rId ) : Window( pParent, rId ) { - m_aInitialSize = GetSizePixel(); Init(); } SvxFontPrevWindow::SvxFontPrevWindow(Window* pParent, WinBits nStyle) : Window(pParent, nStyle) { - m_aInitialSize = LogicToPixel(Size(70 , 27), MapMode(MAP_APPFONT)); Init(); } @@ -1499,7 +1498,7 @@ void SvxFontPrevWindow::SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, Size SvxFontPrevWindow::GetOptimalSize() const { - return m_aInitialSize; + return getPreviewStripSize(this); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 646decbf06d5..1a630eeb3236 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -17,13 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include -#include - #include "svx/measctrl.hxx" #include #include "svx/dlgutil.hxx" +#include SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent,const ResId& rResId,const SfxItemSet& rInAttrs) : Control ( pParent, rResId ) @@ -98,6 +98,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXMeasurePreview(Window * return new SvxXMeasurePreview(pParent, nWinStyle); } +Size SvxXMeasurePreview::GetOptimalSize() const +{ + return getPreviewStripSize(this); +} SvxXMeasurePreview::~SvxXMeasurePreview() {