unwind RID_SVXIMGLIST_FMEXPL ImageList

Change-Id: If9d733c5242e2f2b9947b251cfe832d1c10bd4bd
Reviewed-on: https://gerrit.libreoffice.org/32350
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2016-12-22 16:47:36 +00:00
parent 429902e38b
commit cf6f3ad82b
10 changed files with 301 additions and 252 deletions

View File

@ -208,11 +208,9 @@ SvxConfigGroupListBox::SvxConfigGroupListBox(vcl::Window* pParent, WinBits nStyl
, m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS)) , m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS))
, m_sProdMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS)) , m_sProdMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS))
{ {
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
SetNodeBitmaps( SetNodeBitmaps(
aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ), Image(BitmapEx(SVX_RES(RID_SVXBMP_COLLAPSEDNODE))),
aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ) Image(BitmapEx(SVX_RES(RID_SVXBMP_EXPANDEDNODE)))
); );
} }

View File

@ -21,43 +21,37 @@
#include <svl/solar.hrc> #include <svl/solar.hrc>
// unnamed resources -------------------------------------------------------
// sub resources .....................
// ImageList-Id's -----------------------------------------------------------
#define RID_SVXIMGLIST_FMEXPL (RID_FORMS_START + 0)
// Image-Id's ----------------------------------------------------------- // Image-Id's -----------------------------------------------------------
#define RID_SVXIMG_FORM SID_FM_CONFIG #define RID_SVXBMP_FORM (RID_FORMS_START + 1)
#define RID_SVXIMG_CONTROL SID_CHOOSE_CONTROLS #define RID_SVXBMP_CONTROL (RID_FORMS_START + 2)
#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2) #define RID_SVXBMP_COLLAPSEDNODE (RID_FORMS_START + 3)
#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3) #define RID_SVXBMP_EXPANDEDNODE (RID_FORMS_START + 4)
#define RID_SVXIMG_BUTTON SID_FM_PUSHBUTTON #define RID_SVXBMP_BUTTON (RID_FORMS_START + 5)
#define RID_SVXIMG_RADIOBUTTON SID_FM_RADIOBUTTON #define RID_SVXBMP_RADIOBUTTON (RID_FORMS_START + 6)
#define RID_SVXIMG_CHECKBOX SID_FM_CHECKBOX #define RID_SVXBMP_CHECKBOX (RID_FORMS_START + 7)
#define RID_SVXIMG_FIXEDTEXT SID_FM_FIXEDTEXT #define RID_SVXBMP_FIXEDTEXT (RID_FORMS_START + 8)
#define RID_SVXIMG_GROUPBOX SID_FM_GROUPBOX #define RID_SVXBMP_GROUPBOX (RID_FORMS_START + 9)
#define RID_SVXIMG_EDIT SID_FM_EDIT #define RID_SVXBMP_EDITBOX (RID_FORMS_START + 10)
#define RID_SVXIMG_LISTBOX SID_FM_LISTBOX #define RID_SVXBMP_LISTBOX (RID_FORMS_START + 11)
#define RID_SVXIMG_COMBOBOX SID_FM_COMBOBOX #define RID_SVXBMP_COMBOBOX (RID_FORMS_START + 12)
#define RID_SVXIMG_FORMS (RID_FORMS_START +13) #define RID_SVXBMP_FORMS (RID_FORMS_START + 13)
#define RID_SVXIMG_IMAGEBUTTON SID_FM_IMAGEBUTTON #define RID_SVXBMP_IMAGEBUTTON (RID_FORMS_START + 14)
#define RID_SVXIMG_IMAGECONTROL SID_FM_IMAGECONTROL #define RID_SVXBMP_IMAGECONTROL (RID_FORMS_START + 15)
#define RID_SVXIMG_FILECONTROL SID_FM_FILECONTROL #define RID_SVXBMP_FILECONTROL (RID_FORMS_START + 16)
#define RID_SVXIMG_DATEFIELD SID_FM_DATEFIELD #define RID_SVXBMP_DATEFIELD (RID_FORMS_START + 17)
#define RID_SVXIMG_TIMEFIELD SID_FM_TIMEFIELD #define RID_SVXBMP_TIMEFIELD (RID_FORMS_START + 18)
#define RID_SVXIMG_NUMERICFIELD SID_FM_NUMERICFIELD #define RID_SVXBMP_NUMERICFIELD (RID_FORMS_START + 19)
#define RID_SVXIMG_CURRENCYFIELD SID_FM_CURRENCYFIELD #define RID_SVXBMP_CURRENCYFIELD (RID_FORMS_START + 20)
#define RID_SVXIMG_PATTERNFIELD SID_FM_PATTERNFIELD #define RID_SVXBMP_PATTERNFIELD (RID_FORMS_START + 21)
#define RID_SVXIMG_HIDDEN (RID_FORMS_START +22) #define RID_SVXBMP_HIDDEN (RID_FORMS_START + 22)
#define RID_SVXIMG_GRID SID_FM_DBGRID #define RID_SVXBMP_GRID (RID_FORMS_START + 23)
#define RID_SVXIMG_FORMATTEDFIELD SID_FM_FORMATTEDFIELD #define RID_SVXBMP_FORMATTEDFIELD (RID_FORMS_START + 24)
#define RID_SVXIMG_FILTER SID_FM_FILTERCRIT #define RID_SVXBMP_FILTER (RID_FORMS_START + 25)
#define RID_SVXIMG_DATE_N_TIME_FIELDS SID_FM_TWOFIELDS_DATE_N_TIME #define RID_SVXBMP_DATE_N_TIME_FIELDS (RID_FORMS_START + 26)
#define RID_SVXIMG_FIELD (RID_FORMS_START +27) #define RID_SVXBMP_FIELD (RID_FORMS_START + 27)
#define RID_SVXIMG_SCROLLBAR SID_FM_SCROLLBAR #define RID_SVXBMP_SCROLLBAR (RID_FORMS_START + 28)
#define RID_SVXIMG_SPINBUTTON SID_FM_SPINBUTTON #define RID_SVXBMP_SPINBUTTON (RID_FORMS_START + 29)
#define RID_SVXIMG_NAVIGATIONBAR SID_FM_NAVIGATIONBAR #define RID_SVXBMP_NAVIGATIONBAR (RID_FORMS_START + 30)
// Toolbars ------------------------------------------------------------ // Toolbars ------------------------------------------------------------
#define RID_SVXTBX_FORM_NAVIGATION (RID_FORMS_START + 1) #define RID_SVXTBX_FORM_NAVIGATION (RID_FORMS_START + 1)

