diff options
Diffstat (limited to 'svtools/source/config')
-rw-r--r-- | svtools/source/config/historyoptions.cxx | 38 | ||||
-rw-r--r-- | svtools/source/config/printoptions.cxx | 62 |
2 files changed, 50 insertions, 50 deletions
diff --git a/svtools/source/config/historyoptions.cxx b/svtools/source/config/historyoptions.cxx index d658f25d1a73..758753df0e4e 100644 --- a/svtools/source/config/historyoptions.cxx +++ b/svtools/source/config/historyoptions.cxx @@ -160,8 +160,8 @@ public: const OUString& sTitle , const OUString& sPassword ); -private:
- void impl_truncateList (EHistoryType eHistory, sal_uInt32 nSize);
+private: + void impl_truncateList (EHistoryType eHistory, sal_uInt32 nSize); private: css::uno::Reference< css::container::XNameAccess > m_xCfg; @@ -248,12 +248,12 @@ sal_uInt32 SvtHistoryOptions_Impl::GetSize( EHistoryType eHistory ) //***************************************************************************************************************** void SvtHistoryOptions_Impl::SetSize( EHistoryType eHistory, sal_uInt32 nSize ) { - css::uno::Reference< css::beans::XPropertySet > xListAccess(m_xCommonXCU, css::uno::UNO_QUERY);
- if (! xListAccess.is ())
+ css::uno::Reference< css::beans::XPropertySet > xListAccess(m_xCommonXCU, css::uno::UNO_QUERY); + if (! xListAccess.is ()) return; try - {
+ { switch( eHistory ) { case ePICKLIST: @@ -291,15 +291,15 @@ void SvtHistoryOptions_Impl::SetSize( EHistoryType eHistory, sal_uInt32 nSize ) LogHelper::logIt(ex); } } -
+ //***************************************************************************************************************** -void SvtHistoryOptions_Impl::impl_truncateList ( EHistoryType eHistory, sal_uInt32 nSize )
+void SvtHistoryOptions_Impl::impl_truncateList ( EHistoryType eHistory, sal_uInt32 nSize ) { css::uno::Reference< css::container::XNameAccess > xList; css::uno::Reference< css::container::XNameContainer > xItemList; css::uno::Reference< css::container::XNameContainer > xOrderList; css::uno::Reference< css::beans::XPropertySet > xSet; -
+ try { switch( eHistory ) @@ -322,11 +322,11 @@ void SvtHistoryOptions_Impl::impl_truncateList ( EHistoryType eHistory, sal_uInt // If too much items in current list ... // truncate the oldest items BEFORE you set the new one. - if ( ! xList.is())
- return;
+ if ( ! xList.is()) + return; xList->getByName(s_sOrderList) >>= xOrderList; - xList->getByName(s_sItemList) >>= xItemList;
+ xList->getByName(s_sItemList) >>= xItemList; const sal_uInt32 nLength = xOrderList->getElementNames().getLength(); if (nSize < nLength) @@ -348,7 +348,7 @@ void SvtHistoryOptions_Impl::impl_truncateList ( EHistoryType eHistory, sal_uInt { LogHelper::logIt(ex); } -}
+} //***************************************************************************************************************** // public method @@ -416,8 +416,8 @@ void SvtHistoryOptions_Impl::Clear( EHistoryType eHistory ) //***************************************************************************************************************** Sequence< Sequence< PropertyValue > > SvtHistoryOptions_Impl::GetList( EHistoryType eHistory ) { - impl_truncateList (eHistory, GetSize (eHistory));
-
+ impl_truncateList (eHistory, GetSize (eHistory)); + Sequence< Sequence< PropertyValue > > seqReturn; // Set default return value. Sequence< PropertyValue > seqProperties( 4 ); Sequence< ::rtl::OUString > lOrders; @@ -433,12 +433,12 @@ Sequence< Sequence< PropertyValue > > SvtHistoryOptions_Impl::GetList( EHistoryT seqProperties[s_nOffsetPassword ].Name = HISTORY_PROPERTYNAME_PASSWORD; try - {
+ { switch( eHistory ) { case ePICKLIST: { - m_xCfg->getByName(s_sPickList) >>= xListAccess;
+ m_xCfg->getByName(s_sPickList) >>= xListAccess; break; } @@ -457,7 +457,7 @@ Sequence< Sequence< PropertyValue > > SvtHistoryOptions_Impl::GetList( EHistoryT default: break; } -
+ if (xListAccess.is()) { xListAccess->getByName(s_sItemList) >>= xItemList; @@ -500,8 +500,8 @@ void SvtHistoryOptions_Impl::AppendItem( EHistoryType eHistory , const OUString& sTitle , const OUString& sPassword ) { - impl_truncateList (eHistory, GetSize (eHistory));
-
+ impl_truncateList (eHistory, GetSize (eHistory)); + css::uno::Reference< css::container::XNameAccess > xListAccess; sal_Int32 nMaxSize = 0; diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index 657d82ddb44e..0f54366c47f6 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -168,17 +168,17 @@ public: void SetReducedBitmapResolution( sal_Int16 nResolution ) ; void SetReducedBitmapIncludesTransparency( sal_Bool bState ) ; void SetConvertToGreyscales( sal_Bool bState ) ; -
+ //------------------------------------------------------------------------------------------------------------- // private API -//-------------------------------------------------------------------------------------------------------------
- -private:
- void impl_setValue (const ::rtl::OUString& sProp,
- ::sal_Bool bNew );
- void impl_setValue (const ::rtl::OUString& sProp,
- ::sal_Int16 nNew );
-
+//------------------------------------------------------------------------------------------------------------- + +private: + void impl_setValue (const ::rtl::OUString& sProp, + ::sal_Bool bNew ); + void impl_setValue (const ::rtl::OUString& sProp, + ::sal_Int16 nNew ); + //------------------------------------------------------------------------------------------------------------- // private member //------------------------------------------------------------------------------------------------------------- @@ -431,7 +431,7 @@ sal_Bool SvtPrintOptions_Impl::IsConvertToGreyscales() const return bRet; } -
+ void SvtPrintOptions_Impl::SetReduceTransparency(sal_Bool bState) { impl_setValue(PROPERTYNAME_REDUCETRANSPARENCY, bState); @@ -488,21 +488,21 @@ SvtPrintOptions_Impl::~SvtPrintOptions_Impl() m_xCfg.clear(); } -void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp,
- ::sal_Bool bNew )
-{
+void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp, + ::sal_Bool bNew ) +{ try { - if ( ! m_xNode.is())
- return;
+ if ( ! m_xNode.is()) + return; css::uno::Reference<css::beans::XPropertySet> xSet(m_xNode, css::uno::UNO_QUERY); - if ( ! xSet.is())
- return;
+ if ( ! xSet.is()) + return; ::sal_Bool bOld = ! bNew; - if ( ! (xSet->getPropertyValue(sProp) >>= bOld))
- return;
+ if ( ! (xSet->getPropertyValue(sProp) >>= bOld)) + return; if (bOld != bNew) { @@ -514,23 +514,23 @@ void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp, { LogHelper::logIt(ex); } -}
+} -void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp,
- ::sal_Int16 nNew )
-{
+void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp, + ::sal_Int16 nNew ) +{ try { - if ( ! m_xNode.is())
- return;
+ if ( ! m_xNode.is()) + return; css::uno::Reference<css::beans::XPropertySet> xSet(m_xNode, css::uno::UNO_QUERY); - if ( ! xSet.is())
- return;
+ if ( ! xSet.is()) + return; ::sal_Int16 nOld = nNew+1; - if ( ! (xSet->getPropertyValue(sProp) >>= nOld))
- return;
+ if ( ! (xSet->getPropertyValue(sProp) >>= nOld)) + return; if (nOld != nNew) { @@ -542,8 +542,8 @@ void SvtPrintOptions_Impl::impl_setValue (const ::rtl::OUString& sProp, { LogHelper::logIt(ex); } -}
-
+} + // ----------------------------------------------------------------------------- |