summaryrefslogtreecommitdiff
path: root/svx/source/gallery2
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2020-08-27 15:25:31 +0530
committerTomaž Vajngerl <quikee@gmail.com>2020-09-04 11:27:39 +0200
commit6b2eff7d69c6e14d89dd33eaa58c01d82c541266 (patch)
treef071c1088f0129ea518220513a2621945519982b /svx/source/gallery2
parent6ccd883409e4799aa334bbe1047f42c795c9457b (diff)
svx: Refactor GalleryBrowser1::ImplFillExchangeData
Introduce GalleryTheme::getModificationDate() Change-Id: I1ca34482ee5f0007a1d698e345e399ac3de31a51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101495 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r--svx/source/gallery2/galbrws1.cxx6
-rw-r--r--svx/source/gallery2/galtheme.cxx14
2 files changed, 15 insertions, 5 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 366bcecbd92d..3ac8bd8ff46b 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -111,12 +111,8 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa
try
{
- ::ucbhelper::Content aCnt( pThm->GetThmURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
- util::DateTime aDateTimeModified;
- DateTime aDateTime( DateTime::EMPTY );
+ DateTime aDateTime(pThm->getModificationDate());
- aCnt.getPropertyValue("DateModified") >>= aDateTimeModified;
- ::utl::typeConvert( aDateTimeModified, aDateTime );
rData.aThemeChangeDate = aDateTime;
rData.aThemeChangeTime = aDateTime;
}
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index cd503a4c11d7..69f8f4f7557c 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -31,6 +31,8 @@
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <tools/vcompat.hxx>
+#include <tools/datetime.hxx>
+#include <unotools/datetime.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/tempfile.hxx>
@@ -650,6 +652,18 @@ void GalleryTheme::CopyToClipboard(sal_uInt32 nPos)
pTransferable->CopyToClipboard(GetSystemClipboard());
}
+DateTime GalleryTheme::getModificationDate() const
+{
+ ::ucbhelper::Content aCnt(mpGalleryStorageEngine->GetThmURL().GetMainURL(INetURLObject::DecodeMechanism::NONE), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext());
+ util::DateTime aDateTimeModified;
+ DateTime aDateTime(DateTime::EMPTY);
+
+ aCnt.getPropertyValue("DateModified") >>= aDateTimeModified;
+ ::utl::typeConvert(aDateTimeModified, aDateTime);
+
+ return aDateTime;
+}
+
SvStream& GalleryTheme::ReadData( SvStream& rIStm )
{
sal_uInt32 nCount;