diff options
author | Philipp Lohmann <pl@openoffice.org> | 2009-04-15 19:11:23 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2009-04-15 19:11:23 +0000 |
commit | 1777b5a68513f7cbfaa239acf16bcc76a49b448c (patch) | |
tree | 6a0e000dc080c5b70e85df3bf1b070dbf9df6557 | |
parent | 1fbd16c4069cf7cdcc9489374596f6c9eb378f1c (diff) |
#i92516# vcl helper for new print ui options
-rw-r--r-- | starmath/source/unomodel.cxx | 184 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 242 |
2 files changed, 107 insertions, 319 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 971f9c5f2d52..03639668573f 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -80,181 +80,73 @@ using namespace ::com::sun::star::script; #define C2U(cChar) rtl::OUString::createFromAscii(cChar) -class SmPrintUIOptions +class SmPrintUIOptions : public vcl::PrinterOptionsHelper { - ResStringArray m_aLocalizedStrings; - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const PropertyValue* i_pVal = NULL, - const Sequence< rtl::OUString >* i_pChoices = NULL, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const rtl::OUString& i_rProperty, - const Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); public: SmPrintUIOptions(); - - void addPrintUIOptions( uno::Sequence< beans::PropertyValue >& io_rProps ); }; SmPrintUIOptions::SmPrintUIOptions() -: m_aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) ) -{ -} - -Any SmPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const PropertyValue* i_pVal, - const Sequence< rtl::OUString >* i_pChoices, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry - ) -{ - Sequence< PropertyValue > aCtrl(6); - sal_Int32 nUsed = 0; - if( i_rTitle.getLength() ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ); - aCtrl[nUsed++].Value = makeAny( i_rTitle ); - } - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) ); - aCtrl[nUsed++].Value = makeAny( i_rType ); - if( i_pVal ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Property" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pVal ); - } - if( i_pChoices ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pChoices ); - } - if( i_pDependsOnName ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DependsOnName" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pDependsOnName ); - if( i_nDependsOnEntry != -1 ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DependsOnEntry" ) ); - aCtrl[nUsed++].Value = makeAny( i_nDependsOnEntry ); - } - } - aCtrl.realloc( nUsed ); - return makeAny( aCtrl ); -} - -Any SmPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry ) -{ - PropertyValue aVal; - aVal.Name = i_rProperty; - aVal.Value = makeAny( i_bValue ); - return getUIControlOpt( i_rTitle, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, NULL, i_pDependsOnName, i_nDependsOnEntry ); -} - -Any SmPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const rtl::OUString& i_rProperty, - const Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry ) { - PropertyValue aVal; - aVal.Name = i_rProperty; - aVal.Value = makeAny( i_nValue ); - return getUIControlOpt( i_rTitle, i_rType, &aVal, &i_rChoices, i_pDependsOnName, i_nDependsOnEntry ); -} + ResStringArray aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) ); + DBG_ASSERT( aLocalizedStrings.Count() >= 10, "resource incomplete" ); + if( aLocalizedStrings.Count() < 10 ) // bad resource ? + return; -void SmPrintUIOptions::addPrintUIOptions( uno::Sequence< beans::PropertyValue >& io_rProps ) -{ // create sequence of print UI options - uno::Sequence< beans::PropertyValue > aUIOptions( 10 ); + m_aUIProperties.realloc( 10 ); - DBG_ASSERT( m_aLocalizedStrings.Count() >= 10, "resource incomplete" ); - if( m_aLocalizedStrings.Count() < 10 ) // bad resource ? - return; // create Section for formula (results in an extra tab page in dialog) - aUIOptions[0].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 0 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) ); + m_aUIProperties[0].Value = getGroupControlOpt( aLocalizedStrings.GetString( 0 ) ); // create subgroup for print options - aUIOptions[1].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 1 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ) ); + m_aUIProperties[1].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 1 ) ); // create a bool option for title row - aUIOptions[2].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 2 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TitleRow" ) ), - sal_True ); + m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TitleRow" ) ), + sal_True ); // create a bool option for formula text - aUIOptions[3].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 3 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormulaText" ) ), - sal_True ); + m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FormulaText" ) ), + sal_True ); // create a bool option for border - aUIOptions[4].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 4 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) ), - sal_True ); + m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) ), + sal_True ); // create subgroup for print format - aUIOptions[5].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 5 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ) ); + m_aUIProperties[5].Value = getUIControlOpt( aLocalizedStrings.GetString( 5 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ) ); // create a radio button group for print format Sequence< rtl::OUString > aChoices( 3 ); - aChoices[0] = m_aLocalizedStrings.GetString( 6 ); - aChoices[1] = m_aLocalizedStrings.GetString( 7 ); - aChoices[2] = m_aLocalizedStrings.GetString( 8 ); + aChoices[0] = aLocalizedStrings.GetString( 6 ); + aChoices[1] = aLocalizedStrings.GetString( 7 ); + aChoices[2] = aLocalizedStrings.GetString( 8 ); OUString aPrintFormatProp( RTL_CONSTASCII_USTRINGPARAM( "PrintFormat" ) ); - aUIOptions[6].Value = getUIControlOpt( rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintFormat" ) ), - aChoices, 0 - ); + m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(), + aPrintFormatProp, + aChoices, 0 + ); // create a numeric box for scale dependent on PrintFormat = "Scaling" - PropertyValue aVal; - aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintScale" ) ); - aVal.Value = makeAny( sal_Int32( 100 ) ); - aUIOptions[ 7 ].Value = getUIControlOpt( rtl::OUString(), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ), - &aVal, - NULL, - &aPrintFormatProp, - 2 ); + m_aUIProperties[ 7 ].Value = getRangeControlOpt( rtl::OUString(), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintScale" ) ), + 100, // initial value + 10, // min value + 1000, // max value + &aPrintFormatProp, + 2 ); // create subgroup for misc options - aUIOptions[8].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 9 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ) ); + m_aUIProperties[8].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 9 ) ); // create a bool option for ignore spacing - aUIOptions[9].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 10 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) ), - sal_True ); - - sal_Int32 nLen = io_rProps.getLength(); - io_rProps.realloc( nLen+1 ); - io_rProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) ); - io_rProps[nLen].Value = uno::makeAny( aUIOptions ); + m_aUIProperties[9].Value = getBoolControlOpt( aLocalizedStrings.GetString( 10 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Border" ) ), + sal_True ); } @@ -1106,7 +998,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer( rValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); rValue.Value <<= aPageSize; - m_pPrintUIOptions->addPrintUIOptions( aRenderer ); + m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); return aRenderer; } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index a4dffcd966aa..a4701db19285 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -36,6 +36,7 @@ #include <vcl/image.hxx> #include <vcl/virdev.hxx> #include <vcl/svapp.hxx> +#include <vcl/print.hxx> #include <sfx2/viewfrm.hxx> #ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> @@ -176,227 +177,122 @@ using ::osl::FileBase; * ******************************************************************************/ -class SwPrintUIOptions -{ - ResStringArray m_aLocalizedStrings; - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const PropertyValue* i_pVal = NULL, - const Sequence< rtl::OUString >* i_pChoices = NULL, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); - - Any getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const rtl::OUString& i_rProperty, - const Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString* i_pDependsOnName = NULL, - sal_Int32 i_nDependsOnEntry = -1 - ); +class SwPrintUIOptions : public vcl::PrinterOptionsHelper +{ public: SwPrintUIOptions(); - - void addPrintUIOptions( uno::Sequence< beans::PropertyValue >& io_rProps ); }; SwPrintUIOptions::SwPrintUIOptions() -: m_aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ) -{ -} - -Any SwPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const PropertyValue* i_pVal, - const Sequence< rtl::OUString >* i_pChoices, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry - ) -{ - Sequence< PropertyValue > aCtrl(6); - sal_Int32 nUsed = 0; - if( i_rTitle.getLength() ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ); - aCtrl[nUsed++].Value = makeAny( i_rTitle ); - } - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) ); - aCtrl[nUsed++].Value = makeAny( i_rType ); - if( i_pVal ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Property" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pVal ); - } - if( i_pChoices ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pChoices ); - } - if( i_pDependsOnName ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DependsOnName" ) ); - aCtrl[nUsed++].Value = makeAny( *i_pDependsOnName ); - if( i_nDependsOnEntry != -1 ) - { - aCtrl[nUsed ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DependsOnEntry" ) ); - aCtrl[nUsed++].Value = makeAny( i_nDependsOnEntry ); - } - } - aCtrl.realloc( nUsed ); - return makeAny( aCtrl ); -} - -Any SwPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rProperty, - sal_Bool i_bValue, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry ) { - PropertyValue aVal; - aVal.Name = i_rProperty; - aVal.Value = makeAny( i_bValue ); - return getUIControlOpt( i_rTitle, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, NULL, i_pDependsOnName, i_nDependsOnEntry ); -} - -Any SwPrintUIOptions::getUIControlOpt( const rtl::OUString& i_rTitle, - const rtl::OUString& i_rType, - const rtl::OUString& i_rProperty, - const Sequence< rtl::OUString >& i_rChoices, - sal_Int32 i_nValue, - const rtl::OUString* i_pDependsOnName, - sal_Int32 i_nDependsOnEntry ) -{ - PropertyValue aVal; - aVal.Name = i_rProperty; - aVal.Value = makeAny( i_nValue ); - return getUIControlOpt( i_rTitle, i_rType, &aVal, &i_rChoices, i_pDependsOnName, i_nDependsOnEntry ); -} + ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ); + DBG_ASSERT( aLocalizedStrings.Count() >= 23, "resource incomplete" ); + if( aLocalizedStrings.Count() < 23 ) // bad resource ? + return; -void SwPrintUIOptions::addPrintUIOptions( uno::Sequence< beans::PropertyValue >& io_rProps ) -{ // create sequence of print UI options - uno::Sequence< beans::PropertyValue > aUIOptions( 19 ); - - DBG_ASSERT( m_aLocalizedStrings.Count() >= 23, "resource incomplete" ); - if( m_aLocalizedStrings.Count() < 23 ) // bad resource ? - return; + m_aUIProperties.realloc( 19 ); // create Section for Contents (results in an extra tab page in dialog) - aUIOptions[0].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 0 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) ); + m_aUIProperties[0].Value = getGroupControlOpt( aLocalizedStrings.GetString( 0 ) ); // create a bool option for graphics - aUIOptions[1].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 1 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintGraphics" ) ), - sal_True ); + m_aUIProperties[1].Value = getBoolControlOpt( aLocalizedStrings.GetString( 1 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintGraphics" ) ), + sal_True ); // create a bool option for tables - aUIOptions[2].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 2 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTables" ) ), - sal_True ); + m_aUIProperties[2].Value = getBoolControlOpt( aLocalizedStrings.GetString( 2 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintTables" ) ), + sal_True ); // create a bool option for drawings - aUIOptions[3].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 3 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDrawings" ) ), - sal_True ); + m_aUIProperties[3].Value = getBoolControlOpt( aLocalizedStrings.GetString( 3 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDrawings" ) ), + sal_True ); // create a bool option for controls - aUIOptions[4].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 4 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ), - sal_True ); + m_aUIProperties[4].Value = getBoolControlOpt( aLocalizedStrings.GetString( 4 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintControls" ) ), + sal_True ); // create a bool option for background - aUIOptions[5].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 5 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBackground" ) ), - sal_True ); + m_aUIProperties[5].Value = getBoolControlOpt( aLocalizedStrings.GetString( 5 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBackground" ) ), + sal_True ); // create a bool option for black - aUIOptions[6].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 6 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlack" ) ), - sal_False ); + m_aUIProperties[6].Value = getBoolControlOpt( aLocalizedStrings.GetString( 6 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBlack" ) ), + sal_False ); // create a bool option for hidden text - aUIOptions[7].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 7 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ), - sal_False ); + m_aUIProperties[7].Value = getBoolControlOpt( aLocalizedStrings.GetString( 7 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintHiddenText" ) ), + sal_False ); // create a bool option for place holder - aUIOptions[8].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 8 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPlaceholder" ) ), - sal_False ); + m_aUIProperties[8].Value = getBoolControlOpt( aLocalizedStrings.GetString( 8 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintPlaceholder" ) ), + sal_False ); // create a list box for notes content Sequence< rtl::OUString > aChoices( 4 ); - aChoices[0] = m_aLocalizedStrings.GetString( 10 ); - aChoices[1] = m_aLocalizedStrings.GetString( 11 ); - aChoices[2] = m_aLocalizedStrings.GetString( 12 ); - aChoices[3] = m_aLocalizedStrings.GetString( 13 ); - aUIOptions[9].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 9 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintNotes" ) ), - aChoices, - 0 - ); + aChoices[0] = aLocalizedStrings.GetString( 10 ); + aChoices[1] = aLocalizedStrings.GetString( 11 ); + aChoices[2] = aLocalizedStrings.GetString( 12 ); + aChoices[3] = aLocalizedStrings.GetString( 13 ); + m_aUIProperties[9].Value = getChoiceControlOpt( aLocalizedStrings.GetString( 9 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintNotes" ) ), + aChoices, + 0, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "List" ) ) + ); // create Section for Page settings (results in an extra tab page in dialog) - aUIOptions[10].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 14 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) ); + m_aUIProperties[10].Value = getGroupControlOpt( aLocalizedStrings.GetString( 14 ) ); // create a bool option for left pages - aUIOptions[11].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 15 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftPages" ) ), - sal_True ); + m_aUIProperties[11].Value = getBoolControlOpt( aLocalizedStrings.GetString( 15 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintLeftPages" ) ), + sal_True ); // create a bool option for right pages - aUIOptions[12].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 16 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRightPages" ) ), - sal_True ); + m_aUIProperties[12].Value = getBoolControlOpt( aLocalizedStrings.GetString( 16 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRightPages" ) ), + sal_True ); // create a bool option for reversed order (solve in vcl ?) - aUIOptions[13].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 17 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverseOrder" ) ), - sal_False ); + m_aUIProperties[13].Value = getBoolControlOpt( aLocalizedStrings.GetString( 17 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverseOrder" ) ), + sal_False ); // create a bool option for brochure OUString aBrochurePropertyName( RTL_CONSTASCII_USTRINGPARAM( "PrintBrochure" ) ); - aUIOptions[14].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 18 ), - aBrochurePropertyName, - sal_False ); + m_aUIProperties[14].Value = getBoolControlOpt( aLocalizedStrings.GetString( 18 ), + aBrochurePropertyName, + sal_False ); // create a bool option for brochure RTL dependent on brochure - aUIOptions[15].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 19 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBrochureRTL" ) ), - sal_False, - &aBrochurePropertyName - ); + m_aUIProperties[15].Value = getBoolControlOpt( aLocalizedStrings.GetString( 19 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintBrochureRTL" ) ), + sal_False, + &aBrochurePropertyName + ); // create subgroup for misc options - aUIOptions[16].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 20 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ) ); + m_aUIProperties[16].Value = getSubgroupControlOpt( aLocalizedStrings.GetString( 20 ) ); // create a bool option for blank pages - aUIOptions[17].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 21 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ), - sal_True ); + m_aUIProperties[17].Value = getBoolControlOpt( aLocalizedStrings.GetString( 21 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintEmptyPages" ) ), + sal_True ); // create a bool option for paper tray - aUIOptions[18].Value = getUIControlOpt( m_aLocalizedStrings.GetString( 22 ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PaperTray" ) ), - sal_False ); + m_aUIProperties[18].Value = getBoolControlOpt( aLocalizedStrings.GetString( 22 ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PaperTray" ) ), + sal_False ); - sal_Int32 nLen = io_rProps.getLength(); - io_rProps.realloc( nLen+1 ); - io_rProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) ); - io_rProps[nLen].Value = uno::makeAny( aUIOptions ); } @@ -2916,7 +2812,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( rValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); rValue.Value <<= aPageSize; - m_pPrintUIOptions->addPrintUIOptions( aRenderer ); + m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); return aRenderer; } |