basctl/source/basicide/moduldl2.cxx | 10 ++-- cui/source/customize/acccfg.cxx | 9 +--- cui/source/customize/cfg.cxx | 6 +- cui/source/customize/macropg.cxx | 4 - cui/source/dialogs/thesdlg.cxx | 4 - cui/source/dialogs/thesdlg_impl.hxx | 2 cui/source/options/optHeaderTabListbox.cxx | 6 +- cui/source/options/optlingu.cxx | 14 +++--- cui/source/tabpages/autocdlg.cxx | 8 +-- dbaccess/source/ui/app/AppDetailView.cxx | 37 +++++++---------- dbaccess/source/ui/app/AppDetailView.hxx | 2 dbaccess/source/ui/control/listviewitems.cxx | 4 - dbaccess/source/ui/inc/listviewitems.hxx | 2 dbaccess/source/ui/misc/WNameMatch.cxx | 4 - include/svtools/svlbitm.hxx | 8 +-- include/svtools/treelistbox.hxx | 6 +- include/svx/ctredlin.hxx | 2 include/svx/fontlb.hxx | 2 sc/source/ui/miscdlgs/solveroptions.cxx | 4 - sd/source/ui/animations/CustomAnimationList.cxx | 10 ++-- sfx2/source/dialog/templdlg.cxx | 7 --- svtools/source/contnr/svimpbox.cxx | 2 svtools/source/contnr/svlbitm.cxx | 24 ++++------- svtools/source/contnr/treelistbox.cxx | 52 ++++++++++++------------ svtools/source/uno/treecontrolpeer.cxx | 30 ++++--------- svx/source/dialog/ctredlin.cxx | 4 - svx/source/dialog/docrecovery.cxx | 4 - svx/source/dialog/fontlb.cxx | 4 - svx/source/form/filtnav.cxx | 12 ++--- svx/source/inc/docrecovery.hxx | 2 sw/source/uibase/inc/conttree.hxx | 2 sw/source/uibase/utlui/content.cxx | 10 ++-- sw/source/uibase/utlui/glbltree.cxx | 6 +- 33 files changed, 138 insertions(+), 165 deletions(-)
New commits: commit 88b104f44acff8087dfe3833bb91c63604ced98b Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jun 10 21:32:54 2015 +0100 coverity#1302618 deref of NULL on examination this PreparePaint virtual is only called from SvTreeListBox::PaintEntry1 and PaintEntry1 is only called from SvImpLBox::Paint in a for(sal_uInt16 n=0; n< nCount && pEntry; n++) { /*long nMaxRight=*/ pView->PaintEntry1 loop so pEntry always exists given that test. Re-jig things so these families of method take a reference instead of a pointer so verifying it cannot be NULL and a whole pile of else paths fall away Change-Id: Ied40acb1c2263c21b4447832f8cb86f64ed9e80d diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 822c065..8218920 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -114,19 +114,19 @@ public: SvLBoxString( pEntry, nFlags, rTxt ) {} virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void LibLBoxString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { // Change text color if library is read only: bool bReadOnly = false; - if (pEntry && pEntry->GetUserData()) + if (rEntry.GetUserData()) { - ScriptDocument aDocument(static_cast<LibUserData*>(pEntry->GetUserData())->GetDocument()); + ScriptDocument aDocument(static_cast<LibUserData*>(rEntry.GetUserData())->GetDocument()); - OUString aLibName = static_cast<const SvLBoxString*>(pEntry->GetItem(1))->GetText(); + OUString aLibName = static_cast<const SvLBoxString*>(rEntry.GetItem(1))->GetText(); Reference<script::XLibraryContainer2> xModLibContainer(aDocument.getLibraryContainer(E_SCRIPTS), UNO_QUERY); Reference<script::XLibraryContainer2 > xDlgLibContainer(aDocument.getLibraryContainer(E_DIALOGS), UNO_QUERY); bReadOnly = (xModLibContainer.is() && xModLibContainer->hasByName(aLibName) && xModLibContainer->isLibraryReadOnly(aLibName)) diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index b3511e9..b91f003 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -625,7 +625,7 @@ public: virtual ~SfxAccCfgLBoxString_Impl(); virtual void Paint(const Point& aPos, SvTreeListBox& rDevice, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; @@ -637,12 +637,9 @@ SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl() {} void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos, SvTreeListBox& /*rDevice*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - if (!pEntry) - return; - - TAccInfo* pUserData = static_cast<TAccInfo*>(pEntry->GetUserData()); + TAccInfo* pUserData = static_cast<TAccInfo*>(rEntry.GetUserData()); if (!pUserData) return; diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d472b7f..c013d6a 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1328,9 +1328,9 @@ public: virtual ~PopupPainter() { } virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE { - SvLBoxString::Paint(rPos, rOutDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rOutDev, rRenderContext, pView, rEntry); rRenderContext.Push(PushFlags::FILLCOLOR); @@ -1343,7 +1343,7 @@ public: nX -= pVScroll->GetSizePixel().Width(); } - const SvViewDataItem* pItem = rOutDev.GetViewDataItem( pEntry, this ); + const SvViewDataItem* pItem = rOutDev.GetViewDataItem( &rEntry, this ); nX -= pItem->maSize.Height(); long nSize = pItem->maSize.Height() / 2; diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 8697cf9..a57fb4b 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -452,7 +452,7 @@ public: IconLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& sText, Image* pMacroImg, Image* pComponentImg ); virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; @@ -467,7 +467,7 @@ IconLBoxString::IconLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, cons void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { OUString aTxt(GetText()); if (!aTxt.isEmpty()) diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index d6a3759..c346935 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -147,9 +147,9 @@ AlternativesString::AlternativesString( } void AlternativesString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - AlternativesExtraData* pData = m_rControlImpl.GetExtraData(pEntry); + AlternativesExtraData* pData = m_rControlImpl.GetExtraData(&rEntry); Point aPos(rPos); rRenderContext.Push(PushFlags::FONT); if (pData && pData->IsHeader()) diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx index 25b09f5..f302947 100644 --- a/cui/source/dialogs/thesdlg_impl.hxx +++ b/cui/source/dialogs/thesdlg_impl.hxx @@ -54,7 +54,7 @@ public: SvTreeListEntry* pEntry, sal_uInt16 nFlags, const OUString& rStr ); virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; #endif diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx index 404ef64..bba08c0 100644 --- a/cui/source/options/optHeaderTabListbox.cxx +++ b/cui/source/options/optHeaderTabListbox.cxx @@ -35,18 +35,18 @@ public: SvLBoxString( pEntry, nFlags, rTxt ) {} virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void OptLBoxString_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { rRenderContext.Push(PushFlags::FONT); vcl::Font aFont(rRenderContext.GetFont()); //detect readonly state by asking for a valid Image - if (pEntry && !(!SvTreeListBox::GetCollapsedEntryBmp(pEntry))) + if (!(!SvTreeListBox::GetCollapsedEntryBmp(&rEntry))) aFont.SetColor(Application::GetSettings().GetStyleSettings().GetDeactiveTextColor()); rRenderContext.SetFont(aFont); rRenderContext.DrawText(rPos, GetText()); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 4b285f5..7f42d50 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -264,13 +264,13 @@ public: const OUString& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {} virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void BrwStringDic_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - ModuleUserData_Impl* pData = static_cast<ModuleUserData_Impl*>(pEntry->GetUserData()); + ModuleUserData_Impl* pData = static_cast<ModuleUserData_Impl*>(rEntry.GetUserData()); Point aPos(rPos); rRenderContext.Push(PushFlags::FONT); if (pData->IsParent()) @@ -441,16 +441,16 @@ public: const OUString& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {} virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void BrwString_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { Point aPos(rPos); aPos.X() += 20; rRenderContext.DrawText(aPos, GetText()); - if (pEntry->GetUserData()) + if (rEntry.GetUserData()) { Point aNewPos(aPos); aNewPos.X() += rRenderContext.GetTextWidth(GetText()); @@ -459,7 +459,7 @@ void BrwString_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Rend aFont.SetWeight(WEIGHT_BOLD); //??? convert the lower byte from the user date into a string - OptionsUserData aData(reinterpret_cast<sal_uLong>(pEntry->GetUserData())); + OptionsUserData aData(reinterpret_cast<sal_uLong>(rEntry.GetUserData())); if (aData.HasNumericValue()) { OUStringBuffer sTxt; diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index b1fded4..ecd32b85 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -335,16 +335,16 @@ public: const OUString& rStr ) : SvLBoxString(pEntry,nFlags,rStr){} virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void OfaImpBrwString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { rRenderContext.DrawText(rPos, GetText()); - if (pEntry->GetUserData()) + if (rEntry.GetUserData()) { - ImpUserData* pUserData = static_cast<ImpUserData*>(pEntry->GetUserData()); + ImpUserData* pUserData = static_cast<ImpUserData*>(rEntry.GetUserData()); Point aNewPos(rPos); aNewPos.X() += rRenderContext.GetTextWidth(GetText()); vcl::Font aOldFont(rRenderContext.GetFont()); diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 7329b0b..df30a5e 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -100,34 +100,31 @@ void OCreationList::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _ rRenderContext.SetFont(m_aOriginalFont); } -void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry) +void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry& rEntry) { Wallpaper aEntryBackground(m_aOriginalBackgroundColor); - if (_pEntry) - { - if (_pEntry == GetCurEntry()) - { - // draw a selection background - bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry ); - vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, GetBoundingRect(_pEntry), - bIsMouseDownEntry ? 1 : 2, false, true, false ); - if (bIsMouseDownEntry) - { - vcl::Font aFont(rRenderContext.GetFont()); - aFont.SetColor(rRenderContext.GetSettings().GetStyleSettings().GetHighlightTextColor()); - rRenderContext.SetFont(aFont); - } + if (&rEntry == GetCurEntry()) + { + // draw a selection background + bool bIsMouseDownEntry = ( &rEntry == m_pMouseDownEntry ); + vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, GetBoundingRect(&rEntry), + bIsMouseDownEntry ? 1 : 2, false, true, false ); - // and temporary set a transparent background, for all the other - // paint operations the SvTreeListBox is going to do - aEntryBackground = Wallpaper(); - _pEntry->SetBackColor(Color(COL_TRANSPARENT)); + if (bIsMouseDownEntry) + { + vcl::Font aFont(rRenderContext.GetFont()); + aFont.SetColor(rRenderContext.GetSettings().GetStyleSettings().GetHighlightTextColor()); + rRenderContext.SetFont(aFont); } + + // and temporary set a transparent background, for all the other + // paint operations the SvTreeListBox is going to do + aEntryBackground = Wallpaper(); } rRenderContext.SetBackground(aEntryBackground); - _pEntry->SetBackColor(aEntryBackground.GetColor()); + rEntry.SetBackColor(aEntryBackground.GetColor()); } void OCreationList::SelectSearchEntry( const void* _pEntry ) diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 3b4286a..a429ff5 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -71,7 +71,7 @@ namespace dbaui void updateHelpText(); protected: - virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry) SAL_OVERRIDE; + virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual Rectangle GetFocusRect( SvTreeListEntry* _pEntry, long _nLine ) SAL_OVERRIDE; virtual void ModelHasCleared() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx index 3120d08..5f4d28d 100644 --- a/dbaccess/source/ui/control/listviewitems.cxx +++ b/dbaccess/source/ui/control/listviewitems.cxx @@ -45,7 +45,7 @@ namespace dbaui } void OBoldListboxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { if (m_bEmphasized) { @@ -59,7 +59,7 @@ namespace dbaui } else { - SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); } } diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx index 8703e34..d632d0d 100644 --- a/dbaccess/source/ui/inc/listviewitems.hxx +++ b/dbaccess/source/ui/inc/listviewitems.hxx @@ -42,7 +42,7 @@ namespace dbaui virtual sal_uInt16 GetType() const SAL_OVERRIDE; virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* _pViewData) SAL_OVERRIDE; bool isEmphasized() const { return m_bEmphasized; } diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 0b35a87..aa1ba97 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -350,11 +350,11 @@ public: } virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void OColumnString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { rRenderContext.Push(PushFlags::TEXTCOLOR | PushFlags::TEXTFILLCOLOR); if(m_bReadOnly) diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx index 479d5c0..5811b1a 100644 --- a/include/svtools/svlbitm.hxx +++ b/include/svtools/svlbitm.hxx @@ -131,7 +131,7 @@ public: virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; @@ -146,7 +146,7 @@ public: virtual sal_uInt16 GetType() const SAL_OVERRIDE; virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ) SAL_OVERRIDE; virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone( SvLBoxItem* pSource ) SAL_OVERRIDE; }; @@ -182,7 +182,7 @@ public: SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; @@ -269,7 +269,7 @@ public: SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index aaf6997..f0d112d 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -167,7 +167,7 @@ public: const Size& GetSize(const SvTreeListBox* pView, const SvTreeListEntry* pEntry) const; static const Size& GetSize(const SvViewDataEntry* pData, sal_uInt16 nItemPos); - virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) = 0; + virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) = 0; virtual void InitViewData(SvTreeListBox* pView, SvTreeListEntry* pEntry, // If != 0: this Pointer must be used! @@ -576,7 +576,7 @@ protected: SVT_DLLPRIVATE void AdjustEntryHeight( const vcl::Font& rFont ); SVT_DLLPRIVATE void ImpEntryInserted( SvTreeListEntry* pEntry ); - SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry*, long nLine, vcl::RenderContext& rRenderContext, + SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry&, long nLine, vcl::RenderContext& rRenderContext, SvLBoxTabFlags nTabFlagMask = SvLBoxTabFlags::ALL, bool bHasClipRegion=false ); @@ -617,7 +617,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; - virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* pEntry); + virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry& rEntry); virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; void InitSettings(bool bFont, bool bForeground, bool bBackground); diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index a5831d4..6c3cb91 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -78,7 +78,7 @@ public: The relevant text with the selected color is drawn in the output device. */ virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; SvLBoxItem* Create() const SAL_OVERRIDE; }; diff --git a/include/svx/fontlb.hxx b/include/svx/fontlb.hxx index c609d9f..d2485ac 100644 --- a/include/svx/fontlb.hxx +++ b/include/svx/fontlb.hxx @@ -52,7 +52,7 @@ public: /** Paints this entry to the specified position, using the own font settings. */ virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 0ccd11a0..4c38e68 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -73,11 +73,11 @@ public: void SetIntValue( sal_Int32 nNew ) { mbIsDouble = false; mnIntValue = nNew; } virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void ScSolverOptionsString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { //! move position? (SvxLinguTabPage: aPos.X() += 20) OUString aNormalStr(GetText()); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 90735cd..ff249d6 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -210,7 +210,7 @@ public: void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; virtual void Paint(const Point&, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView,const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView,const SvTreeListEntry& rEntry) SAL_OVERRIDE; private: VclPtr<CustomAnimationList> mpParent; OUString maDescription; @@ -241,10 +241,10 @@ void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvTreeLis } void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - const SvViewDataItem* pViewData = mpParent->GetViewDataItem(pEntry, this); + const SvViewDataItem* pViewData = mpParent->GetViewDataItem(&rEntry, this); Point aPos(rPos); Size aSize(pViewData->maSize); @@ -348,7 +348,7 @@ public: SvLBoxItem* Create() const SAL_OVERRIDE; void Clone( SvLBoxItem* pSource ) SAL_OVERRIDE; virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; private: OUString maDescription; @@ -375,7 +375,7 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvTree } void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { Size aSize(rRenderContext.GetOutputSizePixel().Width(), static_cast<SvTreeListBox*>(&rDev)->GetEntryHeight()); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 8da0870..aa0bcda 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -93,7 +93,7 @@ public: SvTreeListBox& rDevice, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual void InitViewData(SvTreeListBox* pView, SvTreeListEntry* pEntry, @@ -145,11 +145,8 @@ void StyleLBoxString::InitViewData(SvTreeListBox* pView, SvTreeListEntry* pEntry void StyleLBoxString::Paint( const Point& aPos, SvTreeListBox& /*rDevice*/, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& /*rEntry*/) { - if (!pEntry) - return; - bool bResult = false; if (mpStylePreviewRenderer) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 45f03f4..8771f04 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -944,7 +944,7 @@ void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect for(sal_uInt16 n=0; n< nCount && pEntry; n++) { /*long nMaxRight=*/ - pView->PaintEntry1(pEntry, nY, rRenderContext, SvLBoxTabFlags::ALL, true ); + pView->PaintEntry1(*pEntry, nY, rRenderContext, SvLBoxTabFlags::ALL, true ); nY += nEntryHeight; pEntry = pView->NextVisible(pEntry); } diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 2721d27..aa4e869 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -194,18 +194,12 @@ sal_uInt16 SvLBoxString::GetType() const void SvLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - if (pEntry) - { - DrawTextFlags nStyle = rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable; - if (rDev.IsEntryMnemonicsEnabled()) - nStyle |= DrawTextFlags::Mnemonic; - rRenderContext.DrawText(Rectangle(rPos, GetSize(&rDev, pEntry)), maText, nStyle); - } - else - rRenderContext.DrawText(rPos, maText); - + DrawTextFlags nStyle = rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable; + if (rDev.IsEntryMnemonicsEnabled()) + nStyle |= DrawTextFlags::Mnemonic; + rRenderContext.DrawText(Rectangle(rPos, GetSize(&rDev, &rEntry)), maText, nStyle); } SvLBoxItem* SvLBoxString::Create() const @@ -271,7 +265,7 @@ void SvLBoxBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, } void SvLBoxBmp::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { DrawImageFlags nStyle = rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; rRenderContext.DrawImage(rPos, aBmp ,nStyle); @@ -338,7 +332,7 @@ bool SvLBoxButton::ClickHdl( SvTreeListBox*, SvTreeListEntry* pEntry ) void SvLBoxButton::Paint( const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { SvBmp nIndex = eKind == SvLBoxButtonKind_staticImage ? SvBmp::STATICIMAGE : SvLBoxButtonData::GetIndex(nItemFlags); DrawImageFlags nStyle = eKind != SvLBoxButtonKind_disabledCheckbox && rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; @@ -506,13 +500,13 @@ void SvLBoxContextBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntr void SvLBoxContextBmp::Paint( const Point& _rPos, SvTreeListBox& _rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { // get the image. const Image& rImage = implGetImageStore(pView->IsExpanded() != m_pImpl->m_bExpanded); - bool _bSemiTransparent = pEntry && bool( SvTLEntryFlags::SEMITRANSPARENT & pEntry->GetFlags( ) ); + bool _bSemiTransparent = bool( SvTLEntryFlags::SEMITRANSPARENT & rEntry.GetFlags( ) ); // draw DrawImageFlags nStyle = _rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable; if (_bSemiTransparent) diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index afcd537..2730afe 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -2864,16 +2864,16 @@ void SvTreeListBox::InvalidateEntry(SvTreeListEntry* pEntry) } } -long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::RenderContext& rRenderContext, +long SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::RenderContext& rRenderContext, SvLBoxTabFlags nTabFlags, bool bHasClipRegion) { Rectangle aRect; // multi purpose bool bHorSBar = pImp->HasHorScrollBar(); - PreparePaint(rRenderContext, pEntry); + PreparePaint(rRenderContext, rEntry); - pImp->UpdateContextBmpWidthMax(pEntry); + pImp->UpdateContextBmpWidthMax(&rEntry); if (nTreeFlags & SvTreeFlags::RECALCTABS) SetTabs(); @@ -2895,7 +2895,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render Color aBackupColor = rRenderContext.GetFillColor(); bool bCurFontIsSel = false; - bool bInUse = pEntry->HasInUseEmphasis(); + bool bInUse = rEntry.HasInUseEmphasis(); // if a ClipRegion was set from outside, we don't have to reset it const WinBits nWindowStyle = GetStyle(); const bool bResetClipRegion = !bHasClipRegion; @@ -2914,10 +2914,10 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render bHasClipRegion = true; } - SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry ); + SvViewDataEntry* pViewDataEntry = GetViewDataEntry( &rEntry ); sal_uInt16 nTabCount = aTabs.size(); - sal_uInt16 nItemCount = pEntry->ItemCount(); + sal_uInt16 nItemCount = rEntry.ItemCount(); sal_uInt16 nCurTab = 0; sal_uInt16 nCurItem = 0; @@ -2926,15 +2926,15 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render SvLBoxTab* pTab = aTabs[nCurTab]; sal_uInt16 nNextTab = nCurTab + 1; SvLBoxTab* pNextTab = nNextTab < nTabCount ? aTabs[nNextTab] : 0; - SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0; + SvLBoxItem* pItem = nCurItem < nItemCount ? rEntry.GetItem(nCurItem) : 0; SvLBoxTabFlags nFlags = pTab->nFlags; Size aSize(SvLBoxItem::GetSize(pViewDataEntry, nCurItem)); - long nTabPos = GetTabPos(pEntry, pTab); + long nTabPos = GetTabPos(&rEntry, pTab); long nNextTabPos; if (pNextTab) - nNextTabPos = GetTabPos(pEntry, pNextTab); + nNextTabPos = GetTabPos(&rEntry, pNextTab); else { nNextTabPos = nMaxRight; @@ -3002,7 +3002,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render } else { - aWallpaper.SetColor(pEntry->GetBackColor()); + aWallpaper.SetColor(rEntry.GetBackColor()); } } @@ -3028,7 +3028,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render if (pNextTab) { long nRight; - nRight = GetTabPos(pEntry, pNextTab) - 1; + nRight = GetTabPos(&rEntry, pNextTab) - 1; if (nRight > nMaxRight) nRight = nMaxRight; aRect.Right() = nRight; @@ -3057,7 +3057,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render aEntryPos.Y() += (nTempEntryHeight - aSize.Height()) / 2; pViewDataEntry->SetPaintRectangle(aRect); - pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, pEntry); + pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry); // division line between tabs if (pNextTab && pItem->GetType() == SV_ITEM_ID_LBOXSTRING && @@ -3079,7 +3079,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render rRenderContext.SetFillColor(); Color aOldLineColor = rRenderContext.GetLineColor(); rRenderContext.SetLineColor(Color(COL_BLACK)); - aRect = GetFocusRect(pEntry, nLine); + aRect = GetFocusRect(&rEntry, nLine); aRect.Top()++; aRect.Bottom()--; rRenderContext.DrawRect(aRect); @@ -3095,15 +3095,15 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render sal_uInt16 nFirstDynTabPos; SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab(nFirstDynTabPos); - long nDynTabPos = GetTabPos(pEntry, pFirstDynamicTab); + long nDynTabPos = GetTabPos(&rEntry, pFirstDynamicTab); nDynTabPos += pImp->nNodeBmpTabDistance; nDynTabPos += pImp->nNodeBmpWidth / 2; nDynTabPos += 4; // 4 pixels of buffer, so the node bitmap is not too close // to the next tab - if( (!(pEntry->GetFlags() & SvTLEntryFlags::NO_NODEBMP)) && + if( (!(rEntry.GetFlags() & SvTLEntryFlags::NO_NODEBMP)) && (nWindowStyle & WB_HASBUTTONS) && pFirstDynamicTab && - (pEntry->HasChildren() || pEntry->HasChildrenOnDemand())) + (rEntry.HasChildren() || rEntry.HasChildrenOnDemand())) { // find first tab and check if the node bitmap extends into it sal_uInt16 nNextTab = nFirstDynTabPos; @@ -3114,21 +3114,21 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render pNextTab = nNextTab < nTabCount ? aTabs[nNextTab] : 0; } while (pNextTab && pNextTab->IsDynamic()); - if (!pNextTab || (GetTabPos( pEntry, pNextTab ) > nDynTabPos)) + if (!pNextTab || (GetTabPos( &rEntry, pNextTab ) > nDynTabPos)) { - if ((nWindowStyle & WB_HASBUTTONSATROOT) || pModel->GetDepth(pEntry) > 0) + if ((nWindowStyle & WB_HASBUTTONSATROOT) || pModel->GetDepth(&rEntry) > 0) { - Point aPos(GetTabPos(pEntry, pFirstDynamicTab), nLine); + Point aPos(GetTabPos(&rEntry, pFirstDynamicTab), nLine); aPos.X() += pImp->nNodeBmpTabDistance; const Image* pImg = 0; - if (IsExpanded(pEntry)) + if (IsExpanded(&rEntry)) pImg = &pImp->GetExpandedNodeBmp(); else { - if ((!pEntry->HasChildren()) && pEntry->HasChildrenOnDemand() && - (!(pEntry->GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) && + if ((!rEntry.HasChildren()) && rEntry.HasChildrenOnDemand() && + (!(rEntry.GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) && pImp->GetDontKnowNodeBmp().GetSizePixel().Width()) { pImg = &pImp->GetDontKnowNodeBmp( ); @@ -3155,12 +3155,12 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render if (IsEnabled()) nState |= ControlState::ENABLED; - if (IsExpanded(pEntry)) + if (IsExpanded(&rEntry)) aControlValue.setTristateVal(BUTTONVALUE_ON); //expanded node else { - if ((!pEntry->HasChildren()) && pEntry->HasChildrenOnDemand() && - (!(pEntry->GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) && + if ((!rEntry.HasChildren()) && rEntry.HasChildrenOnDemand() && + (!(rEntry.GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) && pImp->GetDontKnowNodeBmp().GetSizePixel().Width()) { aControlValue.setTristateVal( BUTTONVALUE_DONTKNOW ); //dont know @@ -3188,7 +3188,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render return 0; // nRowLen; } -void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeListEntry* /*pEntry*/) +void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeListEntry& /*rEntry*/) { } diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index fc65129..864cc56 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -116,7 +116,7 @@ public: OUString GetGraphicURL() const { return maGraphicURL;} void SetGraphicURL( const OUString& rGraphicURL ); virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; SvLBoxItem* Create() const SAL_OVERRIDE; void Clone( SvLBoxItem* pSource ) SAL_OVERRIDE; @@ -1593,30 +1593,18 @@ UnoTreeListItem::~UnoTreeListItem() void UnoTreeListItem::Paint( - const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { Point aPos(rPos); - if (pEntry) + Size aSize(GetSize(&rDev, &rEntry)); + if (!!maImage) { - Size aSize(GetSize(&rDev, pEntry)); - if (!!maImage) - { - rRenderContext.DrawImage(aPos, maImage, rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable); - int nWidth = maImage.GetSizePixel().Width() + 6; - aPos.X() += nWidth; - aSize.Width() -= nWidth; - } - rRenderContext.DrawText(Rectangle(aPos,aSize),maText, rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable); - } - else - { - if (!!maImage) - { - rRenderContext.DrawImage(aPos, maImage, rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable); - aPos.X() += maImage.GetSizePixel().Width() + 6; - } - rRenderContext.DrawText(aPos, maText); + rRenderContext.DrawImage(aPos, maImage, rDev.IsEnabled() ? DrawImageFlags::NONE : DrawImageFlags::Disable); + int nWidth = maImage.GetSizePixel().Width() + 6; + aPos.X() += nWidth; + aSize.Width() -= nWidth; } + rRenderContext.DrawText(Rectangle(aPos,aSize),maText, rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable); } diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 457bfdd..1f05706 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -80,14 +80,14 @@ SvLBoxItem* SvLBoxColorString::Create() const } void SvLBoxColorString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { Color aColor = rRenderContext.GetTextColor(); if (!pView->IsSelected()) { rRenderContext.SetTextColor(aPrivColor); } - SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); rRenderContext.SetTextColor(aColor); } diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 69b0f0b..ab68137 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -768,13 +768,13 @@ RecovDocListEntry::RecovDocListEntry( SvTreeListEntry* pEntry, void RecovDocListEntry::Paint(const Point& aPos, SvTreeListBox& aDevice, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { const Image* pImg = 0; const OUString* pTxt = 0; RecovDocList* pList = static_cast<RecovDocList*>(&aDevice); - TURLInfo* pInfo = static_cast<TURLInfo*>(pEntry->GetUserData()); + TURLInfo* pInfo = static_cast<TURLInfo*>(rEntry.GetUserData()); switch (pInfo->RecoveryState) { case E_SUCCESSFULLY_RECOVERED: diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index 22720ac..11eab21 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -52,7 +52,7 @@ SvLBoxItem* SvLBoxFontString::Create() const } void SvLBoxFontString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { rRenderContext.Push(PushFlags::FONT); vcl::Font aNewFont(maFont); @@ -64,7 +64,7 @@ void SvLBoxFontString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Render } rRenderContext.SetFont(aNewFont); - SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); rRenderContext.Pop(); } diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 3800cb6..8e035bb 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1015,16 +1015,16 @@ public: :SvLBoxString(pEntry,nFlags,rStr){} virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* pViewData) SAL_OVERRIDE; }; const int nxDBmp = 12; void FmFilterItemsString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - FmFilterItems* pRow = static_cast<FmFilterItems*>(pEntry->GetUserData()); + FmFilterItems* pRow = static_cast<FmFilterItems*>(rEntry.GetUserData()); FmFormItem* pForm = static_cast<FmFormItem*>(pRow->GetParent()); // current filter is significant painted @@ -1034,7 +1034,7 @@ void FmFilterItemsString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Ren rRenderContext.Push(PushFlags::LINECOLOR); rRenderContext.SetLineColor(rRenderContext.GetTextColor()); - Rectangle aRect(rPos, GetSize(&rDev, pEntry)); + Rectangle aRect(rPos, GetSize(&rDev, &rEntry)); Point aFirst(rPos.X(), aRect.Bottom() - 6); Point aSecond(aFirst .X() + 2, aFirst.Y() + 3); @@ -1076,7 +1076,7 @@ public: } virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* pViewData) SAL_OVERRIDE; }; @@ -1101,7 +1101,7 @@ void FmFilterString::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, void FmFilterString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { rRenderContext.Push(PushFlags::FONT); vcl::Font aFont(rRenderContext.GetFont()); diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index 1df6a1d..47c4258 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -455,7 +455,7 @@ public: /** @short TODO */ virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 48bf91f..607c8c1 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -217,7 +217,7 @@ public: } virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; namespace sfx2 { class DocumentInserter; } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ff8c62c..ad307b8 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3453,7 +3453,7 @@ public: const OUString& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} virtual void Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; }; void SwContentTree::InitEntry(SvTreeListEntry* pEntry, @@ -3468,9 +3468,9 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry, } void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { - if (lcl_IsContent(pEntry) && static_cast<SwContent *>(pEntry->GetUserData())->IsInvisible()) + if (lcl_IsContent(&rEntry) && static_cast<SwContent *>(rEntry.GetUserData())->IsInvisible()) { vcl::Font aOldFont(rRenderContext.GetFont()); vcl::Font aFont(aOldFont); @@ -3482,7 +3482,7 @@ void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Ren } // IA2 CWS. MT: Removed for now (also in SvLBoxEntry) - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this /* - else if (pEntry->IsMarked()) + else if (rEntry.IsMarked()) { rDev.DrawText( rPos, GetText() ); XubString str; @@ -3499,7 +3499,7 @@ void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::Ren } */ else - SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); } void SwContentTree::DataChanged(const DataChangedEvent& rDCEvt) diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index a5fd19a..42131fa 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -1238,9 +1238,9 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry, } void SwLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) { - SwGlblDocContent* pCont = static_cast<SwGlblDocContent*>(pEntry->GetUserData()); + SwGlblDocContent* pCont = static_cast<SwGlblDocContent*>(rEntry.GetUserData()); if (pCont->GetType() == GLBLDOC_SECTION && !(pCont->GetSection())->IsConnectFlag()) { @@ -1254,7 +1254,7 @@ void SwLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderCont rRenderContext.Pop(); } else - SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, pEntry); + SvLBoxString::Paint(rPos, rDev, rRenderContext, pView, rEntry); } void SwGlobalTree::DataChanged( const DataChangedEvent& rDCEvt )
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits