diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-09-23 14:05:07 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-09-24 08:33:46 +0100 |
commit | c8dc73720883333a13187865cd0d69b64af6b4b5 (patch) | |
tree | c9037bb6e79fd49507f2de1cf2b22f7159572720 /reportdesign/source | |
parent | remove obsolete Forte NOOPT files (diff) | |
download | core-c8dc73720883333a13187865cd0d69b64af6b4b5.tar.gz core-c8dc73720883333a13187865cd0d69b64af6b4b5.zip |
re-factor XPropertyList derivatives to use a rtl::Reference
This cleans up a lot of lifecycle nasties and cleans up some serious
cut/paste code duplication issues at the same time. Cleanup the
naming of ColorTable -> ColorList to match the impl. too
Diffstat (limited to 'reportdesign/source')
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 15 |
2 files changed, 6 insertions, 15 deletions
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index aad4c9bc5fd0..a5d55fbe6278 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -151,9 +151,9 @@ OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition) m_aColorSet.SetHelpId( HID_RPT_POPUP_COLOR_CTRL ); SetHelpId( HID_RPT_POPUP_COLOR ); const Size aSize12( 13, 13 ); - ::std::auto_ptr<XColorList> pColorTable(new XColorList( SvtPathOptions().GetPalettePath() )); short i = 0; - long nCount = pColorTable->Count(); + XColorListRef pColorList( XColorList::CreateStdColorList() ); + long nCount = pColorList->Count(); XColorEntry* pEntry = NULL; Color aColWhite( COL_WHITE ); String aStrWhite( ModuleRes(STR_COLOR_WHITE) ); @@ -164,7 +164,7 @@ OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition) for ( i = 0; i < nCount; i++ ) { - pEntry = pColorTable->GetColor(i); + pEntry = pColorList->GetColor(i); m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() ); } diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 4904169a89ab..e8e815ee5cc4 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -660,7 +660,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<FontList> pFontList(new FontList( pParent )); - ::std::auto_ptr<XColorList> pColorTable( new XColorList( SvtPathOptions().GetPalettePath() )); + XColorListRef pColorList( XColorList::CreateStdColorList() ); SAL_WNODEPRECATED_DECLARATIONS_POP SfxPoolItem* pDefaults[] = { @@ -682,7 +682,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep new SvxEscapementItem(ITEMID_ESCAPEMENT), new SvxFontListItem(pFontList.get(),ITEMID_FONTLIST), new SvxAutoKernItem(sal_False,ITEMID_AUTOKERN), - new SvxColorTableItem(pColorTable.get(),ITEMID_COLOR_TABLE), + new SvxColorListItem(pColorList.get(),ITEMID_COLOR_TABLE), new SvxBlinkItem(sal_False,ITEMID_BLINK), new SvxEmphasisMarkItem(EMPHASISMARK_NONE,ITEMID_EMPHASISMARK), new SvxTwoLinesItem(sal_True,0,0,ITEMID_TWOLINES), @@ -777,18 +777,9 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get() )); SAL_WNODEPRECATED_DECLARATIONS_POP - // #i74099# by default, the dialog deletes the current color table if a different one is loaded - // (see SwDrawShell::ExecDrawDlg) - const SvxColorTableItem* pColorItem = static_cast<const SvxColorTableItem*>( pDescriptor->GetItem(SID_COLOR_TABLE) ); - if (pColorItem && pColorItem->GetColorTable() == &XColorList::GetStdColorTable()) - pDialog->DontDeleteColorTable(); - bSuccess = ( RET_OK == pDialog->Execute() ); - if ( bSuccess ) - { + if ( ( bSuccess = ( RET_OK == pDialog->Execute() ) ) ) lcl_fillItemsToShape(_xShape,*pDialog->GetOutputItemSet()); - } } - } catch(uno::Exception&) { |