Kaydet (Commit) 2316fe0d authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

Template manager: no need to extract file type description

Change-Id: I18d01542f009a5c6c1f688a8df04c14d3c8edc9e
üst 35211d33
...@@ -20,7 +20,6 @@ struct TemplateItemProperties ...@@ -20,7 +20,6 @@ struct TemplateItemProperties
sal_uInt16 nRegionId; sal_uInt16 nRegionId;
rtl::OUString aName; rtl::OUString aName;
rtl::OUString aPath; rtl::OUString aPath;
rtl::OUString aType;
BitmapEx aThumbnail; BitmapEx aThumbnail;
}; };
......
...@@ -32,10 +32,6 @@ public: ...@@ -32,10 +32,6 @@ public:
const rtl::OUString& getKeywords () const { return maKeywords; } const rtl::OUString& getKeywords () const { return maKeywords; }
void setFileType (const rtl::OUString &rType) { maFileType = rType; }
const rtl::OUString& getFileType () const { return maFileType; }
void setSubTitle (const rtl::OUString &rTitle) { maSubTitle = rTitle; } void setSubTitle (const rtl::OUString &rTitle) { maSubTitle = rTitle; }
const rtl::OUString& getSubTitle () const { return maSubTitle; } const rtl::OUString& getSubTitle () const { return maSubTitle; }
...@@ -51,7 +47,6 @@ private: ...@@ -51,7 +47,6 @@ private:
rtl::OUString maPath; rtl::OUString maPath;
rtl::OUString maAuthor; rtl::OUString maAuthor;
rtl::OUString maKeywords; rtl::OUString maKeywords;
rtl::OUString maFileType;
rtl::OUString maSubTitle; rtl::OUString maSubTitle;
Point maSubTitlePos; Point maSubTitlePos;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <sfx2/templateview.hxx> #include <sfx2/templateview.hxx>
#include <sfx2/templateviewitem.hxx> #include <sfx2/templateviewitem.hxx>
#include <svl/inettype.hxx> #include <svl/inettype.hxx>
#include <svtools/imagemgr.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbstreamhelper.hxx>
#include <vcl/pngread.hxx> #include <vcl/pngread.hxx>
...@@ -122,7 +121,6 @@ void TemplateLocalView::Populate () ...@@ -122,7 +121,6 @@ void TemplateLocalView::Populate ()
{ {
OUString aName = mpDocTemplates->GetName(i,j); OUString aName = mpDocTemplates->GetName(i,j);
OUString aURL = mpDocTemplates->GetPath(i,j); OUString aURL = mpDocTemplates->GetPath(i,j);
OUString aType = SvFileInformationManager::GetDescription(INetURLObject(aURL));
if ((sal_uInt32)aName.getLength() > mpItemAttrs->nMaxTextLenght) if ((sal_uInt32)aName.getLength() > mpItemAttrs->nMaxTextLenght)
{ {
...@@ -136,7 +134,6 @@ void TemplateLocalView::Populate () ...@@ -136,7 +134,6 @@ void TemplateLocalView::Populate ()
aProperties.nRegionId = i; aProperties.nRegionId = i;
aProperties.aName = aName; aProperties.aName = aName;
aProperties.aPath = aURL; aProperties.aPath = aURL;
aProperties.aType = aType;
aProperties.aThumbnail = TemplateAbstractView::fetchThumbnail(aURL, aProperties.aThumbnail = TemplateAbstractView::fetchThumbnail(aURL,
TEMPLATE_THUMBNAIL_MAX_WIDTH, TEMPLATE_THUMBNAIL_MAX_WIDTH,
TEMPLATE_THUMBNAIL_MAX_HEIGHT); TEMPLATE_THUMBNAIL_MAX_HEIGHT);
...@@ -372,7 +369,6 @@ bool TemplateLocalView::moveTemplate (const ThumbnailViewItem *pItem, const sal_ ...@@ -372,7 +369,6 @@ bool TemplateLocalView::moveTemplate (const ThumbnailViewItem *pItem, const sal_
aTemplateItem.nRegionId = nTargetRegion; aTemplateItem.nRegionId = nTargetRegion;
aTemplateItem.aName = pViewItem->maTitle; aTemplateItem.aName = pViewItem->maTitle;
aTemplateItem.aPath = pViewItem->getPath(); aTemplateItem.aPath = pViewItem->getPath();
aTemplateItem.aType = pViewItem->getFileType();
aTemplateItem.aThumbnail = pViewItem->maPreview1; aTemplateItem.aThumbnail = pViewItem->maPreview1;
pTarget->maTemplates.push_back(aTemplateItem); pTarget->maTemplates.push_back(aTemplateItem);
...@@ -467,7 +463,6 @@ bool TemplateLocalView::moveTemplates(std::set<const ThumbnailViewItem *> &rItem ...@@ -467,7 +463,6 @@ bool TemplateLocalView::moveTemplates(std::set<const ThumbnailViewItem *> &rItem
aTemplateItem.nRegionId = nTargetRegion; aTemplateItem.nRegionId = nTargetRegion;
aTemplateItem.aName = pViewItem->maTitle; aTemplateItem.aName = pViewItem->maTitle;
aTemplateItem.aPath = pViewItem->getPath(); aTemplateItem.aPath = pViewItem->getPath();
aTemplateItem.aType = pViewItem->getFileType();
aTemplateItem.aThumbnail = pViewItem->maPreview1; aTemplateItem.aThumbnail = pViewItem->maPreview1;
pTarget->maTemplates.push_back(aTemplateItem); pTarget->maTemplates.push_back(aTemplateItem);
...@@ -541,7 +536,6 @@ bool TemplateLocalView::copyFrom(const sal_uInt16 nRegionItemId, const BitmapEx ...@@ -541,7 +536,6 @@ bool TemplateLocalView::copyFrom(const sal_uInt16 nRegionItemId, const BitmapEx
aTemplate.aName = aPath; aTemplate.aName = aPath;
aTemplate.aThumbnail = rThumbnail; aTemplate.aThumbnail = rThumbnail;
aTemplate.aPath = mpDocTemplates->GetPath(nRegionId,nDocId); aTemplate.aPath = mpDocTemplates->GetPath(nRegionId,nDocId);
aTemplate.aType = SvFileInformationManager::GetDescription(INetURLObject(aTemplate.aPath));
TemplateLocalViewItem *pItem = TemplateLocalViewItem *pItem =
static_cast<TemplateLocalViewItem*>(mItemList[i]); static_cast<TemplateLocalViewItem*>(mItemList[i]);
...@@ -584,7 +578,6 @@ bool TemplateLocalView::copyFrom (TemplateLocalViewItem *pItem, const OUString & ...@@ -584,7 +578,6 @@ bool TemplateLocalView::copyFrom (TemplateLocalViewItem *pItem, const OUString &
TEMPLATE_THUMBNAIL_MAX_WIDTH, TEMPLATE_THUMBNAIL_MAX_WIDTH,
TEMPLATE_THUMBNAIL_MAX_HEIGHT); TEMPLATE_THUMBNAIL_MAX_HEIGHT);
aTemplate.aPath = rPath; aTemplate.aPath = rPath;
aTemplate.aType = SvFileInformationManager::GetDescription(INetURLObject(rPath));
pItem->maTemplates.push_back(aTemplate); pItem->maTemplates.push_back(aTemplate);
......
...@@ -227,8 +227,6 @@ bool TemplateRemoteView::loadRepository (const sal_uInt16 nRepositoryId, bool bR ...@@ -227,8 +227,6 @@ bool TemplateRemoteView::loadRepository (const sal_uInt16 nRepositoryId, bool bR
{} {}
} }
aTemplateItem.aType = SvFileInformationManager::GetFileDescription(INetURLObject(sRealURL));
pItem->insertTemplate(aTemplateItem); pItem->insertTemplate(aTemplateItem);
aItems.push_back(aTemplateItem); aItems.push_back(aTemplateItem);
++nIdx; ++nIdx;
......
...@@ -126,7 +126,6 @@ void TemplateView::InsertItems (const std::vector<TemplateItemProperties> &rTemp ...@@ -126,7 +126,6 @@ void TemplateView::InsertItems (const std::vector<TemplateItemProperties> &rTemp
pItem->mnId = pCur->nId; pItem->mnId = pCur->nId;
pItem->maTitle = pCur->aName; pItem->maTitle = pCur->aName;
pItem->setPath(pCur->aPath); pItem->setPath(pCur->aPath);
pItem->setFileType(pCur->aType);
pItem->maPreview1 = pCur->aThumbnail; pItem->maPreview1 = pCur->aThumbnail;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected)); pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment