sfx2/inc/sfx2/templateabstractview.hxx | 13 + sfx2/inc/sfx2/templatelocalview.hxx | 2 sfx2/inc/sfx2/templateremoteview.hxx | 7 - sfx2/inc/sfx2/templateview.hxx | 22 --- sfx2/inc/sfx2/thumbnailview.hxx | 12 - sfx2/inc/sfx2/thumbnailviewitem.hxx | 1 sfx2/inc/templatedlg.hxx | 4 sfx2/source/control/templateabstractview.cxx | 19 ++ sfx2/source/control/templatelocalview.cxx | 27 ---- sfx2/source/control/templatelocalviewitem.cxx | 6 sfx2/source/control/templateremoteview.cxx | 27 ---- sfx2/source/control/templateview.cxx | 175 ++------------------------ sfx2/source/control/templateview.hrc | 4 sfx2/source/control/templateview.src | 22 ++- sfx2/source/control/templateviewitem.cxx | 6 sfx2/source/control/thumbnailview.cxx | 37 ----- sfx2/source/doc/templatedlg.cxx | 119 ++++++++--------- sfx2/source/doc/templatedlg.src | 1 svl/source/misc/inettype.cxx | 19 +- 19 files changed, 140 insertions(+), 383 deletions(-)
New commits: commit c69399e5a12cd4e63efc7280c8470b514ab2f453 Author: Cédric Bosdonnat <[email protected]> Date: Thu Dec 13 14:53:01 2012 +0100 Bad compareToIgnoreAsciiCaseAscii result comparison caused endless loop Change-Id: I6ef5aa87623a0d61942183b7eb888fc0f9cf6af0 diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 143a11a..d5f01f6 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -643,19 +643,14 @@ MediaTypeEntry const * seekEntry(OUString const & rTypeName, { sal_Size nMiddle = (nLow + nHigh) / 2; MediaTypeEntry const * pEntry = pMap + nMiddle; - switch (rTypeName.compareToIgnoreAsciiCaseAscii(pEntry->m_pTypeName)) - { - case COMPARE_LESS: - nHigh = nMiddle; - break; - - case COMPARE_EQUAL: - return pEntry; + sal_Int32 nCmp = rTypeName.compareToIgnoreAsciiCaseAscii(pEntry->m_pTypeName); + if (nCmp < 0) + nHigh = nMiddle; + else if (nCmp == 0) + return pEntry; - case COMPARE_GREATER: - nLow = nMiddle + 1; - break; - } + else + nLow = nMiddle + 1; } return 0; } commit bd6b9414e7914a50d24db5b37ebefb831eabec79 Author: Cédric Bosdonnat <[email protected]> Date: Thu Dec 13 14:29:52 2012 +0100 Template Manager: make it sizeable Change-Id: I14d3c73b714b9cbfefad7adcb02efb790c8a1e5b diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index d1e4b14..a86ced0 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -117,10 +117,10 @@ public: static BitmapEx fetchThumbnail (const OUString &msURL, long width, long height); -protected: - virtual void Resize(); +protected: + virtual void Paint( const Rectangle& rRect ); virtual void DrawItem (ThumbnailViewItem *pItem); diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 6d3a4c2..9548bd1 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -236,6 +236,8 @@ public: void setItemStateHdl (const Link &aLink) { maItemStateHdl = aLink; } + virtual void Resize(); + protected: virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -250,8 +252,6 @@ protected: virtual void LoseFocus(); - virtual void Resize(); - virtual void StateChanged( StateChangedType nStateChange ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx index f24c8e4..3f7ba13 100644 --- a/sfx2/inc/templatedlg.hxx +++ b/sfx2/inc/templatedlg.hxx @@ -52,6 +52,8 @@ private: virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void Resize (); + DECL_LINK(CloseOverlayHdl, void*); DECL_LINK(TBXViewHdl, void*); diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index ae9e958..b66c3c9 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -282,6 +282,7 @@ BitmapEx TemplateAbstractView::fetchThumbnail (const OUString &msURL, long width void TemplateAbstractView::Resize() { mpItemView->SetSizePixel(GetSizePixel()); + ThumbnailView::Resize(); } void TemplateAbstractView::Paint(const Rectangle &rRect) diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 1d0512e..3546826 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -122,32 +122,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) mpTemplateDefaultMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,DefaultTemplateMenuSelectHdl)); mpActionMenu->SetPopupMenu(MNI_ACTION_DEFAULT,mpTemplateDefaultMenu); - Size aWinSize = GetOutputSize(); - - // Fit the tab page control and the toolbars - Size aTabSize = maTabControl.GetSizePixel(); - Size aTabPageSize = maTabControl.GetTabPageSizePixel(); - Point aToolbarsPos(0, aTabSize.getHeight() - aTabPageSize.getHeight()); - mpToolbars->SetPosPixel(aToolbarsPos); - aTabPageSize.setHeight(mpToolbars->GetSizePixel().getHeight() + 3); - maTabControl.SetTabPageSizePixel(aTabPageSize); - - // Calculate toolboxs size and positions - Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel(); - Size aActionSize = mpActionBar->CalcMinimumWindowSizePixel(); - Size aTemplateSize = mpTemplateBar->CalcMinimumWindowSizePixel(); - - aActionSize.setWidth(3*aActionSize.getWidth()); - aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X()); - aTemplateSize.setWidth(aWinSize.getWidth()); - - Point aActionPos = mpActionBar->GetPosPixel(); - aActionPos.setX(aWinSize.getWidth() - aActionSize.getWidth()); - - mpViewBar->SetSizePixel(aViewSize); - mpActionBar->SetPosSizePixel(aActionPos,aActionSize); - mpTemplateBar->SetSizePixel(aTemplateSize); - // Set toolbox styles mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT); mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT); @@ -164,28 +138,10 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) mpActionBar->SetDropdownClickHdl(LINK(this,SfxTemplateManagerDlg,TBXDropdownHdl)); mpTemplateBar->SetClickHdl(LINK(this,SfxTemplateManagerDlg,TBXTemplateHdl)); mpTemplateBar->SetDropdownClickHdl(LINK(this,SfxTemplateManagerDlg,TBXDropdownHdl)); - - // Set view position below toolbox - Point aViewPos = maView->GetPosPixel(); - aViewPos.setY(maTabControl.GetPosPixel().Y() + maTabControl.GetSizePixel().getHeight()); - aViewPos.setX(0); - Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY()); - maView->SetPosSizePixel(aViewPos, aThumbSize); - - if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER) - aWinSize.setHeight(aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER); - - // Set search box position and size - Size aSearchSize = mpSearchEdit->CalcMinimumSize(); - aSearchSize.setWidth(aWinSize.getWidth() - 2*PADDING_DLG_BORDER); - - mpSearchEdit->SetSizePixel(aSearchSize); - mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aViewPos.Y())); mpSearchEdit->SetUpdateDataHdl(LINK(this,SfxTemplateManagerDlg,SearchUpdateHdl)); mpSearchEdit->EnableUpdateData(); maView->SetStyle(WB_VSCROLL); - maView->SetSizePixel(aThumbSize); maView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH); maView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, @@ -198,7 +154,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) maView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl)); // Set online view position and dimensions - mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize); mpOnlineView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH); mpOnlineView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, @@ -209,7 +164,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) mpOnlineView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl)); mpOnlineView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl)); - mpSearchView->SetSizePixel(aThumbSize); mpSearchView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH); mpSearchView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT, @@ -220,9 +174,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) maTabControl.SetActivatePageHdl(LINK(this,SfxTemplateManagerDlg,ActivatePageHdl)); - // Set dialog to correct dimensions - SetSizePixel(aWinSize); - mpViewBar->Show(); mpActionBar->Show(); @@ -316,6 +267,66 @@ void SfxTemplateManagerDlg::MouseButtonDown( const MouseEvent& rMEvt ) } } +void SfxTemplateManagerDlg::Resize() +{ + Size aWinSize = GetSizePixel(); + + // Fit the tab page control and the toolbars + Size aTabSize = maTabControl.GetSizePixel(); + aTabSize.setWidth(aWinSize.getWidth()); + maTabControl.SetSizePixel(aTabSize); + Size aTabPageSize = maTabControl.GetTabPageSizePixel(); + Point aToolbarsPos(0, aTabSize.getHeight() - aTabPageSize.getHeight()); + mpToolbars->SetPosPixel(aToolbarsPos); + aTabPageSize.setHeight(mpToolbars->GetSizePixel().getHeight() + 3); + maTabControl.SetTabPageSizePixel(aTabPageSize); + + Size aToolbarsSize = mpToolbars->GetSizePixel(); + aToolbarsSize.setWidth(aWinSize.getWidth()); + mpToolbars->SetSizePixel(aToolbarsSize); + + // Calculate toolboxes size and positions + Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel(); + Size aActionSize = mpActionBar->CalcMinimumWindowSizePixel(); + Size aTemplateSize = mpTemplateBar->CalcMinimumWindowSizePixel(); + + aActionSize.setWidth(3*aActionSize.getWidth()); + aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X()); + aTemplateSize.setWidth(aWinSize.getWidth()); + + Point aActionPos = mpActionBar->GetPosPixel(); + aActionPos.setX(aWinSize.getWidth() - aActionSize.getWidth()); + + mpViewBar->SetSizePixel(aViewSize); + mpActionBar->SetPosSizePixel(aActionPos,aActionSize); + mpTemplateBar->SetSizePixel(aTemplateSize); + + // Set view position below toolbox + Point aViewPos = maView->GetPosPixel(); + aViewPos.setY(maTabControl.GetPosPixel().Y() + maTabControl.GetSizePixel().getHeight()); + aViewPos.setX(0); + Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY()); + maView->SetPosSizePixel(aViewPos, aThumbSize); + + if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER) + aWinSize.setHeight(aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER); + + // Set search box position and size + Size aSearchSize = mpSearchEdit->CalcMinimumSize(); + aSearchSize.setWidth(aWinSize.getWidth() - 2*PADDING_DLG_BORDER); + + mpSearchEdit->SetSizePixel(aSearchSize); + mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aViewPos.Y())); + + maView->SetSizePixel(aThumbSize); + mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize); + mpSearchView->SetSizePixel(aThumbSize); + + mpCurView->Resize(); + + ModelessDialog::Resize(); +} + IMPL_LINK_NOARG(SfxTemplateManagerDlg, CloseOverlayHdl) { maSelTemplates.clear(); diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index a9ed10d..a9a844c 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -107,6 +107,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER SVLook = TRUE; Moveable = TRUE; Closeable = TRUE; + Resizeable = TRUE; Hide = TRUE; Size = MAP_APPFONT ( 290 , 250 ); Text [en-US] = "Template Manager"; commit bc785f9ce0a4f474801c7fbcd8a1c29114bc3858 Author: Cédric Bosdonnat <[email protected]> Date: Thu Dec 13 13:57:59 2012 +0100 Template manager: slightly smaller items to show more of them Change-Id: I43aa0655fb46729747829f7e6ef111efc8df90f7 diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 8dd3c28..d1e4b14 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -13,15 +13,14 @@ #include <sfx2/thumbnailview.hxx> //template thumbnail item defines -#define TEMPLATE_ITEM_MAX_WIDTH 192 +#define TEMPLATE_ITEM_MAX_WIDTH 160 #define TEMPLATE_ITEM_MAX_HEIGHT 160 #define TEMPLATE_ITEM_PADDING 5 -#define TEMPLATE_ITEM_SPACE 30 #define TEMPLATE_ITEM_MAX_TEXT_LENGTH 20 -#define TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT 128 +#define TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT 88 //template thumbnail image defines -#define TEMPLATE_THUMBNAIL_MAX_HEIGHT 128 - 2*TEMPLATE_ITEM_PADDING +#define TEMPLATE_THUMBNAIL_MAX_HEIGHT TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT - 2*TEMPLATE_ITEM_PADDING #define TEMPLATE_THUMBNAIL_MAX_WIDTH TEMPLATE_ITEM_MAX_WIDTH - 2*TEMPLATE_ITEM_PADDING class TemplateView; diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 6ebe23f..6d3a4c2 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -227,10 +227,6 @@ public: bool IsColor() const { return maColor.GetTransparency() == 0; } - Size CalcWindowSizePixel(sal_uInt16 nCalcCols, sal_uInt16 nCalcLines, - sal_uInt16 nItemWidth, sal_uInt16 nItemHeight, - sal_uInt16 nItemSpace); - long GetScrollWidth() const; void filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index db8d626..06942e5 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -945,23 +945,6 @@ bool ThumbnailView::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) return true; } -Size ThumbnailView::CalcWindowSizePixel (sal_uInt16 nCols, sal_uInt16 nLines, - sal_uInt16 nItemWidth, sal_uInt16 nItemHeight, - sal_uInt16 nItemSpace) -{ - Size aSize(nItemWidth*nCols, nItemHeight*nLines); - - aSize.Width() += nItemSpace*(nCols+1); - aSize.Height() += nItemSpace*(nLines+1); - - aSize.Height() += mnHeaderHeight; - - // sum possible ScrollBar width - aSize.Width() += GetScrollWidth(); - - return aSize; -} - long ThumbnailView::GetScrollWidth() const { if ( GetStyle() & WB_VSCROLL ) diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index e540b0d..1d0512e 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -51,9 +51,6 @@ #include "doc.hrc" #include "templatedlg.hrc" -#define INIT_FOLDER_COLS 3 -#define INIT_FOLDER_LINES 2 - #define PADDING_DLG_BORDER 10 using namespace ::com::sun::star; commit 5a508c2fc7441ee1f01b580493b32fc377c12503 Author: Cédric Bosdonnat <[email protected]> Date: Thu Dec 13 13:34:29 2012 +0100 Template Manager: add path controls to overlay and removed name editing Change-Id: I0d27edff4ba6c25fd9dc85c80ac5e3287fbd4207 diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx index 9a101f2..dac7fed 100644 --- a/sfx2/inc/sfx2/templatelocalview.hxx +++ b/sfx2/inc/sfx2/templatelocalview.hxx @@ -77,8 +77,6 @@ private: virtual void OnItemDblClicked (ThumbnailViewItem *pRegionItem); - DECL_LINK(ChangeNameHdl, TemplateView*); - private: bool mbFilteredResults; // Flag keep track if overlay has been filtered so folders can get filtered too afterwards diff --git a/sfx2/inc/sfx2/templateremoteview.hxx b/sfx2/inc/sfx2/templateremoteview.hxx index bbea147..1d7e49d 100644 --- a/sfx2/inc/sfx2/templateremoteview.hxx +++ b/sfx2/inc/sfx2/templateremoteview.hxx @@ -34,8 +34,6 @@ public: virtual void showOverlay (bool bVisible); - void setOverlayChangeNameHdl (const Link &rLink); - bool loadRepository (const sal_uInt16 nRepositoryId, bool bRefresh); const std::vector<TemplateRemoteViewItem*>& getRepositories () const { return maRepositories; } @@ -48,12 +46,7 @@ public: private: - DECL_LINK(ChangeNameHdl, TemplateView*); - -private: - bool mbIsSynced; - Link maChangeNameHdl; std::vector<TemplateRemoteViewItem*> maRepositories; com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv; }; diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx index 881c68d..6e81ea4 100644 --- a/sfx2/inc/sfx2/templateview.hxx +++ b/sfx2/inc/sfx2/templateview.hxx @@ -12,7 +12,8 @@ #include <sfx2/templateproperties.hxx> #include <sfx2/thumbnailview.hxx> -#include <vcl/image.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> class Edit; class TemplateViewItem; @@ -33,37 +34,26 @@ public: const OUString& getName () const { return maName; } - virtual void Paint (const Rectangle &rRect); - void InsertItems (const std::vector<TemplateItemProperties> &rTemplates); void setDblClickHdl (const Link &rLink) { maDblClickHdl = rLink; } - void setChangeNameHdl (const Link &rLink) { maChangeNameHdl = rLink; } - - void setCloseHdl (const Link &rLink) { maCloseHdl = rLink; } + void setCloseHdl (const Link &rLink) { maAllButton.SetClickHdl(rLink); } protected: virtual void Resize (); - virtual void MouseButtonDown (const MouseEvent &rMEvt); - virtual void OnItemDblClicked (ThumbnailViewItem *pItem); - DECL_LINK (ChangeNameHdl, void*); - private: - Image maCloseImg; - bool mbRenderTitle; + Control maButtons; + PushButton maAllButton; + FixedText maFTName; sal_uInt16 mnId; OUString maName; Link maDblClickHdl; - Link maChangeNameHdl; - Link maCloseHdl; - - Edit *mpEditName; }; #endif // TEMPLATEVIEW_HXX diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx index bbdcbda..f24c8e4 100644 --- a/sfx2/inc/templatedlg.hxx +++ b/sfx2/inc/templatedlg.hxx @@ -71,8 +71,6 @@ private: DECL_LINK(SearchUpdateHdl, void*); - DECL_LINK(RepositoryChangeNameHdl, void*); - void OnTemplateImport (); void OnTemplateSearch (); void OnTemplateEdit (); diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index ba0c1f2..749eaa0 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -89,7 +89,6 @@ TemplateLocalView::TemplateLocalView ( Window* pParent, const ResId& rResId, boo mpDocTemplates(new SfxDocumentTemplates) { mpItemView->SetColor(GetSettings().GetStyleSettings().GetFieldColor()); - mpItemView->setChangeNameHdl(LINK(this,TemplateLocalView,ChangeNameHdl)); } TemplateLocalView::~TemplateLocalView() @@ -690,29 +689,6 @@ void TemplateLocalView::OnItemDblClicked (ThumbnailViewItem *pRegionItem) showOverlay(true); } -IMPL_LINK(TemplateLocalView, ChangeNameHdl, TemplateView*, pView) -{ - sal_uInt16 nRegionId = pView->getId(); - sal_uInt16 nItemId = nRegionId + 1; - - if (!mpDocTemplates->SetName(pView->getName(),nRegionId,USHRT_MAX)) - return false; - - for (size_t i = 0; i < mItemList.size(); ++i) - { - if (mItemList[i]->mnId == nItemId) - { - mItemList[i]->maTitle = pView->getName(); - mItemList[i]->calculateItemsPosition(mnThumbnailHeight,mnDisplayHeight, - mnItemPadding,mpItemAttrs->nMaxTextLenght,mpItemAttrs); - Invalidate(); - break; - } - } - - return true; -} - static void lcl_updateThumbnails (TemplateLocalViewItem *pItem) { pItem->maPreview1.Clear(); diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx index 4f9f1e0..a04e471 100644 --- a/sfx2/source/control/templateremoteview.cxx +++ b/sfx2/source/control/templateremoteview.cxx @@ -50,7 +50,6 @@ TemplateRemoteView::TemplateRemoteView (Window *pParent, WinBits nWinStyle, bool , mbIsSynced(true) { mpItemView->SetColor(Color(COL_WHITE)); - mpItemView->setChangeNameHdl(LINK(this,TemplateRemoteView,ChangeNameHdl)); Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xGlobalInteractionHandler( @@ -110,11 +109,6 @@ void TemplateRemoteView::showOverlay (bool bVisible) } } -void TemplateRemoteView::setOverlayChangeNameHdl(const Link &rLink) -{ - maChangeNameHdl = rLink; -} - bool TemplateRemoteView::loadRepository (const sal_uInt16 nRepositoryId, bool bRefresh) { TemplateRemoteViewItem *pItem = NULL; @@ -312,25 +306,4 @@ void TemplateRemoteView::syncRepositories() const } } -IMPL_LINK (TemplateRemoteView, ChangeNameHdl, TemplateView*, pView) -{ - bool bRet = false; - - // check if there isnt another repository with the same name. - for (size_t i = 0, n = maRepositories.size(); i < n; ++i) - { - if (maRepositories[i]->mnId == pView->getId()) - { - maRepositories[i]->maTitle = pView->getName(); - - bRet = true; - mbIsSynced = false; - maChangeNameHdl.Call(this); - break; - } - } - - return bRet; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index 23f1095..2efbbda 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -24,7 +24,7 @@ #include "templateview.hrc" -#define EDIT_HEIGHT 20 +#define EDIT_HEIGHT 30 using namespace basegfx; using namespace basegfx::tools; @@ -33,75 +33,23 @@ using namespace drawinglayer::primitive2d; TemplateView::TemplateView (Window *pParent) : ThumbnailView(pParent,WB_VSCROLL), - maCloseImg(SfxResId(IMG_TEMPLATE_VIEW_CLOSE)), - mbRenderTitle(true), - mnId(0), - mpEditName(new Edit(this, WB_BORDER | WB_HIDE)) + maButtons(this, SfxResId(CONTROL_BUTTONS)), + maAllButton(&maButtons, SfxResId(BTN_ALL_TEMPLATES)), + maFTName(&maButtons, SfxResId(FT_NAME)), + mnId(0) { - mnHeaderHeight = 30; + mnHeaderHeight = maButtons.GetSizePixel().getHeight(); + maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON); } TemplateView::~TemplateView () { - delete mpEditName; } void TemplateView::setName (const OUString &rName) { maName = rName; - mpEditName->SetText(OUString()); -} - -void TemplateView::Paint (const Rectangle &rRect) -{ - ThumbnailView::Paint(rRect); - - int nCount = 0; - int nMaxCount = 1; - - if (mbRenderTitle) - ++nMaxCount; - - Primitive2DSequence aSeq(nMaxCount); - TextLayouterDevice aTextDev; - - // Draw centered region name - Point aPos; - Size aWinSize = GetOutputSizePixel(); - - if (mbRenderTitle) - { - aPos.X() = (aWinSize.getWidth() - aTextDev.getTextWidth(maName,0,maName.getLength()))/2; - aPos.Y() = aTextDev.getTextHeight() + (mnHeaderHeight - aTextDev.getTextHeight())/2; - - basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix( - mpItemAttrs->aFontSize.getX(), mpItemAttrs->aFontSize.getY(), - double( aPos.X() ), double( aPos.Y() ) ) ); - - aSeq[nCount++] = Primitive2DReference( - new TextSimplePortionPrimitive2D(aTextMatrix, - maName,0,maName.getLength(), - std::vector< double >( ), - mpItemAttrs->aFontAttr, - com::sun::star::lang::Locale(), - Color(COL_BLACK).getBColor() ) ); - } - - // Draw close icon - Size aImageSize = maCloseImg.GetSizePixel(); - - aPos.Y() = (mnHeaderHeight - aImageSize.Height())/2; - aPos.X() = aWinSize.Width() - aImageSize.Width() - aPos.Y(); - - aSeq[nCount] = Primitive2DReference( new FillBitmapPrimitive2D( - createTranslateB2DHomMatrix(aPos.X(),aPos.Y()), - FillBitmapAttribute(maCloseImg.GetBitmapEx(), - B2DPoint(0,0), - B2DVector(aImageSize.Width(),aImageSize.Height()), - false) - )); - - mpProcessor->process(aSeq); + maFTName.SetText(maName); } void TemplateView::InsertItems (const std::vector<TemplateItemProperties> &rTemplates) @@ -127,105 +75,26 @@ void TemplateView::InsertItems (const std::vector<TemplateItemProperties> &rTemp void TemplateView::Resize() { - // Set editbox size and position Size aWinSize = GetOutputSize(); - Size aEditSize(aWinSize.getWidth()/2,EDIT_HEIGHT); + // Set the buttons panel and buttons size + Size aPanelSize = maButtons.GetSizePixel(); + int nDeltaW = aWinSize.getWidth() - aPanelSize.getWidth(); + aPanelSize.setWidth(aWinSize.getWidth()); + maButtons.SetSizePixel(aPanelSize); - Point aPos; - aPos.X() = (aWinSize.getWidth() - aEditSize.getWidth())/2; - aPos.Y() = (mnHeaderHeight - aEditSize.getHeight())/2; - - mpEditName->SetPosSizePixel(aPos,aEditSize); + Size aNameSize = maFTName.GetSizePixel(); + aNameSize.setWidth(aNameSize.getWidth() + nDeltaW); + maFTName.SetSizePixel(aNameSize); ThumbnailView::Resize(); } -void TemplateView::MouseButtonDown (const MouseEvent &rMEvt) -{ - if (rMEvt.IsLeft()) - { - // Check if we are editing title - if (mpEditName->IsVisible()) - { - mpEditName->Show(false); - mbRenderTitle = true; - - // Update name if its not empty - OUString aTmp = mpEditName->GetText(); - - if (!aTmp.isEmpty()) - { - PostUserEvent(LINK(this,TemplateView,ChangeNameHdl)); - } - else - { - mpEditName->SetText(OUString()); - Invalidate(); - } - - return; - } - - Size aWinSize = GetOutputSizePixel(); - Size aImageSize = maCloseImg.GetSizePixel(); - - Point aPos; - aPos.Y() = (mnHeaderHeight - aImageSize.Height())/2; - aPos.X() = aWinSize.Width() - aImageSize.Width() - aPos.Y(); - - Rectangle aImgRect(aPos,aImageSize); - - if (aImgRect.IsInside(rMEvt.GetPosPixel())) - { - maCloseHdl.Call(this); - } - else - { - drawinglayer::primitive2d::TextLayouterDevice aTextDev; - aTextDev.setFontAttribute(mpItemAttrs->aFontAttr, - mpItemAttrs->aFontSize.getX(), mpItemAttrs->aFontSize.getY(), - com::sun::star::lang::Locale() ); - - float fTextWidth = aTextDev.getTextWidth(maName,0,maName.getLength()); - - aPos.X() = (aWinSize.getWidth() - fTextWidth)/2; - aPos.Y() = (mnHeaderHeight - aTextDev.getTextHeight())/2; - - Rectangle aTitleRect(aPos,Size(fTextWidth,aTextDev.getTextHeight())); - - if (aTitleRect.IsInside(rMEvt.GetPosPixel())) - { - mbRenderTitle = false; - - Invalidate(); - mpEditName->Show(); - } - } - } - - ThumbnailView::MouseButtonDown(rMEvt); -} - void TemplateView::OnItemDblClicked(ThumbnailViewItem *pItem) { maDblClickHdl.Call(pItem); } -IMPL_LINK_NOARG(TemplateView, ChangeNameHdl) -{ - OUString aTmp = maName; - maName = mpEditName->GetText(); - - if (!maChangeNameHdl.Call(this)) - maName = aTmp; - - mpEditName->SetText(OUString()); - - Invalidate(); - return 0; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templateview.hrc b/sfx2/source/control/templateview.hrc index dc496f2..e629c3f 100644 --- a/sfx2/source/control/templateview.hrc +++ b/sfx2/source/control/templateview.hrc @@ -6,4 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#define IMG_TEMPLATE_VIEW_CLOSE 256 +#define BTN_ALL_TEMPLATES 256 +#define CONTROL_BUTTONS 257 +#define FT_NAME 258 diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src index 8252ee9..d2711a7 100644 --- a/sfx2/source/control/templateview.src +++ b/sfx2/source/control/templateview.src @@ -8,10 +8,22 @@ #include "templateview.hrc" -Image IMG_TEMPLATE_VIEW_CLOSE +Control CONTROL_BUTTONS { - ImageBitmap = Bitmap - { - File = "closedoc.png"; - }; + Size = MAP_APPFONT( 290, 17 ); + Border = True; + TabStop = False; +}; + +PushButton BTN_ALL_TEMPLATES +{ + Pos = MAP_APPFONT( 1, 1 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "All Templates"; +}; + +FixedText FT_NAME +{ + Pos = MAP_APPFONT( 52, 3 ); + Size = MAP_APPFONT( 238, 12 ); }; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 548fdd9..e540b0d 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -211,7 +211,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) mpOnlineView->setOverlayItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl)); mpOnlineView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl)); mpOnlineView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl)); - mpOnlineView->setOverlayChangeNameHdl(LINK(this,SfxTemplateManagerDlg,RepositoryChangeNameHdl)); mpSearchView->SetSizePixel(aThumbSize); mpSearchView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH); @@ -715,12 +714,6 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, SearchUpdateHdl) return 0; } -IMPL_LINK_NOARG (SfxTemplateManagerDlg, RepositoryChangeNameHdl) -{ - createRepositoryMenu(); - return 0; -} - void SfxTemplateManagerDlg::OnTemplateImport () { sal_Int16 nDialogType = commit 3f1797cb5d3140fbf1c27c506146af048dfa4b3f Author: Cédric Bosdonnat <[email protected]> Date: Thu Dec 13 10:08:34 2012 +0100 Revert "Template Manager: better show the folder overlay." This reverts commit 7bebd970852a34c8421b499d06d75444c08221bc. diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 276b389..8dd3c28 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -122,6 +122,10 @@ protected: virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + + virtual void DrawItem (ThumbnailViewItem *pItem); + DECL_LINK(OverlayItemStateHdl, const ThumbnailViewItem*); protected: diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 935624b..6ebe23f 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -225,8 +225,6 @@ public: Color GetColor() const { return maColor; } - void SetTransparence( double nTransparence ); - bool IsColor() const { return maColor.GetTransparency() == 0; } Size CalcWindowSizePixel(sal_uInt16 nCalcCols, sal_uInt16 nCalcLines, @@ -306,7 +304,6 @@ protected: ScrollBar* mpScrBar; Rectangle maItemListRect; long mnHeaderHeight; - long mnFooterHeight; long mnItemWidth; long mnItemHeight; long mnItemPadding; @@ -324,7 +321,6 @@ protected: bool mbIsTransientChildrenDisabled : 1; bool mbHasVisibleItems : 1; Color maColor; - double mnTransparence; Link maItemStateHdl; ThumbnailItemAttributes *mpItemAttrs; diff --git a/sfx2/inc/sfx2/thumbnailviewitem.hxx b/sfx2/inc/sfx2/thumbnailviewitem.hxx index e454599..9609667 100644 --- a/sfx2/inc/sfx2/thumbnailviewitem.hxx +++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx @@ -53,7 +53,6 @@ struct ThumbnailItemAttributes { sal_uInt32 nMaxTextLenght; basegfx::BColor aFillColor; - double nFillTransparence; basegfx::BColor aHighlightColor; basegfx::B2DVector aFontSize; drawinglayer::attribute::FontAttribute aFontAttr; diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 22198f1..ae9e958 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -281,11 +281,19 @@ BitmapEx TemplateAbstractView::fetchThumbnail (const OUString &msURL, long width void TemplateAbstractView::Resize() { - Size aSize = GetSizePixel(); - aSize.setHeight(aSize.getHeight() * 0.5); - aSize.setWidth(aSize.getWidth() - 20); - Point aPos(10, 10); - mpItemView->SetPosSizePixel(aPos, aSize); + mpItemView->SetSizePixel(GetSizePixel()); +} + +void TemplateAbstractView::Paint(const Rectangle &rRect) +{ + if (!mpItemView->IsVisible()) + ThumbnailView::Paint(rRect); +} + +void TemplateAbstractView::DrawItem(ThumbnailViewItem *pItem) +{ + if (!mpItemView->IsVisible()) + ThumbnailView::DrawItem(pItem); } IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, pItem) diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index c5fb8a0..ba0c1f2 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -204,10 +204,7 @@ void TemplateLocalView::showOverlay (bool bVisible) } mpItemView->Clear(); - SetTransparence(0.0); } - else - SetTransparence(0.5); } void TemplateLocalView::filterTemplatesByApp (const FILTER_APPLICATION &eApp) diff --git a/sfx2/source/control/templatelocalviewitem.cxx b/sfx2/source/control/templatelocalviewitem.cxx index 025cf5f..54ba379 100644 --- a/sfx2/source/control/templatelocalviewitem.cxx +++ b/sfx2/source/control/templatelocalviewitem.cxx @@ -17,7 +17,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <sfx2/templateviewitem.hxx> #include <vcl/button.hxx> @@ -141,10 +140,7 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p com::sun::star::lang::Locale(), Color(COL_BLACK).getBColor() ) ); - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence)); - - pProcessor->process(aTranspSeq); + pProcessor->process(aSeq); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index ce31003..23f1095 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -11,8 +11,6 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/point/b2dpoint.hxx> -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/vector/b2dvector.hxx> #include <drawinglayer/attribute/fillbitmapattribute.hxx> @@ -20,11 +18,9 @@ #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> -#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <sfx2/sfxresid.hxx> #include <sfx2/templateviewitem.hxx> #include <vcl/edit.hxx> -#include <vcl/scrbar.hxx> #include "templateview.hrc" @@ -43,7 +39,6 @@ TemplateView::TemplateView (Window *pParent) mpEditName(new Edit(this, WB_BORDER | WB_HIDE)) { mnHeaderHeight = 30; - mnFooterHeight = 5; } TemplateView::~TemplateView () @@ -62,7 +57,7 @@ void TemplateView::Paint (const Rectangle &rRect) ThumbnailView::Paint(rRect); int nCount = 0; - int nMaxCount = 2; + int nMaxCount = 1; if (mbRenderTitle) ++nMaxCount; @@ -83,14 +78,11 @@ void TemplateView::Paint (const Rectangle &rRect) mpItemAttrs->aFontSize.getX(), mpItemAttrs->aFontSize.getY(), double( aPos.X() ), double( aPos.Y() ) ) ); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - B2DVector aFontSize; - FontAttribute aFontAttr = getFontAttributeFromVclFont(aFontSize, rStyleSettings.GetTitleFont(), false, false); aSeq[nCount++] = Primitive2DReference( new TextSimplePortionPrimitive2D(aTextMatrix, maName,0,maName.getLength(), std::vector< double >( ), - aFontAttr, + mpItemAttrs->aFontAttr, com::sun::star::lang::Locale(), Color(COL_BLACK).getBColor() ) ); } @@ -101,7 +93,7 @@ void TemplateView::Paint (const Rectangle &rRect) aPos.Y() = (mnHeaderHeight - aImageSize.Height())/2; aPos.X() = aWinSize.Width() - aImageSize.Width() - aPos.Y(); - aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D( + aSeq[nCount] = Primitive2DReference( new FillBitmapPrimitive2D( createTranslateB2DHomMatrix(aPos.X(),aPos.Y()), FillBitmapAttribute(maCloseImg.GetBitmapEx(), B2DPoint(0,0), @@ -109,10 +101,6 @@ void TemplateView::Paint (const Rectangle &rRect) false) )); - // TODO Draw some shadow - Rectangle aBounds(Point(0, 0), Size(aWinSize.getWidth() - 1, aWinSize.getHeight() - 1)); - B2DPolygon aBoundsPolygon(Polygon(aBounds, 5, 5).getB2DPolygon()); - aSeq[nCount] = Primitive2DReference( new PolyPolygonHairlinePrimitive2D(B2DPolyPolygon(aBoundsPolygon), Color(0,0,0).getBColor())); mpProcessor->process(aSeq); } diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index 1cb3d23..51a2862 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -17,7 +17,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <vcl/button.hxx> @@ -139,10 +138,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces Color(COL_BLACK).getBColor() ) ); } - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence)); - - pProcessor->process(aTranspSeq); + pProcessor->process(aSeq); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 0c0cec8..db8d626 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -24,7 +24,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/processorfromoutputdevice.hxx> #include <rtl/ustring.hxx> @@ -86,7 +85,6 @@ void ThumbnailView::ImplInit() { mpScrBar = NULL; mnHeaderHeight = 0; - mnFooterHeight = 0; mnItemWidth = 0; mnItemHeight = 0; mnItemPadding = 0; @@ -102,7 +100,6 @@ void ThumbnailView::ImplInit() mbHasVisibleItems = false; maFilterFunc = ViewFilterAll(); maColor = GetSettings().GetStyleSettings().GetFieldColor(); - mnTransparence = 0.0; // Create the processor and process the primitives const drawinglayer::geometry::ViewInformation2D aNewViewInfos; @@ -165,7 +162,6 @@ void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr mpItemAttrs = new ThumbnailItemAttributes; mpItemAttrs->aFillColor = maColor.getBColor(); - mpItemAttrs->nFillTransparence = mnTransparence; mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor(); mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize,GetFont(),false,true); mpItemAttrs->nMaxTextLenght = -1; @@ -377,7 +373,7 @@ void ThumbnailView::CalculateItemPositions () long nLines = (nCurCount+mnCols-1)/mnCols; Point aPos( aWinSize.Width() - nScrBarWidth - mnScrBarOffset, mnHeaderHeight ); - Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight - mnFooterHeight ); + Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight ); mpScrBar->SetPosSizePixel( aPos, aSize ); mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols); @@ -562,10 +558,7 @@ void ThumbnailView::Paint( const Rectangle &aRect) B2DPolyPolygon(Polygon(aRect,5,5).getB2DPolygon()), maColor.getBColor())); - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, mnTransparence)); - - mpProcessor->process(aTranspSeq); + mpProcessor->process(aSeq); // draw items for ( size_t i = 0; i < nItemCount; i++ ) @@ -916,15 +909,6 @@ void ThumbnailView::SetColor( const Color& rColor ) Invalidate(); } -void ThumbnailView::SetTransparence( double nTransparence ) -{ - mnTransparence = nTransparence; - mpItemAttrs->nFillTransparence = nTransparence; - - if ( IsReallyVisible() && IsUpdateMode() ) - Invalidate(); -} - bool ThumbnailView::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
