diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-12 08:21:20 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-13 12:06:30 +0100 |
commit | bad2196674764d67f19b276c1f6327dc3394e01a (patch) | |
tree | 8aaf3c4c05714f0474b4e8fb71e97a55ed6730fb /sfx2/source | |
parent | 6a23a02b2bd65a6c3db4beb7fc083528f0a006c5 (diff) |
Use shared methods instead of duplicated code
Change-Id: I42836dcd1ef3f95d90e6e8897efff9cab7cc23fd
Reviewed-on: https://gerrit.libreoffice.org/63276
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 9f11b03295bd..9199e25ba2e5 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -24,9 +24,11 @@ #include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> +#include <unotools/datetime.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/cmdoptions.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/xmlsechelper.hxx> #include <unotools/useroptions.hxx> #include <svtools/controldims.hxx> #include <svtools/imagemgr.hxx> @@ -703,42 +705,6 @@ void SfxDocumentDescPage::Reset(const SfxItemSet *rSet) } } -namespace -{ - OUString GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime ) - { - const LocaleDataWrapper& rWrapper( Application::GetSettings().GetLocaleDataWrapper() ); - - Date aDate( _nDate ); - tools::Time aTime( _nTime * tools::Time::nanoPerCenti ); - OUString aStr = rWrapper.getDate( aDate ) - + ", " - + rWrapper.getTime( aTime ); - return aStr; - } - - // copy from xmlsecurity/source/dialog/resourcemanager.cxx - OUString GetContentPart( const OUString& _rRawString, const OUString& _rPartId ) - { - OUString s; - - sal_Int32 nContStart = _rRawString.indexOf( _rPartId ); - if ( nContStart != -1 ) - { - nContStart = nContStart + _rPartId.getLength(); - ++nContStart; // now its start of content, directly after Id - - sal_Int32 nContEnd = _rRawString.indexOf( ',', nContStart ); - if (nContEnd != -1) - s = _rRawString.copy( nContStart, nContEnd - nContStart ); - else - s = _rRawString.copy(nContStart); - } - - return s; - } -} - SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& rItemSet) : SfxTabPage(pParent, "DocumentInfoPage", "sfx/ui/documentinfopage.ui", &rItemSet) , bEnableUseUserData( false ) @@ -888,9 +854,9 @@ void SfxDocumentPage::ImplUpdateSignatures() else if ( aInfos.getLength() == 1 ) { const security::DocumentSignatureInformation& rInfo = aInfos[ 0 ]; - s = GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime ); + s = utl::GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime ); s += ", "; - s += GetContentPart( rInfo.Signer->getSubjectName(), "CN" ); + s += comphelper::xmlsec::GetContentPart(rInfo.Signer->getSubjectName()); } m_pSignedValFt->SetText( s ); } |