Kaydet (Commit) fc57915d authored tarafından Mihai Varga's avatar Mihai Varga Kaydeden (comit) Bosdonnat Cedric

Some properties in File->Properties->General Tab are not set for remote docs

This patch handles the case in which no meta information could be extracted from
the file, so CMIS properties are displayed instead, if it is a CMIS document.
Size and creation/modification dates are handled here.

Change-Id: I97f920172b15a76297d78a33ac3a07a8333ef8a6
Reviewed-on: https://gerrit.libreoffice.org/10511Reviewed-by: 's avatarBosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: 's avatarBosdonnat Cedric <cedric.bosdonnat@free.fr>
üst fb6e0da4
...@@ -1098,6 +1098,55 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) ...@@ -1098,6 +1098,55 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
m_pInfoItem->getEditingCycles() ) ); m_pInfoItem->getEditingCycles() ) );
} }
// Check for cmis properties where otherwise unavailable
if ( m_pInfoItem->isCmisDocument( ) )
{
uno::Sequence< document::CmisProperty > aCmisProps = m_pInfoItem->GetCmisProperties();
for ( sal_Int32 i = 0; i < aCmisProps.getLength(); i++ )
{
if ( aCmisProps[i].Id == "cmis:contentStreamLength" &&
aSizeText == m_aUnknownSize )
{
Sequence< sal_Int64 > seqValue;
aCmisProps[i].Value >>= seqValue;
SvNumberFormatter m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() );
sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM );
if ( seqValue.getLength( ) > 0 )
{
OUString sValue;
m_aNumberFormatter.GetInputLineString( seqValue[0], nIndex, sValue );
m_pShowSizeFT->SetText( CreateSizeText( sValue.toInt64( ) ) );
}
}
util::DateTime uDT;
OUString emptyDate = ConvertDateTime_Impl( "", uDT, rLocaleWrapper );
if ( aCmisProps[i].Id == "cmis:creationDate" &&
m_pCreateValFt->GetText( ) == emptyDate ||
m_pCreateValFt->GetText( ).isEmpty( ) )
{
Sequence< util::DateTime > seqValue;
aCmisProps[i].Value >>= seqValue;
if ( seqValue.getLength( ) > 0 )
{
m_pCreateValFt->SetText( ConvertDateTime_Impl( "", seqValue[0], rLocaleWrapper ) );
}
}
if ( aCmisProps[i].Id == "cmis:lastModificationDate" &&
m_pChangeValFt->GetText( ) == emptyDate ||
m_pChangeValFt->GetText( ).isEmpty( ) )
{
Sequence< util::DateTime > seqValue;
aCmisProps[i].Value >>= seqValue;
if ( seqValue.getLength( ) > 0 )
{
m_pChangeValFt->SetText( ConvertDateTime_Impl( "", seqValue[0], rLocaleWrapper ) );
}
}
}
}
m_pUseUserDataCB->SetState( static_cast<TriState>(m_bUseUserData) ); m_pUseUserDataCB->SetState( static_cast<TriState>(m_bUseUserData) );
m_pUseUserDataCB->SaveValue(); m_pUseUserDataCB->SaveValue();
m_pUseUserDataCB->Enable( bEnableUseUserData ); m_pUseUserDataCB->Enable( bEnableUseUserData );
......
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