summaryrefslogtreecommitdiff
path: root/sd/source/ui/sidebar
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-05-28 08:11:28 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-06-03 06:46:39 +0000
commit9196de99ed4dff2c1f8708bfd68da9b6424ae53b (patch)
tree2fa498e27babfcbd31c9fc7387932bbc5f60d949 /sd/source/ui/sidebar
parentd0879b721d8c429248f9da7ce02c6c71327e2954 (diff)
Move page size listbox from cui to svx
make it a custom widget so it is accessible e.g. to sidebar panels Change-Id: Ic36a9a8af96a09fc76efd8e9ae75b8ebdf81717e Reviewed-on: https://gerrit.libreoffice.org/25764 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx64
-rw-r--r--sd/source/ui/sidebar/SlideBackground.hxx4
2 files changed, 6 insertions, 62 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 28e9bd914b78..fb068fa26649 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -65,52 +65,6 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
-namespace {
- void lcl_FillPaperSizeListbox ( ListBox &rListBox)
- {
- std::map< sal_Int32, Paper > aPaperSizeMap =
- {
- { 0, PAPER_A6 },
- { 1, PAPER_A5 },
- { 2, PAPER_A4 },
- { 3, PAPER_A3 },
- { 4, PAPER_A2 },
- { 5, PAPER_A1 },
- { 6, PAPER_A0 },
- { 7, PAPER_B6_ISO },
- { 8, PAPER_B5_ISO },
- { 9, PAPER_B4_ISO },
- { 10, PAPER_LETTER },
- { 11, PAPER_LEGAL },
- { 12, PAPER_FANFOLD_LEGAL_DE },
- { 13, PAPER_TABLOID },
- { 14, PAPER_B6_JIS },
- { 15, PAPER_B5_JIS },
- { 16, PAPER_B4_JIS },
- { 17, PAPER_KAI16 },
- { 18, PAPER_KAI32 },
- { 19, PAPER_KAI32BIG },
- { 20, PAPER_USER },
- { 21, PAPER_ENV_DL },
- { 22, PAPER_ENV_C6 },
- { 23, PAPER_ENV_C65 },
- { 24, PAPER_ENV_C5 },
- { 25, PAPER_ENV_C4 },
- { 26, PAPER_SLIDE_DIA },
- { 27, PAPER_SCREEN_4_3 },
- { 28, PAPER_SCREEN_16_9 },
- { 29, PAPER_SCREEN_16_10 },
- { 30, PAPER_POSTCARD_JP }
- };
-
- for ( sal_Int32 nIdx = 0; nIdx < rListBox.GetEntryCount(); nIdx++ )
- {
- Paper eSize = aPaperSizeMap[nIdx];
- rListBox.SetEntryData( nIdx, reinterpret_cast<void*>( (sal_uLong)eSize ));
- }
- }
-}
-
namespace sd { namespace sidebar {
SlideBackground::SlideBackground(
@@ -158,7 +112,7 @@ SlideBackground::~SlideBackground()
void SlideBackground::Initialize()
{
- lcl_FillPaperSizeListbox( *mpPaperSizeBox );
+ mpPaperSizeBox->FillPaperSizeEntries( PaperSizeDraw );
mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
@@ -548,18 +502,7 @@ void SlideBackground::NotifyItemUpdate(
Swap(aPaperSize);
Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, static_cast<MapUnit>(meUnit),true);
- sal_Int32 nEntryCount = mpPaperSizeBox->GetEntryCount();
-
- for (sal_Int32 i = 0; i < nEntryCount; ++i )
- {
- Paper eTmp = (Paper)reinterpret_cast<sal_uLong>(mpPaperSizeBox->GetEntryData(i));
-
- if ( eTmp == ePaper )
- {
- mpPaperSizeBox->SelectEntryPos(i);
- break;
- }
- }
+ mpPaperSizeBox->SetSelection( ePaper );
}
}
break;
@@ -661,8 +604,7 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, FillStyleModifyHdl, ListBox&, void)
IMPL_LINK_NOARG_TYPED(SlideBackground, PaperSizeModifyHdl, ListBox&, void)
{
- sal_uInt32 nPos = mpPaperSizeBox->GetSelectEntryPos();
- Paper ePaper = (Paper)reinterpret_cast<sal_uLong>( mpPaperSizeBox->GetEntryData( nPos ) );
+ Paper ePaper = mpPaperSizeBox->GetSelection();
Size aSize(SvxPaperInfo::GetPaperSize(ePaper, (MapUnit)(meUnit)));
if(mpPaperOrientation->GetSelectEntryPos() == 0)
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index bbe9b4031f10..5cfc955206c7 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include "fupage.hxx"
+#include <svx/papersizelistbox.hxx>
#include <svx/xflclit.hxx>
#include <svx/xgrad.hxx>
#include <svx/xflgrit.hxx>
@@ -43,6 +44,7 @@
#include <svx/xflhtit.hxx>
#include "EventMultiplexer.hxx"
+
namespace sd { namespace sidebar {
class SlideBackground :
@@ -70,7 +72,7 @@ private:
ViewShellBase& mrBase;
- VclPtr<ListBox> mpPaperSizeBox;
+ VclPtr<PaperSizeListBox> mpPaperSizeBox;
VclPtr<ListBox> mpPaperOrientation;
VclPtr<ListBox> mpMasterSlide;
VclPtr<SvxFillTypeBox> mpFillStyle;