View File

@ -116,12 +116,13 @@ struct FmGridHeaderData
}; };
const sal_Int16 nChangeTypeOffset = 1000; const sal_Int16 nChangeTypeOffset = 1000;
void SetMenuItem(const ImageList& rList, sal_uInt16 nID, Menu* pMenu, Menu& rNewMenu, bool bDesignMode, sal_Int16 nOffset = nChangeTypeOffset) void SetMenuItem(sal_uInt16 nImgID, sal_uInt16 nID, Menu* pMenu, Menu& rNewMenu, bool bDesignMode, sal_Int16 nOffset = nChangeTypeOffset)
{ {
pMenu->SetItemImage(nID, rList.GetImage(nID)); Image aImage(BitmapEx(SVX_RES(nImgID)));
pMenu->SetItemImage(nID, aImage);
pMenu->EnableItem(nID, bDesignMode); pMenu->EnableItem(nID, bDesignMode);
rNewMenu.InsertItem(nID + nOffset, pMenu->GetItemText(nID)); rNewMenu.InsertItem(nID + nOffset, pMenu->GetItemText(nID));
rNewMenu.SetItemImage(nID + nOffset, rList.GetImage(nID)); rNewMenu.SetItemImage(nID + nOffset, aImage);
rNewMenu.SetHelpId(nID + nOffset, pMenu->GetHelpId(nID)); rNewMenu.SetHelpId(nID + nOffset, pMenu->GetHelpId(nID));
rNewMenu.EnableItem(nID + nOffset, bDesignMode); rNewMenu.EnableItem(nID + nOffset, bDesignMode);
} }
@ -434,45 +435,61 @@ IMPL_LINK_NOARG( FmGridHeader, OnAsyncExecuteDrop, void*, void )
// Create Column based on type, default textfield // Create Column based on type, default textfield
std::vector<sal_uInt16> aPossibleTypes; std::vector<sal_uInt16> aPossibleTypes;
std::vector<sal_uInt16> aImgResId;
switch (nDataType) switch (nDataType)
{ {
case DataType::BIT: case DataType::BIT:
case DataType::BOOLEAN: case DataType::BOOLEAN:
aPossibleTypes.push_back(SID_FM_CHECKBOX); aPossibleTypes.push_back(SID_FM_CHECKBOX);
aImgResId.push_back(RID_SVXBMP_CHECKBOX);
break; break;
case DataType::TINYINT: case DataType::TINYINT:
case DataType::SMALLINT: case DataType::SMALLINT:
case DataType::INTEGER: case DataType::INTEGER:
aPossibleTypes.push_back(SID_FM_NUMERICFIELD); aPossibleTypes.push_back(SID_FM_NUMERICFIELD);
aImgResId.push_back(RID_SVXBMP_NUMERICFIELD);
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
break; break;
case DataType::REAL: case DataType::REAL:
case DataType::DOUBLE: case DataType::DOUBLE:
case DataType::NUMERIC: case DataType::NUMERIC:
case DataType::DECIMAL: case DataType::DECIMAL:
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
aPossibleTypes.push_back(SID_FM_NUMERICFIELD); aPossibleTypes.push_back(SID_FM_NUMERICFIELD);
aImgResId.push_back(RID_SVXBMP_NUMERICFIELD);
break; break;
case DataType::TIMESTAMP: case DataType::TIMESTAMP:
aPossibleTypes.push_back(SID_FM_TWOFIELDS_DATE_N_TIME); aPossibleTypes.push_back(SID_FM_TWOFIELDS_DATE_N_TIME);
aImgResId.push_back(RID_SVXBMP_DATE_N_TIME_FIELDS);
aPossibleTypes.push_back(SID_FM_DATEFIELD); aPossibleTypes.push_back(SID_FM_DATEFIELD);
aImgResId.push_back(RID_SVXBMP_DATEFIELD);
aPossibleTypes.push_back(SID_FM_TIMEFIELD); aPossibleTypes.push_back(SID_FM_TIMEFIELD);
aImgResId.push_back(RID_SVXBMP_TIMEFIELD);
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
break; break;
case DataType::DATE: case DataType::DATE:
aPossibleTypes.push_back(SID_FM_DATEFIELD); aPossibleTypes.push_back(SID_FM_DATEFIELD);
aImgResId.push_back(RID_SVXBMP_DATEFIELD);
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
break; break;
case DataType::TIME: case DataType::TIME:
aPossibleTypes.push_back(SID_FM_TIMEFIELD); aPossibleTypes.push_back(SID_FM_TIMEFIELD);
aImgResId.push_back(RID_SVXBMP_TIMEFIELD);
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
break; break;
case DataType::CHAR: case DataType::CHAR:
case DataType::VARCHAR: case DataType::VARCHAR:
case DataType::LONGVARCHAR: case DataType::LONGVARCHAR:
default: default:
aPossibleTypes.push_back(SID_FM_EDIT); aPossibleTypes.push_back(SID_FM_EDIT);
aImgResId.push_back(RID_SVXBMP_EDITBOX);
aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD); aPossibleTypes.push_back(SID_FM_FORMATTEDFIELD);
aImgResId.push_back(RID_SVXBMP_FORMATTEDFIELD);
break; break;
} }
// if it's a currency field, a "currency field" option // if it's a currency field, a "currency field" option
@ -480,26 +497,32 @@ IMPL_LINK_NOARG( FmGridHeader, OnAsyncExecuteDrop, void*, void )
{ {
if ( ::comphelper::hasProperty(FM_PROP_ISCURRENCY, xField) if ( ::comphelper::hasProperty(FM_PROP_ISCURRENCY, xField)
&& ::comphelper::getBOOL(xField->getPropertyValue(FM_PROP_ISCURRENCY))) && ::comphelper::getBOOL(xField->getPropertyValue(FM_PROP_ISCURRENCY)))
{
aPossibleTypes.insert(aPossibleTypes.begin(), SID_FM_CURRENCYFIELD); aPossibleTypes.insert(aPossibleTypes.begin(), SID_FM_CURRENCYFIELD);
aImgResId.insert(aImgResId.begin(), RID_SVXBMP_CURRENCYFIELD);
}
} }
catch(Exception&) catch (const Exception&)
{ {
OSL_FAIL("FmGridHeader::ExecuteDrop: Exception occurred!"); OSL_FAIL("FmGridHeader::ExecuteDrop: Exception occurred!");
} }
assert(aPossibleTypes.size() == aImgResId.size());
bool bDateNTimeCol = false; bool bDateNTimeCol = false;
if (!aPossibleTypes.empty()) if (!aPossibleTypes.empty())
{ {
sal_Int32 nPreferredType = aPossibleTypes[0]; sal_Int32 nPreferredType = aPossibleTypes[0];
if ((m_pImpl->nDropAction == DND_ACTION_LINK) && (aPossibleTypes.size() > 1)) if ((m_pImpl->nDropAction == DND_ACTION_LINK) && (aPossibleTypes.size() > 1))
{ {
ImageList aImageList( SVX_RES(RID_SVXIMGLIST_FMEXPL) );
ScopedVclPtrInstance<PopupMenu> aInsertMenu(SVX_RES(RID_SVXMNU_COLS)); ScopedVclPtrInstance<PopupMenu> aInsertMenu(SVX_RES(RID_SVXMNU_COLS));
ScopedVclPtrInstance<PopupMenu> aTypeMenu; ScopedVclPtrInstance<PopupMenu> aTypeMenu;
PopupMenu* pMenu = aInsertMenu->GetPopupMenu(SID_FM_INSERTCOL); PopupMenu* pMenu = aInsertMenu->GetPopupMenu(SID_FM_INSERTCOL);
for (std::vector<sal_uInt16>::const_iterator iter = aPossibleTypes.begin(); iter != aPossibleTypes.end(); ++iter) for (std::vector<sal_uInt16>::const_iterator iter = aPossibleTypes.begin(), imgiter = aImgResId.begin();
SetMenuItem(aImageList, *iter, pMenu, *aTypeMenu.get(), true, 0); iter != aPossibleTypes.end(); ++iter, ++imgiter)
{
SetMenuItem(*imgiter, *iter, pMenu, *aTypeMenu.get(), true, 0);
}
nPreferredType = aTypeMenu->Execute(this, m_pImpl->aDropPosPixel); nPreferredType = aTypeMenu->Execute(this, m_pImpl->aDropPosPixel);
} }
@ -655,22 +678,21 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
sal_uInt16 nPos = GetModelColumnPos(nColId); sal_uInt16 nPos = GetModelColumnPos(nColId);
bool bMarked = nColId && static_cast<FmGridControl*>(GetParent())->isColumnMarked(nColId); bool bMarked = nColId && static_cast<FmGridControl*>(GetParent())->isColumnMarked(nColId);
ImageList aImageList( SVX_RES(RID_SVXIMGLIST_FMEXPL) );
VclPtrInstance<PopupMenu> pControlMenu; VclPtrInstance<PopupMenu> pControlMenu;
PopupMenu* pMenu = rMenu.GetPopupMenu(SID_FM_INSERTCOL); PopupMenu* pMenu = rMenu.GetPopupMenu(SID_FM_INSERTCOL);
if (pMenu) if (pMenu)
{ {
SetMenuItem(aImageList, SID_FM_EDIT, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_EDITBOX, SID_FM_EDIT, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_CHECKBOX, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_CHECKBOX, SID_FM_CHECKBOX, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_COMBOBOX, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_COMBOBOX, SID_FM_COMBOBOX, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_LISTBOX, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_LISTBOX, SID_FM_LISTBOX, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_DATEFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_DATEFIELD, SID_FM_DATEFIELD, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_TIMEFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_TIMEFIELD, SID_FM_TIMEFIELD, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_NUMERICFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_NUMERICFIELD, SID_FM_NUMERICFIELD, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_CURRENCYFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_CURRENCYFIELD, SID_FM_CURRENCYFIELD, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_PATTERNFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_PATTERNFIELD, SID_FM_PATTERNFIELD, pMenu, *pControlMenu, bDesignMode);
SetMenuItem(aImageList, SID_FM_FORMATTEDFIELD, pMenu, *pControlMenu, bDesignMode); SetMenuItem(RID_SVXBMP_FORMATTEDFIELD, SID_FM_FORMATTEDFIELD, pMenu, *pControlMenu, bDesignMode);
} }
if (pMenu && xCols.is() && nColId) if (pMenu && xCols.is() && nColId)

View File

@ -135,7 +135,6 @@ Image FmFilterData::GetImage() const
return Image(); return Image();
} }
FmParentData::~FmParentData() FmParentData::~FmParentData()
{ {
for (::std::vector<FmFilterData*>::const_iterator i = m_aChildren.begin(); for (::std::vector<FmFilterData*>::const_iterator i = m_aChildren.begin();
@ -143,14 +142,11 @@ FmParentData::~FmParentData()
delete (*i); delete (*i);
} }
Image FmFormItem::GetImage() const Image FmFormItem::GetImage() const
{ {
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); return Image(BitmapEx(SVX_RES(RID_SVXBMP_FORM)));
return aNavigatorImages.GetImage( RID_SVXIMG_FORM );
} }
FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) const FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) const
{ {
for ( ::std::vector< FmFilterData* >::const_iterator i = m_aChildren.begin(); for ( ::std::vector< FmFilterData* >::const_iterator i = m_aChildren.begin();
@ -166,14 +162,11 @@ FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) co
return nullptr; return nullptr;
} }
Image FmFilterItems::GetImage() const Image FmFilterItems::GetImage() const
{ {
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); return Image(BitmapEx(SVX_RES(RID_SVXBMP_FILTER)));
return aNavigatorImages.GetImage( RID_SVXIMG_FILTER );
} }
FmFilterItem::FmFilterItem( FmFilterItems* pParent, FmFilterItem::FmFilterItem( FmFilterItems* pParent,
const OUString& aFieldName, const OUString& aFieldName,
const OUString& aText, const OUString& aText,
@ -184,14 +177,11 @@ FmFilterItem::FmFilterItem( FmFilterItems* pParent,
{ {
} }
Image FmFilterItem::GetImage() const Image FmFilterItem::GetImage() const
{ {
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); return Image(BitmapEx(SVX_RES(RID_SVXBMP_FIELD)));
return aNavigatorImages.GetImage( RID_SVXIMG_FIELD );
} }
// Hints for communication between model and view // Hints for communication between model and view
class FmFilterHint : public SfxHint class FmFilterHint : public SfxHint
@ -203,7 +193,6 @@ public:
FmFilterData* GetData() const { return m_pData; } FmFilterData* GetData() const { return m_pData; }
}; };
class FmFilterInsertedHint : public FmFilterHint class FmFilterInsertedHint : public FmFilterHint
{ {
sal_uLong m_nPos; // Position relative to the parent of the data sal_uLong m_nPos; // Position relative to the parent of the data
@ -216,7 +205,6 @@ public:
sal_uLong GetPos() const { return m_nPos; } sal_uLong GetPos() const { return m_nPos; }
}; };
class FmFilterRemovedHint : public FmFilterHint class FmFilterRemovedHint : public FmFilterHint
{ {
public: public:
@ -232,23 +220,19 @@ public:
:FmFilterHint(pData){} :FmFilterHint(pData){}
}; };
class FilterClearingHint : public SfxHint class FilterClearingHint : public SfxHint
{ {
public: public:
FilterClearingHint(){} FilterClearingHint(){}
}; };
class FmFilterCurrentChangedHint : public SfxHint class FmFilterCurrentChangedHint : public SfxHint
{ {
public: public:
FmFilterCurrentChangedHint(){} FmFilterCurrentChangedHint(){}
}; };
// class FmFilterAdapter, Listener an den FilterControls // class FmFilterAdapter, Listener an den FilterControls
class FmFilterAdapter : public ::cppu::WeakImplHelper< XFilterControllerListener > class FmFilterAdapter : public ::cppu::WeakImplHelper< XFilterControllerListener >
{ {
FmFilterModel* m_pModel; FmFilterModel* m_pModel;
@ -1096,13 +1080,10 @@ FmFilterNavigator::FmFilterNavigator( vcl::Window* pParent )
{ {
SetHelpId( HID_FILTER_NAVIGATOR ); SetHelpId( HID_FILTER_NAVIGATOR );
{ SetNodeBitmaps(
ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); Image(BitmapEx(SVX_RES(RID_SVXBMP_COLLAPSEDNODE))),
SetNodeBitmaps( Image(BitmapEx(SVX_RES(RID_SVXBMP_EXPANDEDNODE)))
aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ), );
aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE )
);
}
m_pModel = new FmFilterModel(); m_pModel = new FmFilterModel();
StartListening( *m_pModel ); StartListening( *m_pModel );

View File

@ -248,20 +248,12 @@ bool FmEntryData::IsEqualWithoutChildren( FmEntryData* pEntryData )
return true; return true;
} }
FmFormData::FmFormData(const Reference< XForm >& _rxForm, FmFormData* _pParent)
FmFormData::FmFormData( : FmEntryData(_pParent, _rxForm)
const Reference< XForm >& _rxForm, , m_xForm(_rxForm)
const ImageList& _rNormalImages,
FmFormData* _pParent
)
: FmEntryData( _pParent, _rxForm ),
m_xForm( _rxForm )
{ {
// Images setzen // Images setzen
m_aNormalImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_FORM)));
m_aNormalImage = _rNormalImages.GetImage( RID_SVXIMG_FORM );
// Titel setzen // Titel setzen
if (m_xForm.is()) if (m_xForm.is())
@ -277,12 +269,10 @@ FmFormData::FmFormData(
SetText( OUString() ); SetText( OUString() );
} }
FmFormData::~FmFormData() FmFormData::~FmFormData()
{ {
} }
FmFormData::FmFormData( const FmFormData& rFormData ) FmFormData::FmFormData( const FmFormData& rFormData )
:FmEntryData( rFormData ) :FmEntryData( rFormData )
{ {
@ -309,18 +299,13 @@ bool FmFormData::IsEqualWithoutChildren( FmEntryData* pEntryData )
return FmEntryData::IsEqualWithoutChildren( pFormData ); return FmEntryData::IsEqualWithoutChildren( pFormData );
} }
FmControlData::FmControlData(const Reference< XFormComponent >& _rxComponent, FmFormData* _pParent)
FmControlData::FmControlData(
const Reference< XFormComponent >& _rxComponent,
const ImageList& _rNormalImages,
FmFormData* _pParent
)
: FmEntryData( _pParent, _rxComponent ), : FmEntryData( _pParent, _rxComponent ),
m_xFormComponent( _rxComponent ) m_xFormComponent( _rxComponent )
{ {
// Images setzen // Images setzen
m_aNormalImage = GetImage( _rNormalImages ); m_aNormalImage = GetImage();
// Titel setzen // Titel setzen
@ -350,11 +335,10 @@ FmEntryData* FmControlData::Clone()
} }
Image FmControlData::GetImage(const ImageList& ilNavigatorImages) const Image FmControlData::GetImage() const
{ {
// Default-Image // Default-Image
Image aImage = ilNavigatorImages.GetImage( RID_SVXIMG_CONTROL ); Image aImage(BitmapEx(SVX_RES(RID_SVXBMP_CONTROL)));
Reference< XServiceInfo > xInfo( m_xFormComponent, UNO_QUERY ); Reference< XServiceInfo > xInfo( m_xFormComponent, UNO_QUERY );
if (!m_xFormComponent.is()) if (!m_xFormComponent.is())
@ -366,98 +350,97 @@ Image FmControlData::GetImage(const ImageList& ilNavigatorImages) const
switch (nObjectType) switch (nObjectType)
{ {
case OBJ_FM_BUTTON: case OBJ_FM_BUTTON:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_BUTTON ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_BUTTON)));
break; break;
case OBJ_FM_FIXEDTEXT: case OBJ_FM_FIXEDTEXT:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_FIXEDTEXT ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_FIXEDTEXT)));
break; break;
case OBJ_FM_EDIT: case OBJ_FM_EDIT:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_EDIT ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_EDITBOX)));
break; break;
case OBJ_FM_RADIOBUTTON: case OBJ_FM_RADIOBUTTON:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_RADIOBUTTON ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_RADIOBUTTON)));
break; break;
case OBJ_FM_CHECKBOX: case OBJ_FM_CHECKBOX:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_CHECKBOX ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_CHECKBOX)));
break; break;
case OBJ_FM_LISTBOX: case OBJ_FM_LISTBOX:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_LISTBOX ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_LISTBOX)));
break; break;
case OBJ_FM_COMBOBOX: case OBJ_FM_COMBOBOX:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_COMBOBOX ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_COMBOBOX)));
break; break;
case OBJ_FM_NAVIGATIONBAR: case OBJ_FM_NAVIGATIONBAR:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_NAVIGATIONBAR ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_NAVIGATIONBAR)));
break; break;
case OBJ_FM_GROUPBOX: case OBJ_FM_GROUPBOX:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_GROUPBOX ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_GROUPBOX)));
break; break;
case OBJ_FM_IMAGEBUTTON: case OBJ_FM_IMAGEBUTTON:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_IMAGEBUTTON ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_IMAGEBUTTON)));
break; break;
case OBJ_FM_FILECONTROL: case OBJ_FM_FILECONTROL:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_FILECONTROL ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_FILECONTROL)));
break; break;
case OBJ_FM_HIDDEN: case OBJ_FM_HIDDEN:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_HIDDEN ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_HIDDEN)));
break; break;
case OBJ_FM_DATEFIELD: case OBJ_FM_DATEFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_DATEFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_DATEFIELD)));
break; break;
case OBJ_FM_TIMEFIELD: case OBJ_FM_TIMEFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_TIMEFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_TIMEFIELD)));
break; break;
case OBJ_FM_NUMERICFIELD: case OBJ_FM_NUMERICFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_NUMERICFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_NUMERICFIELD)));
break; break;
case OBJ_FM_CURRENCYFIELD: case OBJ_FM_CURRENCYFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_CURRENCYFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_CURRENCYFIELD)));
break; break;
case OBJ_FM_PATTERNFIELD: case OBJ_FM_PATTERNFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_PATTERNFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_PATTERNFIELD)));
break; break;
case OBJ_FM_IMAGECONTROL: case OBJ_FM_IMAGECONTROL:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_IMAGECONTROL ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_IMAGECONTROL)));
break; break;
case OBJ_FM_FORMATTEDFIELD: case OBJ_FM_FORMATTEDFIELD:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_FORMATTEDFIELD ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_FORMATTEDFIELD)));
break; break;
case OBJ_FM_GRID: case OBJ_FM_GRID:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_GRID ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_GRID)));
break; break;
case OBJ_FM_SCROLLBAR: case OBJ_FM_SCROLLBAR:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_SCROLLBAR ); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_SCROLLBAR)));
break; break;
case OBJ_FM_SPINBUTTON: case OBJ_FM_SPINBUTTON:
aImage = ilNavigatorImages.GetImage( RID_SVXIMG_SPINBUTTON); aImage = Image(BitmapEx(SVX_RES(RID_SVXBMP_SPINBUTTON)));
break; break;
} }
return aImage; return aImage;
} }
bool FmControlData::IsEqualWithoutChildren( FmEntryData* pEntryData ) bool FmControlData::IsEqualWithoutChildren( FmEntryData* pEntryData )
{ {
if(this == pEntryData) if(this == pEntryData)
@ -473,20 +456,14 @@ bool FmControlData::IsEqualWithoutChildren( FmEntryData* pEntryData )
return FmEntryData::IsEqualWithoutChildren( pControlData ); return FmEntryData::IsEqualWithoutChildren( pControlData );
} }
void FmControlData::ModelReplaced(const Reference< XFormComponent >& _rxNew)
void FmControlData::ModelReplaced(
const Reference< XFormComponent >& _rxNew,
const ImageList& _rNormalImages
)
{ {
m_xFormComponent = _rxNew; m_xFormComponent = _rxNew;
newObject( m_xFormComponent ); newObject( m_xFormComponent );
// Images neu setzen // Images neu setzen
m_aNormalImage = GetImage( _rNormalImages ); m_aNormalImage = GetImage();
} }
namespace svxform namespace svxform
{ {
@ -607,9 +584,6 @@ namespace svxform
SetWindow( VclPtr<NavigatorFrame>::Create( _pBindings, this, _pParent ) ); SetWindow( VclPtr<NavigatorFrame>::Create( _pBindings, this, _pParent ) );
static_cast<SfxDockingWindow*>(GetWindow())->Initialize( _pInfo ); static_cast<SfxDockingWindow*>(GetWindow())->Initialize( _pInfo );
} }
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -257,46 +257,154 @@ Menu RID_FMSHELL_CONVERSIONMENU
}; };
}; };
#define NAVIGATOR_IMAGEIDS \ Bitmap RID_SVXBMP_FORM
IdList = \
{ \
RID_SVXIMG_BUTTON ; \
RID_SVXIMG_RADIOBUTTON ; \
RID_SVXIMG_CHECKBOX ; \
RID_SVXIMG_FIXEDTEXT ; \
RID_SVXIMG_GROUPBOX ; \
RID_SVXIMG_EDIT ; \
RID_SVXIMG_LISTBOX ; \
RID_SVXIMG_COMBOBOX ; \
RID_SVXIMG_NAVIGATIONBAR ; \
RID_SVXIMG_CONTROL ; \
RID_SVXIMG_FORM ; \
RID_SVXIMG_FORMS ; \
RID_SVXIMG_COLLAPSEDNODE ; \
RID_SVXIMG_EXPANDEDNODE ; \
RID_SVXIMG_IMAGEBUTTON ; \
RID_SVXIMG_FILECONTROL ; \
RID_SVXIMG_DATEFIELD ; \
RID_SVXIMG_TIMEFIELD ; \
RID_SVXIMG_NUMERICFIELD ; \
RID_SVXIMG_CURRENCYFIELD ; \
RID_SVXIMG_PATTERNFIELD ; \
RID_SVXIMG_HIDDEN ; \
RID_SVXIMG_IMAGECONTROL ; \
RID_SVXIMG_GRID ; \
RID_SVXIMG_FILTER ; \
RID_SVXIMG_FORMATTEDFIELD ; \
RID_SVXIMG_DATE_N_TIME_FIELDS ; \
RID_SVXIMG_FIELD ; \
RID_SVXIMG_SCROLLBAR; \
RID_SVXIMG_SPINBUTTON; \
}; \
IdCount = 30
ImageList RID_SVXIMGLIST_FMEXPL
{ {
Prefix = "sx"; File = "sx10593.png";
NAVIGATOR_IMAGEIDS; };
Bitmap RID_SVXBMP_CONTROL
{
File = "sx10144.png";
};
Bitmap RID_SVXBMP_COLLAPSEDNODE
{
File = "sx18002.png";
};
Bitmap RID_SVXBMP_EXPANDEDNODE
{
File = "sx18003.png";
};
Bitmap RID_SVXBMP_BUTTON
{
File = "sx10594.png";
};
Bitmap RID_SVXBMP_RADIOBUTTON
{
File = "sx10595.png";
};
Bitmap RID_SVXBMP_CHECKBOX
{
File = "sx10596.png";
};
Bitmap RID_SVXBMP_FIXEDTEXT
{
File = "sx10597.png";
};
Bitmap RID_SVXBMP_GROUPBOX
{
File = "sx10598.png";
};
Bitmap RID_SVXBMP_EDITBOX
{
File = "sx10599.png";
};
Bitmap RID_SVXBMP_LISTBOX
{
File = "sx10600.png";
};
Bitmap RID_SVXBMP_COMBOBOX
{
File = "sx10600.png";
};
Bitmap RID_SVXBMP_FORMS
{
File = "sx18013.png";
};
Bitmap RID_SVXBMP_IMAGEBUTTON
{
File = "sx10604.png";
};
Bitmap RID_SVXBMP_IMAGECONTROL
{
File = "sx10710.png";
};
Bitmap RID_SVXBMP_FILECONTROL
{
File = "sx10605.png";
};
Bitmap RID_SVXBMP_DATEFIELD
{
File = "sx10704.png";
};
Bitmap RID_SVXBMP_TIMEFIELD
{
File = "sx10705.png";
};
Bitmap RID_SVXBMP_NUMERICFIELD
{
File = "sx10706.png";
};
Bitmap RID_SVXBMP_CURRENCYFIELD
{
File = "sx10707.png";
};
Bitmap RID_SVXBMP_PATTERNFIELD
{
File = "sx10708.png";
};
Bitmap RID_SVXBMP_HIDDEN
{
File = "sx18022.png";
};
Bitmap RID_SVXBMP_GRID
{
File = "sx10603.png";
};
Bitmap RID_SVXBMP_FORMATTEDFIELD
{
File = "sx10728.png";
};
Bitmap RID_SVXBMP_FILTER
{
File = "sx10715.png";
};
Bitmap RID_SVXBMP_DATE_N_TIME_FIELDS
{
File = "sx10757.png";
};
Bitmap RID_SVXBMP_FIELD
{
File = "sx18027.png";
};
Bitmap RID_SVXBMP_SCROLLBAR
{
File = "sx10768.png";
};
Bitmap RID_SVXBMP_SPINBUTTON
{
File = "sx10769.png";
};
Bitmap RID_SVXBMP_NAVIGATIONBAR
{
File = "sx10607.png";
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -203,28 +203,28 @@ static const sal_Int16 nConvertSlots[] =
SID_FM_CONVERTTO_NAVIGATIONBAR SID_FM_CONVERTTO_NAVIGATIONBAR
}; };
static const sal_Int16 nCreateSlots[] = static const sal_Int16 nImgIds[] =
{ {
SID_FM_EDIT, RID_SVXBMP_EDITBOX,
SID_FM_PUSHBUTTON, RID_SVXBMP_BUTTON,
SID_FM_FIXEDTEXT, RID_SVXBMP_FIXEDTEXT,
SID_FM_LISTBOX, RID_SVXBMP_LISTBOX,
SID_FM_CHECKBOX, RID_SVXBMP_CHECKBOX,
SID_FM_RADIOBUTTON, RID_SVXBMP_RADIOBUTTON,
SID_FM_GROUPBOX, RID_SVXBMP_GROUPBOX,
SID_FM_COMBOBOX, RID_SVXBMP_COMBOBOX,
SID_FM_IMAGEBUTTON, RID_SVXBMP_IMAGEBUTTON,
SID_FM_FILECONTROL, RID_SVXBMP_FILECONTROL,
SID_FM_DATEFIELD, RID_SVXBMP_DATEFIELD,
SID_FM_TIMEFIELD, RID_SVXBMP_TIMEFIELD,
SID_FM_NUMERICFIELD, RID_SVXBMP_NUMERICFIELD,
SID_FM_CURRENCYFIELD, RID_SVXBMP_CURRENCYFIELD,
SID_FM_PATTERNFIELD, RID_SVXBMP_PATTERNFIELD,
SID_FM_IMAGECONTROL, RID_SVXBMP_IMAGECONTROL,
SID_FM_FORMATTEDFIELD, RID_SVXBMP_FORMATTEDFIELD,
SID_FM_SCROLLBAR, RID_SVXBMP_SCROLLBAR,
SID_FM_SPINBUTTON, RID_SVXBMP_SPINBUTTON,
SID_FM_NAVIGATIONBAR RID_SVXBMP_NAVIGATIONBAR
}; };
static const sal_Int16 nObjectTypes[] = static const sal_Int16 nObjectTypes[] =
@ -1028,23 +1028,18 @@ void FmXFormShell::ForceUpdateSelection()
} }
} }
VclPtr<PopupMenu> FmXFormShell::GetConversionMenu() VclPtr<PopupMenu> FmXFormShell::GetConversionMenu()
{ {
VclPtrInstance<PopupMenu> pNewMenu(SVX_RES( RID_FMSHELL_CONVERSIONMENU )); VclPtrInstance<PopupMenu> pNewMenu(SVX_RES( RID_FMSHELL_CONVERSIONMENU ));
ImageList aImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL) );
for ( size_t i = 0; i < SAL_N_ELEMENTS(nConvertSlots); ++i ) for ( size_t i = 0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
{ {
// das entsprechende Image dran // das entsprechende Image dran
pNewMenu->SetItemImage(nConvertSlots[i], aImageList.GetImage(nCreateSlots[i])); pNewMenu->SetItemImage(nConvertSlots[i], Image(BitmapEx(SVX_RES(nImgIds[i]))));
} }
return pNewMenu; return pNewMenu;
} }
bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId ) bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
{ {
for (sal_Int16 nConvertSlot : nConvertSlots) for (sal_Int16 nConvertSlot : nConvertSlots)
@ -1053,7 +1048,6 @@ bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
return false; return false;
} }
void FmXFormShell::executeControlConversionSlot( sal_uInt16 _nSlotId ) void FmXFormShell::executeControlConversionSlot( sal_uInt16 _nSlotId )
{ {
OSL_PRECOND( canConvertCurrentSelectionToControl( _nSlotId ), "FmXFormShell::executeControlConversionSlot: illegal call!" ); OSL_PRECOND( canConvertCurrentSelectionToControl( _nSlotId ), "FmXFormShell::executeControlConversionSlot: illegal call!" );

View File

@ -134,18 +134,16 @@ namespace svxform
{ {
SetHelpId( HID_FORM_NAVIGATOR ); SetHelpId( HID_FORM_NAVIGATOR );
m_aNavigatorImages = ImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
SetNodeBitmaps( SetNodeBitmaps(
m_aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ), Image(BitmapEx(SVX_RES(RID_SVXBMP_COLLAPSEDNODE))),
m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ) Image(BitmapEx(SVX_RES(RID_SVXBMP_EXPANDEDNODE)))
); );
SetDragDropMode(DragDropMode::ALL); SetDragDropMode(DragDropMode::ALL);
EnableInplaceEditing( true ); EnableInplaceEditing( true );
SetSelectionMode(SelectionMode::Multiple); SetSelectionMode(SelectionMode::Multiple);
m_pNavModel = new NavigatorTreeModel( m_aNavigatorImages ); m_pNavModel = new NavigatorTreeModel();
Clear(); Clear();
StartListening( *m_pNavModel ); StartListening( *m_pNavModel );
@ -368,8 +366,8 @@ namespace svxform
// 'New'\'Form' under the same terms // 'New'\'Form' under the same terms
pSubMenuNew->EnableItem( SID_FM_NEW_FORM, bSingleSelection && (m_nFormsSelected || m_bRootSelected) ); pSubMenuNew->EnableItem( SID_FM_NEW_FORM, bSingleSelection && (m_nFormsSelected || m_bRootSelected) );
pSubMenuNew->SetItemImage(SID_FM_NEW_FORM, m_aNavigatorImages.GetImage(RID_SVXIMG_FORM)); pSubMenuNew->SetItemImage(SID_FM_NEW_FORM, Image(BitmapEx(SVX_RES(RID_SVXBMP_FORM))));
pSubMenuNew->SetItemImage(SID_FM_NEW_HIDDEN, m_aNavigatorImages.GetImage(RID_SVXIMG_HIDDEN)); pSubMenuNew->SetItemImage(SID_FM_NEW_HIDDEN, Image(BitmapEx(SVX_RES(RID_SVXBMP_HIDDEN))));
// 'New'\'hidden...', if exactly one form is selected // 'New'\'hidden...', if exactly one form is selected
pSubMenuNew->EnableItem( SID_FM_NEW_HIDDEN, bSingleSelection && m_nFormsSelected ); pSubMenuNew->EnableItem( SID_FM_NEW_HIDDEN, bSingleSelection && m_nFormsSelected );
@ -590,9 +588,8 @@ namespace svxform
{ {
SvTreeListBox::Clear(); SvTreeListBox::Clear();
// default-entry "Forms" // default-entry "Forms"
Image aRootImage( m_aNavigatorImages.GetImage( RID_SVXIMG_FORMS ) ); Image aRootImage(BitmapEx(SVX_RES(RID_SVXBMP_FORMS)));
m_pRootEntry = InsertEntry( SVX_RESSTR(RID_STR_FORMS), aRootImage, aRootImage, m_pRootEntry = InsertEntry( SVX_RESSTR(RID_STR_FORMS), aRootImage, aRootImage,
nullptr, false, 0 ); nullptr, false, 0 );
} }
@ -1337,7 +1334,7 @@ namespace svxform
if (!xPropertySet.is()) if (!xPropertySet.is())
return; return;
FmFormData* pNewFormData = new FmFormData( xNewForm, m_aNavigatorImages, pParentFormData ); FmFormData* pNewFormData = new FmFormData(xNewForm, pParentFormData);
// set name // set name
@ -1398,7 +1395,7 @@ namespace svxform
if (!xNewComponent.is()) if (!xNewComponent.is())
return nullptr; return nullptr;
FmControlData* pNewFormControlData = new FmControlData( xNewComponent, m_aNavigatorImages, pParentFormData ); FmControlData* pNewFormControlData = new FmControlData(xNewComponent, pParentFormData);
// set name // set name

View File

@ -186,17 +186,15 @@ namespace svxform
Remove( xElement ); Remove( xElement );
} }
NavigatorTreeModel::NavigatorTreeModel( const ImageList& _rNormalImages ) NavigatorTreeModel::NavigatorTreeModel()
:m_pFormShell(nullptr) :m_pFormShell(nullptr)
,m_pFormPage(nullptr) ,m_pFormPage(nullptr)
,m_pFormModel(nullptr) ,m_pFormModel(nullptr)
,m_aNormalImages( _rNormalImages )
{ {
m_pPropChangeList = new OFormComponentObserver(this); m_pPropChangeList = new OFormComponentObserver(this);
m_pRootList = new FmEntryDataList(); m_pRootList = new FmEntryDataList();
} }
NavigatorTreeModel::~NavigatorTreeModel() NavigatorTreeModel::~NavigatorTreeModel()
{ {
@ -521,10 +519,9 @@ namespace svxform
"NavigatorTreeModel::FillBranch : the root container should supply only elements of type XForm"); "NavigatorTreeModel::FillBranch : the root container should supply only elements of type XForm");
xForms->getByIndex(i) >>= xSubForm; xForms->getByIndex(i) >>= xSubForm;
FmFormData* pSubFormData = new FmFormData( xSubForm, m_aNormalImages, pFormData ); FmFormData* pSubFormData = new FmFormData(xSubForm, pFormData);
Insert( pSubFormData ); Insert( pSubFormData );
// new branch, if SubForm contains Subforms itself // new branch, if SubForm contains Subforms itself
FillBranch( pSubFormData ); FillBranch( pSubFormData );
} }
@ -550,7 +547,7 @@ namespace svxform
if (xSubForm.is()) if (xSubForm.is())
{ // actual component is a form { // actual component is a form
pSubFormData = new FmFormData(xSubForm, m_aNormalImages, pFormData); pSubFormData = new FmFormData(xSubForm, pFormData);
Insert(pSubFormData); Insert(pSubFormData);
@ -559,7 +556,7 @@ namespace svxform
} }
else else
{ {
pNewControlData = new FmControlData(xCurrentComponent, m_aNormalImages, pFormData); pNewControlData = new FmControlData(xCurrentComponent, pFormData);
Insert(pNewControlData); Insert(pNewControlData);
} }
} }
@ -581,7 +578,7 @@ namespace svxform
if (xParentForm.is()) if (xParentForm.is())
pParentData = static_cast<FmFormData*>(FindData( xParentForm, GetRootList() )); pParentData = static_cast<FmFormData*>(FindData( xParentForm, GetRootList() ));
pFormData = new FmFormData( xForm, m_aNormalImages, pParentData ); pFormData = new FmFormData(xForm, pParentData);
Insert( pFormData, nRelPos ); Insert( pFormData, nRelPos );
} }
@ -598,7 +595,7 @@ namespace svxform
FmFormData* pParentData = static_cast<FmFormData*>(FindData( xForm, GetRootList() )); FmFormData* pParentData = static_cast<FmFormData*>(FindData( xForm, GetRootList() ));
if( !pParentData ) if( !pParentData )
{ {
pParentData = new FmFormData( xForm, m_aNormalImages, nullptr ); pParentData = new FmFormData(xForm, nullptr);
Insert( pParentData ); Insert( pParentData );
} }
@ -606,7 +603,7 @@ namespace svxform
{ {
// set new EntryData // set new EntryData
FmEntryData* pNewEntryData = new FmControlData( xComp, m_aNormalImages, pParentData ); FmEntryData* pNewEntryData = new FmControlData(xComp, pParentData);
// insert new EntryData // insert new EntryData
@ -614,7 +611,6 @@ namespace svxform
} }
} }
void NavigatorTreeModel::ReplaceFormComponent( void NavigatorTreeModel::ReplaceFormComponent(
const Reference< XFormComponent > & xOld, const Reference< XFormComponent > & xOld,
const Reference< XFormComponent > & xNew const Reference< XFormComponent > & xNew
@ -624,13 +620,12 @@ namespace svxform
assert(pData && dynamic_cast<const FmControlData*>( pData) != nullptr); //NavigatorTreeModel::ReplaceFormComponent : invalid argument assert(pData && dynamic_cast<const FmControlData*>( pData) != nullptr); //NavigatorTreeModel::ReplaceFormComponent : invalid argument
if (!pData || dynamic_cast<const FmControlData*>( pData) == nullptr) if (!pData || dynamic_cast<const FmControlData*>( pData) == nullptr)
return; return;
static_cast<FmControlData*>(pData)->ModelReplaced( xNew, m_aNormalImages ); static_cast<FmControlData*>(pData)->ModelReplaced(xNew);
FmNavModelReplacedHint aReplacedHint( pData ); FmNavModelReplacedHint aReplacedHint( pData );
Broadcast( aReplacedHint ); Broadcast( aReplacedHint );
} }
FmEntryData* NavigatorTreeModel::FindData(const Reference< XInterface > & xElement, FmEntryDataList* pDataList, bool bRecurs) FmEntryData* NavigatorTreeModel::FindData(const Reference< XInterface > & xElement, FmEntryDataList* pDataList, bool bRecurs)
{ {
// normalize // normalize

View File

@ -238,13 +238,7 @@ class FmFormData : public FmEntryData
css::uno::Reference< css::container::XContainer > m_xContainer; css::uno::Reference< css::container::XContainer > m_xContainer;
public: public:
FmFormData(const css::uno::Reference< css::form::XForm >& _rxForm, FmFormData* _pParent);
FmFormData(
const css::uno::Reference< css::form::XForm >& _rxForm,
const ImageList& _rNormalImages,
FmFormData* _pParent
);
FmFormData( const FmFormData& rFormData ); FmFormData( const FmFormData& rFormData );
virtual ~FmFormData() override; virtual ~FmFormData() override;
@ -260,13 +254,12 @@ class FmControlData : public FmEntryData
{ {
css::uno::Reference< css::form::XFormComponent > m_xFormComponent; css::uno::Reference< css::form::XFormComponent > m_xFormComponent;
Image GetImage(const ImageList& ilNavigatorImages) const; Image GetImage() const;
public: public:
FmControlData( FmControlData(
const css::uno::Reference< css::form::XFormComponent >& _rxComponent, const css::uno::Reference< css::form::XFormComponent >& _rxComponent,
const ImageList& _rNormalImages,
FmFormData* _pParent FmFormData* _pParent
); );
FmControlData( const FmControlData& rControlData ); FmControlData( const FmControlData& rControlData );
@ -276,10 +269,7 @@ public:
virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData ) override; virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData ) override;
virtual FmEntryData* Clone() override; virtual FmEntryData* Clone() override;
void ModelReplaced( void ModelReplaced(const css::uno::Reference< css::form::XFormComponent >& _rxNew);
const css::uno::Reference< css::form::XFormComponent >& _rxNew,
const ImageList& _rNormalImages
);
}; };
@ -335,8 +325,6 @@ namespace svxform
FmFormModel* m_pFormModel; FmFormModel* m_pFormModel;
rtl::Reference<OFormComponentObserver> m_pPropChangeList; rtl::Reference<OFormComponentObserver> m_pPropChangeList;
ImageList m_aNormalImages;
void UpdateContent( const css::uno::Reference< css::form::XForms >& xForms ); void UpdateContent( const css::uno::Reference< css::form::XForms >& xForms );
void InsertForm(const css::uno::Reference< css::form::XForm >& xForm, sal_uInt32 nRelPos); void InsertForm(const css::uno::Reference< css::form::XForm >& xForm, sal_uInt32 nRelPos);
@ -356,7 +344,7 @@ namespace svxform
// Rueckgabe sal_True, wenn das Objekt eine FormComponent ist (oder rekursiv nur aus solchen besteht) // Rueckgabe sal_True, wenn das Objekt eine FormComponent ist (oder rekursiv nur aus solchen besteht)
public: public:
NavigatorTreeModel( const ImageList& _rNormalImages ); NavigatorTreeModel();
virtual ~NavigatorTreeModel() override; virtual ~NavigatorTreeModel() override;
void FillBranch( FmFormData* pParentData ); void FillBranch( FmFormData* pParentData );
@ -399,8 +387,6 @@ namespace svxform
SvLBoxEntrySortedArray m_arrCurrentSelection; SvLBoxEntrySortedArray m_arrCurrentSelection;
// the entries which, in the view, are currently marked as "cut" (painted semi-transparent) // the entries which, in the view, are currently marked as "cut" (painted semi-transparent)
ListBoxEntrySet m_aCutEntries; ListBoxEntrySet m_aCutEntries;
// die Images, die ich brauche (und an FormDatas und EntryDatas weiterreiche)
ImageList m_aNavigatorImages;
::svxform::OControlExchangeHelper m_aControlExchange; ::svxform::OControlExchangeHelper m_aControlExchange;