summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorSrijan Bhatia <srijanbhatiasun@gmail.com>2020-06-18 18:41:14 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-02 12:12:02 +0200
commit14b8c176133979cd1c3163ef5fe3eed0e6479fea (patch)
treef4f269904c4187336ceb13113a71154d49988bb8 /basctl
parent445537bbc2971b970bed244db40f35c9caf43ef4 (diff)
tdf#127680 Add the option to print even or odd values from a particular range
Added a box besides the pages option that lets the user choose between left and right pages/left pages/right pages. Change-Id: Iee0386f4f3cfd2dac3fcf898a3fefb5434cb27a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96612 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/basicrenderable.cxx27
1 files changed, 16 insertions, 11 deletions
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index eae8b5c81c93..8e4bab711ce8 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -37,7 +37,7 @@ Renderable::Renderable (BaseWindow* pWin)
: cppu::WeakComponentImplHelper< css::view::XRenderable >( maMutex )
, mpWindow( pWin )
{
- m_aUIProperties.resize( 3 );
+ m_aUIProperties.resize( 4 );
// show Subgroup for print range
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
@@ -50,17 +50,11 @@ Renderable::Renderable (BaseWindow* pWin)
// create a choice for the range to print
OUString aPrintContentName( "PrintContent" );
const Sequence<OUString> aChoices{IDEResId(RID_STR_PRINTDLG_PRINTALLPAGES),
- IDEResId(RID_STR_PRINTDLG_PRINTPAGES),
- IDEResId(RID_STR_PRINTDLG_PRINTEVENPAGES),
- IDEResId(RID_STR_PRINTDLG_PRINTODDPAGES)};
+ IDEResId(RID_STR_PRINTDLG_PRINTPAGES)};
const Sequence<OUString> aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
- ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1",
- ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2",
- ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3"};
+ ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1"};
const Sequence<OUString> aWidgetIds{"rbAllPages",
- "rbRangePages",
- "rbEvenPages",
- "rbOddPages"};
+ "rbRangePages"};
m_aUIProperties[1].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
aHelpIds, aPrintContentName,
aChoices, 0);
@@ -70,6 +64,16 @@ Renderable::Renderable (BaseWindow* pWin)
m_aUIProperties[2].Value = setEditControlOpt("pagerange", OUString(),
OUString(), "PageRange",
OUString(), aPageRangeOpt);
+
+ vcl::PrinterOptionsHelper::UIControlOptions aEvenOddOpt(aPrintContentName, 0, true);
+ m_aUIProperties[3].Value = setChoiceListControlOpt("evenoddbox",
+ OUString(),
+ uno::Sequence<OUString>(),
+ "EvenOdd",
+ uno::Sequence<OUString>(),
+ 0,
+ uno::Sequence< sal_Bool >(),
+ aEvenOddOpt);
}
Renderable::~Renderable()
@@ -130,6 +134,7 @@ sal_Int32 SAL_CALL Renderable::getRendererCount (
}
sal_Int64 nContent = getIntValue( "PrintContent", -1 );
+ sal_Int64 nEOContent = getIntValue ("EvenOdd", -1);
if( nContent == 1 )
{
OUString aPageRange( getStringValue( "PageRange" ) );
@@ -141,7 +146,7 @@ sal_Int32 SAL_CALL Renderable::getRendererCount (
nCount = nSelCount;
}
}
- else if ( nContent == 2 || nContent == 3 ) // even/odd pages
+ else if ( nEOContent == 1 || nEOContent == 2 ) // even/odd pages
return static_cast<sal_Int32>( maValidPages.size() );
}