diff options
-rw-r--r-- | cui/source/options/optchart.cxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 29 | ||||
-rw-r--r-- | cui/source/tabpages/tpcolor.cxx | 19 | ||||
-rw-r--r-- | cui/source/tabpages/tpgradnt.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/tplnedef.cxx | 5 | ||||
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 11 | ||||
-rw-r--r-- | include/svx/dlgctrl.hxx | 28 | ||||
-rw-r--r-- | include/svx/xtable.hxx | 240 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 142 | ||||
-rw-r--r-- | svx/source/unodraw/XPropertyTable.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoctabl.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 22 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabbtmp.cxx | 13 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabcolr.cxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabdash.cxx | 6 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabgrdt.cxx | 6 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabhtch.cxx | 6 | ||||
-rw-r--r-- | svx/source/xoutdev/xtable.cxx | 98 | ||||
-rw-r--r-- | svx/source/xoutdev/xtablend.cxx | 6 |
22 files changed, 367 insertions, 301 deletions
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 06f25ef1ba2f..cf7d025c5e48 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -35,7 +35,7 @@ void ChartColorLB::FillBox( const SvxChartColorTable & rTab ) for( long i = 0; i < nCount; i++ ) { - Append( const_cast< XColorEntry * >( & rTab[ i ] )); + Append( rTab[ i ] ); } SetUpdateMode( sal_True ); } @@ -160,7 +160,7 @@ long SvxDefaultColorOptPage::GetColorIndex( const Color& rCol ) { pColorEntry = pColorList->GetColor( i ); if( pColorEntry && pColorEntry->GetColor() == rCol ) - return pColorList->Get( pColorEntry->GetName() ); + return pColorList->GetIndex( pColorEntry->GetName() ); } } return -1L; @@ -270,10 +270,9 @@ IMPL_LINK_NOARG(SvxDefaultColorOptPage, BoxClickedHdl) sal_uInt16 nIdx = aLbChartColors.GetSelectEntryPos(); if( nIdx != LISTBOX_ENTRY_NOTFOUND ) { - XColorEntry aEntry( aValSetColorBox.GetItemColor( aValSetColorBox.GetSelectItemId() ), - aLbChartColors.GetSelectEntry() ); + const XColorEntry aEntry( aValSetColorBox.GetItemColor( aValSetColorBox.GetSelectItemId() ), aLbChartColors.GetSelectEntry() ); - aLbChartColors.Modify( & aEntry, nIdx ); + aLbChartColors.Modify( aEntry, nIdx ); pColorConfig->ReplaceColorByIndex( nIdx, aEntry ); aLbChartColors.SelectEntryPos( nIdx ); // reselect entry diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 148cbd81d23d..1d516c44e536 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -528,6 +528,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl) if( pWarnBox->Execute() != RET_OK ) break; } + delete pDlg; delete pWarnBox; @@ -559,16 +560,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl) aLbBitmaps.Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 ); -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - //aLbBitmaps.Invalidate(); - } -#endif - *pnBitmapListState |= CT_MODIFIED; ChangeBitmapHdl_Impl( this ); @@ -649,6 +640,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl) if( pWarnBox->Execute() != RET_OK ) break; } + delete pDlg; delete pWarnBox; @@ -661,15 +653,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl) aLbBitmaps.Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 ); -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - } -#endif - *pnBitmapListState |= CT_MODIFIED; ChangeBitmapHdl_Impl( this ); @@ -723,15 +706,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl) if( bDifferent ) { bLoop = sal_False; - XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos ); - - pEntry->SetName( aName ); const BitmapEx aBitmapEx(aBitmapCtl.GetBitmapEx()); + const XBitmapEntry aEntry(Graphic(aBitmapEx), aName); - pEntry->SetGraphicObject(Graphic(aBitmapEx)); - - aLbBitmaps.Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos ); + aLbBitmaps.Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), aEntry, nPos ); aLbBitmaps.SelectEntryPos( nPos ); *pnBitmapListState |= CT_MODIFIED; diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 35352289bb87..5411f5a374b9 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -729,9 +729,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl) pColorList->Insert( pEntry, pColorList->Count() ); - m_pLbColor->Append( pEntry ); - m_pValSetColorList->InsertItem( m_pValSetColorList->GetItemCount() + 1, - pEntry->GetColor(), pEntry->GetName() ); + m_pLbColor->Append( *pEntry ); + m_pValSetColorList->InsertItem( m_pValSetColorList->GetItemCount() + 1, pEntry->GetColor(), pEntry->GetName() ); ImpColorCountChanged(); m_pLbColor->SelectEntryPos( m_pLbColor->GetEntryCount() - 1 ); @@ -796,20 +795,18 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl) // if not existing the entry is entered if( bDifferent ) { - XColorEntry* pEntry = pColorList->GetColor( nPos ); - Color aTmpColor (aAktuellColor); + if (eCM != CM_RGB) ConvertColorValues (aTmpColor, CM_RGB); - pEntry->SetColor( aTmpColor ); - pEntry->SetName( aName ); + const XColorEntry aEntry(aTmpColor, aName); - m_pLbColor->Modify( pEntry, nPos ); + m_pLbColor->Modify( aEntry, nPos ); m_pLbColor->SelectEntryPos( nPos ); - ///// - m_pValSetColorList->SetItemColor( nPos + 1, pEntry->GetColor() ); - m_pValSetColorList->SetItemText( nPos + 1, pEntry->GetName() ); + + m_pValSetColorList->SetItemColor( nPos + 1, aEntry.GetColor() ); + m_pValSetColorList->SetItemText( nPos + 1, aEntry.GetName() ); m_pEdtName->SetText( aName ); m_pCtlPreviewOld->Invalidate(); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 379803020d1b..db2b50799c85 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -481,7 +481,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl) pGradientList->Insert( pEntry, nCount ); - m_pLbGradients->Append( pEntry ); + m_pLbGradients->Append( *pEntry, pGradientList->GetUiBitmap( nCount ) ); m_pLbGradients->SelectEntryPos( m_pLbGradients->GetEntryCount() - 1 ); @@ -560,7 +560,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl) delete pGradientList->Replace( pEntry, nPos ); - m_pLbGradients->Modify( pEntry, nPos ); + m_pLbGradients->Modify( *pEntry, nPos, pGradientList->GetUiBitmap( nPos ) ); m_pLbGradients->SelectEntryPos( nPos ); diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index c386e368c9c4..2be33ae73dae 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -530,7 +530,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl) pHatchingList->Insert( pEntry, nCount ); - aLbHatchings.Append( pEntry ); + aLbHatchings.Append( *pEntry, pHatchingList->GetUiBitmap( nCount ) ); aLbHatchings.SelectEntryPos( aLbHatchings.GetEntryCount() - 1 ); @@ -603,7 +603,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl) delete pHatchingList->Replace( pEntry, nPos ); - aLbHatchings.Modify( pEntry, nPos ); + aLbHatchings.Modify( *pEntry, nPos, pHatchingList->GetUiBitmap( nPos ) ); aLbHatchings.SelectEntryPos( nPos ); diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 14ceb6bcf9a0..e58b7a91ad72 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -594,7 +594,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl) long nDashCount = pDashList->Count(); pDashList->Insert( pEntry, nDashCount ); const Bitmap aBitmap = pDashList->GetUiBitmap( nDashCount ); - aLbLineStyles.Append( pEntry, &aBitmap ); + aLbLineStyles.Append( *pEntry, pDashList->GetUiBitmap( nDashCount ) ); aLbLineStyles.SelectEntryPos( aLbLineStyles.GetEntryCount() - 1 ); @@ -672,8 +672,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl) XDashEntry* pEntry = new XDashEntry( aDash, aName ); delete pDashList->Replace( pEntry, nPos ); - const Bitmap aBitmap = pDashList->GetUiBitmap( nPos ); - aLbLineStyles.Modify( pEntry, nPos, &aBitmap ); + aLbLineStyles.Modify( *pEntry, nPos, pDashList->GetUiBitmap( nPos ) ); aLbLineStyles.SelectEntryPos( nPos ); diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 93ab7b026a4b..6756aec1840d 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -365,13 +365,13 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl) // if not existing, enter the entry if( bDifferent ) { - XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); + const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - pEntry->SetName( aName ); aEdtName.SetText( aName ); - const Bitmap aUiBitmap( pLineEndList->GetUiBitmap( nPos ) ); - aLbLineEnds.Modify( pEntry, nPos, &aUiBitmap ); + const XLineEndEntry aEntry(pEntry->GetLineEnd(), aName); + + aLbLineEnds.Modify( aEntry, nPos, pLineEndList->GetUiBitmap( nPos ) ); aLbLineEnds.SelectEntryPos( nPos ); *pnLineEndListState |= CT_MODIFIED; @@ -467,10 +467,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) long nLineEndCount = pLineEndList->Count(); pLineEndList->Insert( pEntry, nLineEndCount ); - const Bitmap aBitmap = pLineEndList->GetUiBitmap( nLineEndCount ); // add to the ListBox - aLbLineEnds.Append( pEntry, &aBitmap ); + aLbLineEnds.Append( *pEntry, pLineEndList->GetUiBitmap( nLineEndCount ) ); aLbLineEnds.SelectEntryPos( aLbLineEnds.GetEntryCount() - 1 ); *pnLineEndListState |= CT_MODIFIED; diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index a3c56cec39ec..d88d2e28e300 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -209,8 +209,8 @@ public: virtual void Fill( const XColorListRef &pTab ); - void Append( XColorEntry* pEntry, Bitmap* pBmp = NULL ); - void Modify( XColorEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL ); + void Append( const XColorEntry& rEntry ); + void Modify( const XColorEntry& rEntry, sal_uInt16 nPos ); }; /************************************************************************/ @@ -223,8 +223,8 @@ public: virtual void Fill( const XHatchListRef &pList ); - void Append( XHatchEntry* pEntry, Bitmap* pBmp = NULL ); - void Modify( XHatchEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL ); + void Append( const XHatchEntry& rEntry, const Bitmap& rBitmap ); + void Modify( const XHatchEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ); }; /************************************************************************/ @@ -238,8 +238,8 @@ public: virtual void Fill( const XGradientListRef &pList ); - void Append( XGradientEntry* pEntry, Bitmap* pBmp = NULL ); - void Modify( XGradientEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp = NULL ); + void Append( const XGradientEntry& rEntry, const Bitmap& rBitmap ); + void Modify( const XGradientEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ); void SelectEntryByList( const XGradientListRef &pList, const String& rStr, const XGradient& rXGradient, sal_uInt16 nDist = 0 ); }; @@ -253,8 +253,8 @@ public: virtual void Fill(const XBitmapListRef &pList); - void Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* pBmpEx = 0); - void Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16 nPos, BitmapEx* pBmpEx = 0); + void Append(const Size& rSize, const XBitmapEntry& rEntry); + void Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16 nPos); void SelectEntryByList(const XBitmapList* pList, const String& rStr); private: @@ -309,8 +309,8 @@ public: bool getAddStandardFields() const { return mbAddStandardFields; } void setAddStandardFields(bool bNew); - void Append(XDashEntry* pEntry, const Bitmap* pBmp = 0); - void Modify(XDashEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp = 0); + void Append(const XDashEntry& rEntry, const Bitmap& rBitmap ); + void Modify(const XDashEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ); void SelectEntryByList(const XDashList* pList, const String& rStr, const XDash& rDash, sal_uInt16 nDist = 0); }; @@ -324,12 +324,10 @@ public: LineEndLB( Window* pParent, WinBits aWB ); virtual ~LineEndLB (void); - virtual void Fill( const XLineEndListRef &pList, sal_Bool bStart = sal_True ); + virtual void Fill( const XLineEndListRef &pList, bool bStart = true ); - void Append( XLineEndEntry* pEntry, const Bitmap* pBmp = NULL, - sal_Bool bStart = sal_True ); - void Modify( XLineEndEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp = NULL, - sal_Bool bStart = sal_True ); + void Append( const XLineEndEntry& rEntry, const Bitmap& rBitmap, bool bStart = true ); + void Modify( const XLineEndEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap, bool bStart = true ); }; ////////////////////////////////////////////////////////////////////////////// diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 6f5a23aa388e..194547acbdd9 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -55,38 +55,33 @@ SVX_DLLPUBLIC Color RGB_Color( ColorData nColorName ); // class XColorEntry // ------------------ -class XColorEntry : public XPropertyEntry +class SVX_DLLPUBLIC XColorEntry : public XPropertyEntry { +private: Color aColor; public: - XColorEntry(const Color& rColor, const String& rName) - : XPropertyEntry(rName) - , aColor(rColor) - {} + XColorEntry(const Color& rColor, const String& rName); + XColorEntry(const XColorEntry& rOther); - void SetColor(const Color& rColor) { aColor = rColor; } - const Color& GetColor() const { return aColor; } + const Color& GetColor() const + { + return aColor; + } }; // -------------------- // class XLineEndEntry // -------------------- -class XLineEndEntry : public XPropertyEntry +class SVX_DLLPUBLIC XLineEndEntry : public XPropertyEntry { +private: basegfx::B2DPolyPolygon aB2DPolyPolygon; public: - XLineEndEntry(const basegfx::B2DPolyPolygon& rB2DPolyPolygon, const String& rName) - : XPropertyEntry(rName), - aB2DPolyPolygon(rB2DPolyPolygon) - {} - - void SetLineEnd(const basegfx::B2DPolyPolygon& rB2DPolyPolygon) - { - aB2DPolyPolygon = rB2DPolyPolygon; - } + XLineEndEntry(const basegfx::B2DPolyPolygon& rB2DPolyPolygon, const String& rName); + XLineEndEntry(const XLineEndEntry& rOther); const basegfx::B2DPolyPolygon& GetLineEnd() const { @@ -98,81 +93,76 @@ public: // class XDashEntry // ------------------ -class XDashEntry : public XPropertyEntry +class SVX_DLLPUBLIC XDashEntry : public XPropertyEntry { +private: XDash aDash; public: - XDashEntry(const XDash& rDash, const String& rName) : - XPropertyEntry(rName), aDash(rDash) {} + XDashEntry(const XDash& rDash, const String& rName); + XDashEntry(const XDashEntry& rOther); - void SetDash(const XDash& rDash) { aDash = rDash; } - const XDash& GetDash() const { return aDash; } + const XDash& GetDash() const + { + return aDash; + } }; // ------------------ // class XHatchEntry // ------------------ -class XHatchEntry : public XPropertyEntry +class SVX_DLLPUBLIC XHatchEntry : public XPropertyEntry { +private: XHatch aHatch; public: - XHatchEntry(const XHatch& rHatch, const String& rName) : - XPropertyEntry(rName), aHatch(rHatch) {} + XHatchEntry(const XHatch& rHatch, const String& rName); + XHatchEntry(const XHatchEntry& rOther); - void SetHatch(const XHatch& rHatch) { aHatch = rHatch; } - const XHatch& GetHatch() const { return aHatch; } + const XHatch& GetHatch() const + { + return aHatch; + } }; // --------------------- // class XGradientEntry // --------------------- -class XGradientEntry : public XPropertyEntry +class SVX_DLLPUBLIC XGradientEntry : public XPropertyEntry { +private: XGradient aGradient; public: - XGradientEntry(const XGradient& rGradient, const String& rName): - XPropertyEntry(rName), aGradient(rGradient) {} + XGradientEntry(const XGradient& rGradient, const String& rName); + XGradientEntry(const XGradientEntry& rOther); - void SetGradient(const XGradient& rGrad) { aGradient = rGrad; } - const XGradient& GetGradient() const { return aGradient; } + const XGradient& GetGradient() const + { + return aGradient; + } }; // --------------------- // class XBitmapEntry // --------------------- -class XBitmapEntry : public XPropertyEntry +class SVX_DLLPUBLIC XBitmapEntry : public XPropertyEntry { private: GraphicObject maGraphicObject; public: - XBitmapEntry(const GraphicObject& rGraphicObject, const String& rName) - : XPropertyEntry(rName), - maGraphicObject(rGraphicObject) - { - } - - XBitmapEntry(const XBitmapEntry& rOther) - : XPropertyEntry(rOther), - maGraphicObject(rOther.maGraphicObject) - { - } + XBitmapEntry(const GraphicObject& rGraphicObject, const String& rName); + XBitmapEntry(const XBitmapEntry& rOther); const GraphicObject& GetGraphicObject() const { return maGraphicObject; } - - void SetGraphicObject(const GraphicObject& rGraphicObject) - { - maGraphicObject = rGraphicObject; - } }; // -------------------- @@ -217,58 +207,59 @@ protected: bool mbListDirty; bool mbEmbedInDocument; - XPropertyList( XPropertyListType t, const String& rPath ); + XPropertyList(XPropertyListType t, const String& rPath); - virtual Bitmap CreateBitmapForUI( long nIndex ) = 0; + virtual Bitmap CreateBitmapForUI(long nIndex) = 0; public: - virtual ~XPropertyList(); - - XPropertyListType Type() const { return meType; } - long Count() const; - - void Insert( XPropertyEntry* pEntry, long nIndex = CONTAINER_APPEND ); - XPropertyEntry* Replace( XPropertyEntry* pEntry, long nIndex ); - XPropertyEntry* Remove( long nIndex ); - - // Note: Get(long) & Get( String& ) are ambiguous - XPropertyEntry* Get( long nIndex, sal_uInt16 nDummy ) const; - long Get(const String& rName); - Bitmap GetUiBitmap( long nIndex ) const; - - const String& GetName() const { return maName; } - void SetName( const String& rString ); - const String& GetPath() const { return maPath; } - void SetPath( const String& rString ) { maPath = rString; } - bool IsDirty() const { return mbListDirty; } - void SetDirty( bool bDirty = sal_True ) - { mbListDirty = bDirty; } - bool IsEmbedInDocument() const { return mbEmbedInDocument; } - void SetEmbedInDocument(bool b) { mbEmbedInDocument = b; } + virtual ~XPropertyList(); + + XPropertyListType Type() const { return meType; } + long Count() const; + + void Insert(XPropertyEntry* pEntry, long nIndex = CONTAINER_APPEND); + XPropertyEntry* Replace(XPropertyEntry* pEntry, long nIndex); + XPropertyEntry* Remove(long nIndex); + + XPropertyEntry* Get(long nIndex) const; + long GetIndex(const String& rName) const; + Bitmap GetUiBitmap(long nIndex) const; + + const String& GetName() const { return maName; } + void SetName(const String& rString); + + const String& GetPath() const { return maPath; } + void SetPath(const String& rString) { maPath = rString; } + + bool IsDirty() const { return mbListDirty; } + void SetDirty(bool bDirty = true) { mbListDirty = bDirty; } + + bool IsEmbedInDocument() const { return mbEmbedInDocument; } + void SetEmbedInDocument(bool b) { mbEmbedInDocument = b; } static OUString GetDefaultExt(XPropertyListType t); static OUString GetDefaultExtFilter(XPropertyListType t); - OUString GetDefaultExt() const { return GetDefaultExt( meType ); } + OUString GetDefaultExt() const { return GetDefaultExt(meType); } virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance() = 0; - bool Load(); - bool LoadFrom( const ::com::sun::star::uno::Reference< - ::com::sun::star::embed::XStorage > &xStorage, - const OUString &rURL ); - bool Save(); - bool SaveTo ( const ::com::sun::star::uno::Reference< - ::com::sun::star::embed::XStorage > &xStorage, - const OUString &rURL, - OUString *pOptName ); - virtual sal_Bool Create() = 0; + bool Load(); + bool LoadFrom(const ::com::sun::star::uno::Reference< + ::com::sun::star::embed::XStorage > &xStorage, + const OUString &rURL); + bool Save(); + bool SaveTo (const ::com::sun::star::uno::Reference< + ::com::sun::star::embed::XStorage > &xStorage, + const OUString &rURL, + OUString *pOptName); + virtual bool Create() = 0; // Factory method for sub-classes - static XPropertyListRef CreatePropertyList( XPropertyListType t, - const String& rPath ); + static XPropertyListRef CreatePropertyList(XPropertyListType t, + const String& rPath); // as above but initializes name as expected - static XPropertyListRef CreatePropertyListFromURL( XPropertyListType t, - const OUString & rUrl ); + static XPropertyListRef CreatePropertyListFromURL(XPropertyListType t, + const OUString & rUrl); // helper accessors inline XDashListRef AsDashList(); @@ -286,21 +277,20 @@ public: class SVX_DLLPUBLIC XColorList : public XPropertyList { protected: - virtual Bitmap CreateBitmapForUI( long nIndex ); + virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XColorList( const String& rPath ) - : XPropertyList( XCOLOR_LIST, rPath ) {} + explicit XColorList(const String& rPath) + : XPropertyList(XCOLOR_LIST, rPath) {} using XPropertyList::Replace; using XPropertyList::Remove; - using XPropertyList::Get; - XColorEntry* Replace(long nIndex, XColorEntry* pEntry ); - XColorEntry* Remove(long nIndex); - XColorEntry* GetColor(long nIndex) const; + XColorEntry* Replace(long nIndex, XColorEntry* pEntry); + XColorEntry* Remove(long nIndex); + XColorEntry* GetColor(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); static XColorListRef CreateStdColorList(); static XColorListRef GetStdColorList(); // returns a singleton @@ -309,7 +299,6 @@ public: // ------------------- // class XLineEndList // ------------------- -class impXLineEndList; class SVX_DLLPUBLIC XLineEndList : public XPropertyList { @@ -317,22 +306,20 @@ protected: virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XLineEndList( const String& rPath ); - virtual ~XLineEndList(); + explicit XLineEndList(const String& rPath); + virtual ~XLineEndList(); using XPropertyList::Remove; XLineEndEntry* Remove(long nIndex); - using XPropertyList::Get; XLineEndEntry* GetLineEnd(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); }; // ------------------- // class XDashList // ------------------- -class impXDashList; class SVX_DLLPUBLIC XDashList : public XPropertyList { @@ -346,18 +333,17 @@ protected: virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XDashList(const String& rPath); - virtual ~XDashList(); + explicit XDashList(const String& rPath); + virtual ~XDashList(); using XPropertyList::Replace; - XDashEntry* Replace(XDashEntry* pEntry, long nIndex); + XDashEntry* Replace(XDashEntry* pEntry, long nIndex); using XPropertyList::Remove; - XDashEntry* Remove(long nIndex); - using XPropertyList::Get; - XDashEntry* GetDash(long nIndex) const; + XDashEntry* Remove(long nIndex); + XDashEntry* GetDash(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); // Special call to get a bitmap for the solid line representation. It // creates a bitmap fitting in size and style to the ones you get by @@ -373,7 +359,6 @@ public: // ------------------- // class XHatchList // ------------------- -class impXHatchList; class SVX_DLLPUBLIC XHatchList : public XPropertyList { @@ -381,43 +366,39 @@ protected: virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XHatchList( const String& rPath ); + explicit XHatchList(const String& rPath); virtual ~XHatchList(); using XPropertyList::Replace; XHatchEntry* Replace(XHatchEntry* pEntry, long nIndex); using XPropertyList::Remove; XHatchEntry* Remove(long nIndex); - using XPropertyList::Get; XHatchEntry* GetHatch(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); }; // ------------------- // class XGradientList // ------------------- -class impXGradientList; - class SVX_DLLPUBLIC XGradientList : public XPropertyList { protected: virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XGradientList( const String& rPath ); - virtual ~XGradientList(); + explicit XGradientList(const String& rPath); + virtual ~XGradientList(); using XPropertyList::Replace; - XGradientEntry* Replace(XGradientEntry* pEntry, long nIndex); + XGradientEntry* Replace(XGradientEntry* pEntry, long nIndex); using XPropertyList::Remove; - XGradientEntry* Remove(long nIndex); - using XPropertyList::Get; - XGradientEntry* GetGradient(long nIndex) const; + XGradientEntry* Remove(long nIndex); + XGradientEntry* GetGradient(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); }; // ------------------- @@ -427,20 +408,19 @@ public: class SVX_DLLPUBLIC XBitmapList : public XPropertyList { protected: - virtual Bitmap CreateBitmapForUI( long nIndex ); + virtual Bitmap CreateBitmapForUI(long nIndex); public: - explicit XBitmapList( const String& rPath ) - : XPropertyList( XBITMAP_LIST, rPath ) {} + explicit XBitmapList(const String& rPath) + : XPropertyList(XBITMAP_LIST, rPath) {} using XPropertyList::Replace; using XPropertyList::Remove; - XBitmapEntry* Remove(long nIndex); - using XPropertyList::Get; - XBitmapEntry* GetBitmap(long nIndex) const; + XBitmapEntry* Remove(long nIndex); + XBitmapEntry* GetBitmap(long nIndex) const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createInstance(); - virtual sal_Bool Create(); + virtual bool Create(); }; diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index a653b2643c6b..18d5671b37f3 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -934,18 +934,18 @@ void ColorLB::Fill( const XColorListRef &pColorTab ) /************************************************************************/ -void ColorLB::Append( XColorEntry* pEntry, Bitmap* ) +void ColorLB::Append( const XColorEntry& rEntry ) { - InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + InsertEntry( rEntry.GetColor(), rEntry.GetName() ); AdaptDropDownLineCountToMaximum(); } /************************************************************************/ -void ColorLB::Modify( XColorEntry* pEntry, sal_uInt16 nPos, Bitmap* ) +void ColorLB::Modify( const XColorEntry& rEntry, sal_uInt16 nPos ) { RemoveEntry( nPos ); - InsertEntry( pEntry->GetColor(), pEntry->GetName(), nPos ); + InsertEntry( rEntry.GetColor(), rEntry.GetName(), nPos ); } // Fills the Listbox with color and strings @@ -1002,25 +1002,34 @@ void HatchingLB::Fill( const XHatchListRef &pList ) /************************************************************************/ -void HatchingLB::Append( XHatchEntry* pEntry, Bitmap* pBmp ) +void HatchingLB::Append( const XHatchEntry& rEntry, const Bitmap& rBitmap ) { - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp ); + if(!rBitmap.IsEmpty()) + { + InsertEntry( rEntry.GetName(), rBitmap ); + } else - InsertEntry( pEntry->GetName() ); + { + InsertEntry( rEntry.GetName() ); + } + AdaptDropDownLineCountToMaximum(); } /************************************************************************/ -void HatchingLB::Modify( XHatchEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp ) +void HatchingLB::Modify( const XHatchEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ) { RemoveEntry( nPos ); - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp, nPos ); + if( !rBitmap.IsEmpty() ) + { + InsertEntry( rEntry.GetName(), rBitmap, nPos ); + } else - InsertEntry( pEntry->GetName(), nPos ); + { + InsertEntry( rEntry.GetName(), nPos ); + } } // Fills the listbox (provisional) with strings @@ -1099,25 +1108,34 @@ void GradientLB::Fill( const XGradientListRef &pList ) /************************************************************************/ -void GradientLB::Append( XGradientEntry* pEntry, Bitmap* pBmp ) +void GradientLB::Append( const XGradientEntry& rEntry, const Bitmap& rBitmap ) { - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp ); + if(!rBitmap.IsEmpty()) + { + InsertEntry( rEntry.GetName(), rBitmap ); + } else - InsertEntry( pEntry->GetName() ); + { + InsertEntry( rEntry.GetName() ); + } + AdaptDropDownLineCountToMaximum(); } /************************************************************************/ -void GradientLB::Modify( XGradientEntry* pEntry, sal_uInt16 nPos, Bitmap* pBmp ) +void GradientLB::Modify( const XGradientEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ) { RemoveEntry( nPos ); - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp, nPos ); + if(!rBitmap.IsEmpty()) + { + InsertEntry( rEntry.GetName(), rBitmap, nPos ); + } else - InsertEntry( pEntry->GetName(), nPos ); + { + InsertEntry( rEntry.GetName(), nPos ); + } } /************************************************************************/ @@ -1261,11 +1279,12 @@ void BitmapLB::Fill( const XBitmapListRef &pList ) /************************************************************************/ -void BitmapLB::Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* pBmpEx) +void BitmapLB::Append(const Size& rSize, const XBitmapEntry& rEntry) { - if(pBmpEx) + maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); + + if(!maBitmapEx.IsEmpty()) { - maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); formatBitmapExToSize(maBitmapEx, rSize); InsertEntry(rEntry.GetName(), maBitmapEx); } @@ -1279,13 +1298,13 @@ void BitmapLB::Append(const Size& rSize, const XBitmapEntry& rEntry, BitmapEx* p /************************************************************************/ -void BitmapLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16 nPos, BitmapEx* pBmpEx) +void BitmapLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_uInt16 nPos) { RemoveEntry(nPos); + maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); - if(pBmpEx) + if(!maBitmapEx.IsEmpty()) { - maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); formatBitmapExToSize(maBitmapEx, rSize); InsertEntry(rEntry.GetName(), maBitmapEx, nPos); } @@ -1405,25 +1424,34 @@ void LineLB::Fill( const XDashListRef &pList ) /************************************************************************/ -void LineLB::Append( XDashEntry* pEntry, const Bitmap* pBmp ) +void LineLB::Append( const XDashEntry& rEntry, const Bitmap& rBitmap ) { - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp ); + if(!rBitmap.IsEmpty()) + { + InsertEntry( rEntry.GetName(), rBitmap ); + } else - InsertEntry( pEntry->GetName() ); + { + InsertEntry( rEntry.GetName() ); + } + AdaptDropDownLineCountToMaximum(); } /************************************************************************/ -void LineLB::Modify( XDashEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp ) +void LineLB::Modify( const XDashEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap ) { RemoveEntry( nPos ); - if( pBmp ) - InsertEntry( pEntry->GetName(), *pBmp, nPos ); + if(!rBitmap.IsEmpty()) + { + InsertEntry( rEntry.GetName(), rBitmap, nPos ); + } else - InsertEntry( pEntry->GetName(), nPos ); + { + InsertEntry( rEntry.GetName(), nPos ); + } } // Fills the listbox (provisional) with strings @@ -1444,7 +1472,7 @@ LineEndLB::~LineEndLB(void) { } -void LineEndLB::Fill( const XLineEndListRef &pList, sal_Bool bStart ) +void LineEndLB::Fill( const XLineEndListRef &pList, bool bStart ) { if( !pList.is() ) return; @@ -1478,43 +1506,49 @@ void LineEndLB::Fill( const XLineEndListRef &pList, sal_Bool bStart ) /************************************************************************/ -void LineEndLB::Append( XLineEndEntry* pEntry, const Bitmap* pBmp, sal_Bool bStart ) +void LineEndLB::Append( const XLineEndEntry& rEntry, const Bitmap& rBitmap, bool bStart ) { - if( pBmp ) + if(!rBitmap.IsEmpty()) { VirtualDevice aVD; - Size aBmpSize( pBmp->GetSizePixel() ); + const Size aBmpSize(rBitmap.GetSizePixel()); - aVD.SetOutputSizePixel( aBmpSize, sal_False ); - aVD.DrawBitmap( Point(), *pBmp ); - InsertEntry( pEntry->GetName(), - aVD.GetBitmap( bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ), - Size( aBmpSize.Width() / 2, aBmpSize.Height() ) ) ); + aVD.SetOutputSizePixel(aBmpSize, false); + aVD.DrawBitmap(Point(), rBitmap); + InsertEntry( + rEntry.GetName(), + aVD.GetBitmap(bStart ? Point() : Point(aBmpSize.Width() / 2, 0 ), Size(aBmpSize.Width() / 2, aBmpSize.Height()))); } else - InsertEntry( pEntry->GetName() ); + { + InsertEntry(rEntry.GetName()); + } + AdaptDropDownLineCountToMaximum(); } /************************************************************************/ -void LineEndLB::Modify( XLineEndEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp, sal_Bool bStart ) +void LineEndLB::Modify( const XLineEndEntry& rEntry, sal_uInt16 nPos, const Bitmap& rBitmap, bool bStart ) { RemoveEntry( nPos ); - if( pBmp ) + if(!rBitmap.IsEmpty()) { VirtualDevice aVD; - Size aBmpSize( pBmp->GetSizePixel() ); - - aVD.SetOutputSizePixel( aBmpSize, sal_False ); - aVD.DrawBitmap( Point(), *pBmp ); - InsertEntry( pEntry->GetName(), - aVD.GetBitmap( bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ), - Size( aBmpSize.Width() / 2, aBmpSize.Height() ) ), nPos ); + const Size aBmpSize(rBitmap.GetSizePixel()); + + aVD.SetOutputSizePixel(aBmpSize, false); + aVD.DrawBitmap(Point(), rBitmap); + InsertEntry( + rEntry.GetName(), + aVD.GetBitmap(bStart ? Point() : Point( aBmpSize.Width() / 2, 0 ), Size( aBmpSize.Width() / 2, aBmpSize.Height())), + nPos); } else - InsertEntry( pEntry->GetName(), nPos ); + { + InsertEntry(rEntry.GetName(), nPos); + } } ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index c9b9603fae67..ededdfd1eff3 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -87,7 +87,7 @@ SvxUnoXPropertyTable::~SvxUnoXPropertyTable() throw() XPropertyEntry* SvxUnoXPropertyTable::get( long index ) const { if( mpList ) - return mpList->Get( index, 0 ); + return mpList->Get(index); else return NULL; } diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index 605f09264b2e..82baea9440b2 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -135,7 +135,7 @@ void SAL_CALL SvxUnoColorTable::insertByName( const OUString& aName, const uno:: void SAL_CALL SvxUnoColorTable::removeByName( const OUString& Name ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - long nIndex = pList.is() ? pList->Get( Name ) : -1; + long nIndex = pList.is() ? pList->GetIndex( Name ) : -1; if( nIndex == -1 ) throw container::NoSuchElementException(); @@ -150,7 +150,7 @@ void SAL_CALL SvxUnoColorTable::replaceByName( const OUString& aName, const uno: if( !(aElement >>= nColor) ) throw lang::IllegalArgumentException(); - long nIndex = pList.is() ? pList->Get( aName ) : -1; + long nIndex = pList.is() ? pList->GetIndex( aName ) : -1; if( nIndex == -1 ) throw container::NoSuchElementException(); @@ -162,7 +162,7 @@ void SAL_CALL SvxUnoColorTable::replaceByName( const OUString& aName, const uno: uno::Any SAL_CALL SvxUnoColorTable::getByName( const OUString& aName ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - long nIndex = pList.is() ? pList->Get( aName ) : -1; + long nIndex = pList.is() ? pList->GetIndex( aName ) : -1; if( nIndex == -1 ) throw container::NoSuchElementException(); @@ -190,7 +190,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getElementNames() sal_Bool SAL_CALL SvxUnoColorTable::hasByName( const OUString& aName ) throw( uno::RuntimeException ) { - long nIndex = pList.is() ? pList->Get( aName ) : -1; + long nIndex = pList.is() ? pList->GetIndex( aName ) : -1; return nIndex != -1; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c5199e601049..dffbd73ea403 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1497,9 +1497,9 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN if( !pBitmapList.is() ) return sal_False; - long nPos = pBitmapList->Get(aStrName); + long nPos = pBitmapList->GetIndex(aStrName); if( nPos == -1 ) - return sal_False; + return false; XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos ); XFillBitmapItem aBmpItem; @@ -1516,9 +1516,9 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN if( !pGradientList.is() ) return sal_False; - long nPos = pGradientList->Get(aStrName); + long nPos = pGradientList->GetIndex(aStrName); if( nPos == -1 ) - return sal_False; + return false; XGradientEntry* pEntry = pGradientList->GetGradient( nPos ); XFillGradientItem aGrdItem; @@ -1535,9 +1535,9 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN if( !pHatchList.is() ) return sal_False; - long nPos = pHatchList->Get(aStrName); + long nPos = pHatchList->GetIndex(aStrName); if( nPos == -1 ) - return sal_False; + return false; XHatchEntry* pEntry = pHatchList->GetHatch( nPos ); XFillHatchItem aHatchItem; @@ -1555,9 +1555,9 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN if( !pLineEndList.is() ) return sal_False; - long nPos = pLineEndList->Get(aStrName); + long nPos = pLineEndList->GetIndex(aStrName); if( nPos == -1 ) - return sal_False; + return false; XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); if( XATTR_LINEEND == nWID ) @@ -1584,11 +1584,11 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN XDashListRef pDashList = pModel->GetDashList(); if( !pDashList.is() ) - return sal_False; + return false; - long nPos = pDashList->Get(aStrName); + long nPos = pDashList->GetIndex(aStrName); if( nPos == -1 ) - return sal_False; + return false; XDashEntry* pEntry = pDashList->GetDash( nPos ); XLineDashItem aDashItem; diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 2d26c8d22afa..f24d81282ce7 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -233,7 +233,7 @@ String NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uIn int nIndex; for( nIndex = 0; nIndex < nCount; nIndex++ ) { - XPropertyEntry* pEntry = pDefaults->Get( nIndex, 0 ); + XPropertyEntry* pEntry = pDefaults->Get(nIndex); if( pEntry ) { bool bFound = false; diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 462bae6b5036..3734e4a0d9e9 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -298,11 +298,11 @@ Bitmap createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, C { if(pArray[(a * 8) + b]) { - pContent->SetPixelIndex(b, a, 1); + pContent->SetPixelIndex(a, b, 1); } else { - pContent->SetPixelIndex(b, a, 0); + pContent->SetPixelIndex(a, b, 0); } } } diff --git a/svx/source/xoutdev/xtabbtmp.cxx b/svx/source/xoutdev/xtabbtmp.cxx index 328366a6c3ed..4cf5fd40e588 100644 --- a/svx/source/xoutdev/xtabbtmp.cxx +++ b/svx/source/xoutdev/xtabbtmp.cxx @@ -38,7 +38,7 @@ XBitmapEntry* XBitmapList::Remove(long nIndex) XBitmapEntry* XBitmapList::GetBitmap(long nIndex) const { - return (XBitmapEntry*) XPropertyList::Get(nIndex, 0); + return (XBitmapEntry*) XPropertyList::Get(nIndex); } uno::Reference< container::XNameContainer > XBitmapList::createInstance() @@ -47,17 +47,8 @@ uno::Reference< container::XNameContainer > XBitmapList::createInstance() SvxUnoXBitmapTable_createInstance( this ), uno::UNO_QUERY ); } -sal_Bool XBitmapList::Create() +bool XBitmapList::Create() { - //----------------------- - // 00 01 02 03 04 05 06 07 - // 08 09 10 11 12 13 14 15 - // 16 17 18 19 20 21 22 23 - // 24 25 26 27 28 29 30 31 - // 32 33 34 35 36 37 38 39 - // 40 41 42 43 44 45 46 47 - // 48 49 50 51 52 53 54 55 - // 56 57 58 59 60 61 62 63 String aStr(SVX_RES(RID_SVXSTR_BITMAP)); sal_uInt16 aArray[64]; Bitmap aBitmap; diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx index b4628c68d404..ef81ea84e91b 100644 --- a/svx/source/xoutdev/xtabcolr.cxx +++ b/svx/source/xoutdev/xtabcolr.cxx @@ -53,7 +53,7 @@ XColorEntry* XColorList::Remove(long nIndex) XColorEntry* XColorList::GetColor(long nIndex) const { - return (XColorEntry*) XPropertyList::Get(nIndex, 0); + return (XColorEntry*) XPropertyList::Get(nIndex); } uno::Reference< container::XNameContainer > XColorList::createInstance() @@ -63,7 +63,7 @@ uno::Reference< container::XNameContainer > XColorList::createInstance() uno::UNO_QUERY ); } -sal_Bool XColorList::Create() +bool XColorList::Create() { XubString aStr; xub_StrLen nLen; diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index 1c4d707fba68..93ada53f8d76 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -57,7 +57,7 @@ XDashEntry* XDashList::Remove(long nIndex) XDashEntry* XDashList::GetDash(long nIndex) const { - return (XDashEntry*) XPropertyList::Get(nIndex, 0); + return (XDashEntry*) XPropertyList::Get(nIndex); } uno::Reference< container::XNameContainer > XDashList::createInstance() @@ -66,7 +66,7 @@ uno::Reference< container::XNameContainer > XDashList::createInstance() SvxUnoXDashTable_createInstance( this ), uno::UNO_QUERY ); } -sal_Bool XDashList::Create() +bool XDashList::Create() { XubString aStr( SVX_RES( RID_SVXSTR_LINESTYLE ) ); xub_StrLen nLen; @@ -79,7 +79,7 @@ sal_Bool XDashList::Create() aStr.SetChar(nLen, sal_Unicode('3')); Insert(new XDashEntry(XDash(XDASH_RECT,2, 50,3,250,120),aStr)); - return sal_True; + return true; } Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 73ff6ad10647..559f66bbedf0 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -55,7 +55,7 @@ XGradientEntry* XGradientList::Remove(long nIndex) XGradientEntry* XGradientList::GetGradient(long nIndex) const { - return( (XGradientEntry*) XPropertyList::Get( nIndex, 0 ) ); + return( (XGradientEntry*) XPropertyList::Get( nIndex ) ); } uno::Reference< container::XNameContainer > XGradientList::createInstance() @@ -65,7 +65,7 @@ uno::Reference< container::XNameContainer > XGradientList::createInstance() uno::UNO_QUERY ); } -sal_Bool XGradientList::Create() +bool XGradientList::Create() { XubString aStr( SVX_RES( RID_SVXSTR_GRADIENT ) ); xub_StrLen nLen; @@ -84,7 +84,7 @@ sal_Bool XGradientList::Create() aStr.SetChar(nLen, sal_Unicode('6')); Insert(new XGradientEntry(XGradient(RGB_Color(COL_MAGENTA),RGB_Color(COL_YELLOW ),XGRAD_RECT , 1900,60,60,50,100,100),aStr)); - return( sal_True ); + return true; } Bitmap XGradientList::CreateBitmapForUI( long nIndex ) diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 72033e38ebda..8235cabe0ce7 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -55,7 +55,7 @@ XHatchEntry* XHatchList::Remove(long nIndex) XHatchEntry* XHatchList::GetHatch(long nIndex) const { - return (XHatchEntry*) XPropertyList::Get(nIndex, 0); + return (XHatchEntry*) XPropertyList::Get(nIndex); } uno::Reference< container::XNameContainer > XHatchList::createInstance() @@ -64,7 +64,7 @@ uno::Reference< container::XNameContainer > XHatchList::createInstance() SvxUnoXHatchTable_createInstance( this ), uno::UNO_QUERY ); } -sal_Bool XHatchList::Create() +bool XHatchList::Create() { XubString aStr( SVX_RES( RID_SVXSTR_HATCH ) ); xub_StrLen nLen; @@ -77,7 +77,7 @@ sal_Bool XHatchList::Create() aStr.SetChar(nLen, sal_Unicode('3')); Insert(new XHatchEntry(XHatch(RGB_Color(COL_BLUE ),XHATCH_TRIPLE,120, 0),aStr)); - return( sal_True ); + return true; } Bitmap XHatchList::CreateBitmapForUI( long nIndex ) diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 99278c5a72e1..5fd2d5e558e5 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -37,6 +37,96 @@ Color RGB_Color( ColorData nColorName ) return aRGBColor; } +////////////////////////////////////////////////////////////////////////////// +// class XColorEntry + +XColorEntry::XColorEntry(const Color& rColor, const String& rName) +: XPropertyEntry(rName), + aColor(rColor) +{ +} + +XColorEntry::XColorEntry(const XColorEntry& rOther) +: XPropertyEntry(rOther), +aColor(rOther.aColor) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// class XLineEndEntry + +XLineEndEntry::XLineEndEntry(const basegfx::B2DPolyPolygon& rB2DPolyPolygon, const String& rName) +: XPropertyEntry(rName), + aB2DPolyPolygon(rB2DPolyPolygon) +{ +} + +XLineEndEntry::XLineEndEntry(const XLineEndEntry& rOther) +: XPropertyEntry(rOther), + aB2DPolyPolygon(rOther.aB2DPolyPolygon) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// class XDashEntry + +XDashEntry::XDashEntry(const XDash& rDash, const String& rName) +: XPropertyEntry(rName), + aDash(rDash) +{ +} + +XDashEntry::XDashEntry(const XDashEntry& rOther) +: XPropertyEntry(rOther), +aDash(rOther.aDash) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// class XHatchEntry + +XHatchEntry::XHatchEntry(const XHatch& rHatch, const String& rName) +: XPropertyEntry(rName), + aHatch(rHatch) +{ +} + +XHatchEntry::XHatchEntry(const XHatchEntry& rOther) +: XPropertyEntry(rOther), + aHatch(rOther.aHatch) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// class XGradientEntry + +XGradientEntry::XGradientEntry(const XGradient& rGradient, const String& rName) +: XPropertyEntry(rName), + aGradient(rGradient) +{ +} + +XGradientEntry::XGradientEntry(const XGradientEntry& rOther) +: XPropertyEntry(rOther), + aGradient(rOther.aGradient) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// class XBitmapEntry + +XBitmapEntry::XBitmapEntry(const GraphicObject& rGraphicObject, const String& rName) +: XPropertyEntry(rName), + maGraphicObject(rGraphicObject) +{ +} + +XBitmapEntry::XBitmapEntry(const XBitmapEntry& rOther) +: XPropertyEntry(rOther), + maGraphicObject(rOther.maGraphicObject) +{ +} + // static int count = 0; XPropertyList::XPropertyList( @@ -70,7 +160,7 @@ long XPropertyList::Count() const return maList.size(); } -XPropertyEntry* XPropertyList::Get( long nIndex, sal_uInt16 /*nDummy*/) const +XPropertyEntry* XPropertyList::Get( long nIndex ) const { if( mbListDirty ) { @@ -80,12 +170,12 @@ XPropertyEntry* XPropertyList::Get( long nIndex, sal_uInt16 /*nDummy*/) const return ( (size_t)nIndex < maList.size() ) ? maList[ nIndex ] : NULL; } -long XPropertyList::Get(const XubString& rName) +long XPropertyList::GetIndex(const XubString& rName) const { if( mbListDirty ) { - if( !Load() ) - Create(); + if( !( (XPropertyList*) this )->Load() ) + ( (XPropertyList*) this )->Create(); } for( long i = 0, n = maList.size(); i < n; ++i ) { diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx index 4accd713b8f1..d5bc78960b5a 100644 --- a/svx/source/xoutdev/xtablend.cxx +++ b/svx/source/xoutdev/xtablend.cxx @@ -49,7 +49,7 @@ XLineEndEntry* XLineEndList::Remove(long nIndex) XLineEndEntry* XLineEndList::GetLineEnd(long nIndex) const { - return (XLineEndEntry*) XPropertyList::Get(nIndex, 0); + return (XLineEndEntry*) XPropertyList::Get(nIndex); } uno::Reference< container::XNameContainer > XLineEndList::createInstance() @@ -58,7 +58,7 @@ uno::Reference< container::XNameContainer > XLineEndList::createInstance() SvxUnoXLineEndTable_createInstance( this ), uno::UNO_QUERY ); } -sal_Bool XLineEndList::Create() +bool XLineEndList::Create() { basegfx::B2DPolygon aTriangle; aTriangle.append(basegfx::B2DPoint(10.0, 0.0)); @@ -78,7 +78,7 @@ sal_Bool XLineEndList::Create() basegfx::B2DPolygon aCircle(basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0.0, 0.0), 100.0)); Insert( new XLineEndEntry( basegfx::B2DPolyPolygon(aCircle), SVX_RESSTR( RID_SVXSTR_CIRCLE ) ) ); - return sal_True; + return true; } Bitmap XLineEndList::CreateBitmapForUI( long nIndex ) |